Skip to content

Commit

Permalink
Fixes duplication of last line in the parsing.
Browse files Browse the repository at this point in the history
  • Loading branch information
dmsc committed Jul 25, 2024
1 parent 52f0f88 commit 6db31a9
Show file tree
Hide file tree
Showing 5 changed files with 6 additions and 5 deletions.
2 changes: 2 additions & 0 deletions src/alloc.asm
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,9 @@ loop:
.importzp opos
; Move from "prog_ptr", up by "alloc_size"
ldx #prog_ptr - mem_start
.assert prog_ptr = mem_start, error, "Prog Ptr should be at mem start"
lda opos
stx opos
bne alloc_area_8
rts
.endproc
Expand Down
3 changes: 1 addition & 2 deletions src/parse.asm
Original file line number Diff line number Diff line change
Expand Up @@ -51,11 +51,11 @@
buf_ptr:.res 2
end_ptr:.res 2
bmax: .res 1
opos: .res 1
pptr: .res 2

; This variables are cleared in one loop:
zp_clear_start:
opos: .res 1
linenum: .res 2
loop_sp: .res 1
var_sp: .res 1
Expand Down Expand Up @@ -265,7 +265,6 @@ parse_start:
; Parse statement, A=0 on input
ldx #<(PARSE_START-1)
ldy #>(PARSE_START-1)
sta opos
pha

; Parser sub
Expand Down
2 changes: 1 addition & 1 deletion testsuite/tests/err-endif.chk
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Name: Check proper parsing of ENDIF
Test: compile-error
Error: no end loop/proc/if at line 9 column 0
Error: no end loop/proc/if at line 8 column 0
Error-pos: 9:0
2 changes: 1 addition & 1 deletion testsuite/tests/err-loop.chk
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Name: Check proper parsing of LOOP
Test: compile-error
Error: no end loop/proc/if at line 7 column 0
Error: no end loop/proc/if at line 6 column 0
Error-pos: 7:0
2 changes: 1 addition & 1 deletion testsuite/tests/err-wend.chk
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Name: Check proper parsing of WEND
Test: compile-error
Error: no end loop/proc/if at line 8 column 0
Error: no end loop/proc/if at line 7 column 0
Error-pos: 8:0

0 comments on commit 6db31a9

Please sign in to comment.