return NEXT
end)
-BTICK_CFA = defWord("[']",
- [FROMR_CFA, DUP_CFA, INCR_CFA, TOR_CFA, FETCH_CFA, EXIT_CFA])
-
HERE_CFA = defWord("HERE",
[H_CFA, FETCH_CFA, EXIT_CFA])
end, flags=F_IMMED)
DOES_CFA = defWord("DOES>",
- [BTICK_CFA, LIT_CFA, COMMA_CFA, HERE_CFA, LIT_CFA, 3, ADD_CFA, COMMA_CFA,
- BTICK_CFA, DOES_HELPER_CFA, COMMA_CFA, BTICK_CFA, EXIT_CFA, COMMA_CFA, EXIT_CFA],
+ [LIT_CFA, LIT_CFA, COMMA_CFA, HERE_CFA, LIT_CFA, 3, ADD_CFA, COMMA_CFA,
+ LIT_CFA, DOES_HELPER_CFA, COMMA_CFA, LIT_CFA, EXIT_CFA, COMMA_CFA, EXIT_CFA],
flags=F_IMMED)
LBRAC_CFA = defPrimWord("[", () -> begin
COMMA_CFA, BRANCH_CFA, -29,
# No word found, parse number
- NUMBER_CFA, BTICK_CFA, LIT_CFA, COMMA_CFA, COMMA_CFA, BRANCH_CFA, -36,
+ NUMBER_CFA, LIT_CFA, LIT_CFA, COMMA_CFA, COMMA_CFA, BRANCH_CFA, -36,
# Interpreting
FIND_CFA, QDUP_CFA, ZBRANCH_CFA, 5,
: '\n' 10 ;
: BL 32 ;
-
-: LITERAL IMMEDIATE ['] LIT , , ;
+: CR '\n' emit ;
+: SPACE BL emit ;
: ' BL WORD FIND DROP ;
+: [COMPILE] IMMEDIATE ' , ;
+: ['] IMMEDIATE
+ LIT LIT , ' , ;
+
+: LITERAL IMMEDIATE ['] LIT , , ;
: CHAR BL WORD 1+ @ ;
: [CHAR] IMMEDIATE
['] LIT , ,
;
-: CR '\n' emit ;
-: SPACE BL emit ;
-
-: [COMPILE] IMMEDIATE
- BL WORD \ get the next word
- FIND DROP \ find it in the dictionary
- , \ and compile that
-;
-
: RECURSE IMMEDIATE
LATEST @ \ LATEST points to the word being compiled at the moment
>CFA \ get the codeword