Skip to content

Commit

Permalink
Mend forth/ building
Browse files Browse the repository at this point in the history
Permit a newline right after a `.directive`

Insert semicolons to break statements (required by fa3755d).
  • Loading branch information
kulp committed Sep 17, 2014
1 parent 1246310 commit add276e
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 13 deletions.
17 changes: 9 additions & 8 deletions forth/level0.tas.cpp
@@ -1,14 +1,15 @@
#include "forth_common.th"
#include "serial.th"

#define BINOP(Op) \
.word . + 1 \
T0 <- [S + 2] \
T1 <- [S + 1] \
W <- T0 Op T1 \
S <- S + 1 \
W -> [S + 1] \
goto(NEXT)
#define BINOP(Op) \
.word . + 1 ; \
T0 <- [S + 2] ; \
T1 <- [S + 1] ; \
W <- T0 Op T1 ; \
S <- S + 1 ; \
W -> [S + 1] ; \
goto(NEXT) ; \
//

.set link, 0

Expand Down
2 changes: 1 addition & 1 deletion forth/main.tas.cpp
Expand Up @@ -3,7 +3,7 @@

.set link, @level1_link

.global INBUF .global INPOS .global INLEN
.global INBUF ; .global INPOS ; .global INLEN
.L_INBUF_before:
INBUF:
.utf32 " "
Expand Down
8 changes: 4 additions & 4 deletions src/parser.y
Expand Up @@ -237,15 +237,15 @@ ascii
{ tenyr_pop_state(pd->scanner); $ascii = make_ascii($string); }

data
: WORD reloc_expr_list
: WORD opt_nl reloc_expr_list
{ tenyr_pop_state(pd->scanner); $data = make_data(pd, $reloc_expr_list); }
| ZERO reloc_expr
| ZERO opt_nl reloc_expr
{ tenyr_pop_state(pd->scanner); $data = make_zeros(pd, $reloc_expr); }

directive
: GLOBAL symbol_list
: GLOBAL opt_nl symbol_list
{ tenyr_pop_state(pd->scanner); $directive = make_global(pd, &yylloc, &$symbol_list); }
| SET SYMBOL ',' reloc_expr
| SET opt_nl SYMBOL ',' reloc_expr
{ tenyr_pop_state(pd->scanner); $directive = make_set(pd, &yylloc, &$SYMBOL, $reloc_expr); }

symbol_list
Expand Down

0 comments on commit add276e

Please sign in to comment.