Your ROOT_URL in app.ini is https://git.ondrovo.com/ but you are visiting http://159.69.29.240:49153/MightyPork/forth/commit/8248637157398c0c462dd961e939a2808dc626cb?style=unified&whitespace=show-all
You should set ROOT_URL correctly, otherwise the web may not work correctly.
5 changed files with
47 additions and
8 deletions
README.md
src/fh_builtins_mem.c
src/fh_builtins_meta.c
src/fh_builtins_text.c
testfiles/combinedtest.f
@ -55,7 +55,7 @@ HERE HOLD I IF IMMEDIATE INVERT J LEAVE LITERAL LOOP LSHIFT M* MAX MIN MOD MOVE
REPEAT ROT RSHIFT S>D S" SIGN SM/REM SOURCE SPACE SPACES STATE SWAP THEN TYPE U. U< UNTIL UM * UM / MOD UNLOOP VARIABLE WHILE WORD XOR [ [ ' ] [ CHAR ] ]
CORE-EXT:
.( :NONAME 0< > 0> 2>R 2R> 2R@ < > ?DO AGAIN BUFFER: CASE ENDCASE ENDOF FALSE HEX HOLDS MARKER NIP OF PAD PICK ROLL S\" TO TRUE TUCK U.R U> UNUSED VALUE WITHIN
.( .R :NONAME 0< > 0> 2>R 2R> 2R@ < > ?DO AGAIN BUFFER: C" C ASE COMPILE, ENDCASE ENDOF ERASE FALSE HEX HOLDS MARKER NIP OF PAD PICK ROLL S\" TO TRUE TUCK U.R U> UNUSED VALUE WITHIN
\
Other sets:
@ -69,8 +69,7 @@ CORE:
ABORT" ACCEPT EVALUATE KEY
CORE-EXT:
.R ACTION-OF C" COMPILE, DEFER DEFER! DEFER@ ERASE IS
PARSE PARSE-NAME REFILL RESTORE-INPUT SAVE-INPUT SOURCE-ID [COMPILE]
ACTION-OF DEFER DEFER! DEFER@ IS PARSE PARSE-NAME REFILL RESTORE-INPUT SAVE-INPUT SOURCE-ID [COMPILE]
```
.
@ -246,6 +246,23 @@ static enum fh_error w_here(struct fh_thread_s *fh, const struct fh_word_s *w)
return FH_OK ;
}
static enum fh_error w_erase ( struct fh_thread_s * fh , const struct fh_word_s * w )
{
( void ) w ;
enum fh_error rv ;
uint32_t addr , len ;
TRY ( ds_pop ( fh , & len ) ) ;
TRY ( ds_pop ( fh , & addr ) ) ;
if ( len > 0 ) {
if ( addr + len < HEAP_SIZE ) {
LOG ( " Erase at 0x%08x, len %d " , addr , len ) ;
memset ( & fh - > heap [ addr ] , 0 , len ) ;
}
}
return FH_OK ;
}
const struct name_and_handler fh_builtins_mem [ ] = {
{ " chars " , wp_mul , 0 , 1 } ,
{ " char+ " , wp_add , 0 , 1 } ,
@ -259,6 +276,7 @@ const struct name_and_handler fh_builtins_mem[] = {
{ " aligned " , w_aligned , 0 , 0 } ,
{ " allot " , w_allot , 0 , 0 } ,
{ " buffer: " , w_buffer_colon , 0 , 0 } ,
{ " erase " , w_erase , 0 , 0 } ,
{ " align " , w_align , 0 , 0 } ,
{ " , " , w_comma , 0 , 0 } ,
{ " c, " , w_c_comma , 0 , 0 } ,
@ -338,6 +338,17 @@ static enum fh_error w_semicolon(struct fh_thread_s *fh, const struct fh_word_s
return FH_OK ;
}
static enum fh_error w_compile_comma ( struct fh_thread_s * fh , const struct fh_word_s * w )
{
( void ) w ;
enum fh_error rv ;
uint32_t xt ;
TRY ( ds_pop ( fh , & xt ) ) ;
TRY ( fh_put_instr ( fh , FH_INSTR_WORD , xt ) ) ;
return FH_OK ;
}
static enum fh_error w_immediate ( struct fh_thread_s * fh , const struct fh_word_s * w )
{
( void ) w ;
@ -695,5 +706,6 @@ const struct name_and_handler fh_builtins_meta[] = {
{ " execute " , w_execute , 0 , 0 } ,
{ " environment? " , w_env_query , 0 , 0 } ,
{ " marker " , w_marker , 0 , 0 } ,
{ " compile, " , w_compile_comma , 0 , 0 } ,
{ /* end marker */ }
} ;
@ -81,6 +81,19 @@ static enum fh_error w_dot(struct fh_thread_s *fh, const struct fh_word_s *w)
}
static enum fh_error w_dot_r ( struct fh_thread_s * fh , const struct fh_word_s * w )
{
( void ) w ;
enum fh_error rv ;
uint32_t a = 0 , n ;
TRY ( ds_pop ( fh , & n ) ) ;
TRY ( ds_pop ( fh , & a ) ) ;
FHPRINT ( " %*. " PRIi32 " " , n , ( int32_t ) a ) ;
return FH_OK ;
}
static enum fh_error w_u_dot ( struct fh_thread_s * fh , const struct fh_word_s * w )
{
( void ) w ;
@ -100,7 +113,7 @@ static enum fh_error w_u_r(struct fh_thread_s *fh, const struct fh_word_s *w)
TRY ( ds_pop ( fh , & n ) ) ;
TRY ( ds_pop ( fh , & a ) ) ;
FHPRINT ( " %*d " , n , a ) ;
FHPRINT ( " %*. " PRIu32 , n , a ) ;
return FH_OK ;
}
@ -482,6 +495,7 @@ const struct name_and_handler fh_builtins_text[] = {
{ " .( " , w_dot_quote , 1 , ' ) ' } ,
{ " . \\ \" " , w_dot_quote , 1 , ' \\ ' } , // escaped, this is non-standard
{ " . " , w_dot , 0 , 0 } ,
{ " .r " , w_dot_r , 0 , 0 } ,
{ " u. " , w_u_dot , 0 , 0 } ,
{ " type " , w_type , 0 , 0 } ,
{ " fill " , w_fill , 0 , 0 } ,
@ -838,7 +838,6 @@ T{ ' W1 >BODY -> HERE }T
T{ W1 -> HE R E 1 + } T
T{ W1 -> HE R E 2 + } T
0 [if ] \ TO D O
\ --- - ----- - ----- - ----- - ----- - ----- - ----- - ----- - ----- - ----- - ----- - ----- - - -
TESTI N G EVA L U A T E
@ -883,7 +882,6 @@ DROP -> 0 }T \ BLANK LINE RETURN ZERO-LENGTH STRING
: GS4 SOURC E >IN ! DROP ;
T{ GS 4 123 4 5 6
-> }T
[then ]
\ --- - ----- - ----- - ----- - ----- - ----- - ----- - ----- - ----- - ----- - ----- - ----- - - -
TESTI N G <# # #S # > HOLD SIGN B ASE > N UMBER HEX D E CIMAL
@ -1051,7 +1049,6 @@ TESTING OUTPUT: . ." CR EMIT SPACE SPACES TYPE U.
T{ OU T PUT-T E ST -> } T
0 [if ] \ FI X M E
\ --- - ----- - ----- - ----- - ----- - ----- - ----- - ----- - ----- - ----- - ----- - ----- - - -
TESTI N G INP U T: AC C E P T
@ -1065,7 +1062,6 @@ CREATE ABUF 50 CHARS ALLOT
;
T{ AC C EPT-T E ST -> } T
[then ]
\ --- - ----- - ----- - ----- - ----- - ----- - ----- - ----- - ----- - ----- - ----- - ----- - - -
TESTI N G DIC T IONAR Y SEAR C H RUL E S