From af0cf5f7bc89391a81b5eb33299224bdde17372a Mon Sep 17 00:00:00 2001 From: Olaf Seibert Date: Sat, 23 Jan 2021 17:18:08 +0100 Subject: [PATCH] Here is the "Junk at end of line" case that I wanted to catch. --- assemble.c | 4 ++-- tests/test-float.lst.ok | 2 ++ 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/assemble.c b/assemble.c index 46390be..bbc3bc9 100644 --- a/assemble.c +++ b/assemble.c @@ -35,7 +35,7 @@ static int check_eol( return 1; } - report(stack->top, "Junk at end of line ('%c')", *cp); + report(stack->top, "Junk at end of line ('%c')\n", *cp); return 0; } @@ -1375,7 +1375,7 @@ static int assemble( store_word(stack->top, tr, 2, word); mode_extension(tr, &mode, stack->top); } - return 1; + return CHECK_EOL; case OC_2GEN: /* Two general addressing modes */ { diff --git a/tests/test-float.lst.ok b/tests/test-float.lst.ok index ac52262..f314f7d 100644 --- a/tests/test-float.lst.ok +++ b/tests/test-float.lst.ok @@ -143,7 +143,9 @@ 120 000420 172127 140263 addd #-1.4,ac1 ; as float 121 122 ; TODO: let parser check for junk at end of line +test-float.mac:123: ***ERROR Junk at end of line ('5') 123 000424 170627 000002 absf #2.5 ; bad: operand is destination +test-float.mac:124: ***ERROR Junk at end of line ('5') 124 000430 170527 000002 tstd #2.5 ; bad: operand is considered FDST by the arch handbook 125 000434 174027 000002 stf ac0,#2.5 ; bad: junk at end of line 126 000440 174027 000002 stf ac0,#2 ; doesn't makes sense but MACRO11 allows it