Browse code

Fixed line numbers in asma error reports

Andrew Alderwick authored on 06/10/2021 05:58:30
Showing 1 changed files
... ...
@@ -311,8 +311,8 @@ include projects/library/file-read-chunks.tal
311 311
 	LDAk #0a NEQ ( end-chunk* ws-char* not-newline / line^ start-of-token* )
312 312
 	#00 OVR2 STA
313 313
 	STH2r ,asma-assemble-token JSR ( end-chunk* ws-char* not-newline / line^ )
314
-	JMP INC2r ( end-chunk* ws-char* / line^ )
315 314
 	asma-IF-ERROR ,&error JCN
315
+	JMP INC2r ( end-chunk* ws-char* / line^ )
316 316
 	;asma/break LDA ,&break JCN
317 317
 	INC2 STH2k ( end-chunk* start-of-token* / line^ start-of-token* )
318 318
 	,&loop JMP
... ...
@@ -323,9 +323,11 @@ include projects/library/file-read-chunks.tal
323 323
 	INC2 NIP2 ( assembled-up-to-ptr* / line^ )
324 324
 	STH2r SWP2 JMP2r
325 325
 
326
-	&error ( end-chunk* ws-char* / line^ )
326
+	&error ( end-chunk* ws-char* not-newline / line^ )
327 327
 	( return no progress with assembly to make file-read-chunks exit )
328
-	POP2 POP2 STH2r ;asma-read-buffer
328
+	POP POP2 POP2
329
+	STH2kr ;asma/line STA2
330
+	STH2r ;asma-read-buffer
329 331
 	JMP2r
330 332
 
331 333
 	&eof ( end-chunk* ws-char* / line^ start-of-token* )