Browse code

Raise errors on hex literals with zero length

Andrew Alderwick authored on 30/10/2021 06:48:41
Showing 2 changed files
... ...
@@ -43,6 +43,9 @@ EOD
43 43
 expect_failure 'Invalid hexadecimal: #defg' <<'EOD'
44 44
 |1000 #defg
45 45
 EOD
46
+expect_failure 'Invalid hexadecimal: #' <<'EOD'
47
+|1000 #
48
+EOD
46 49
 expect_failure 'Address not in zero page: .hello' <<'EOD'
47 50
 |1000 @hello
48 51
 	.hello
... ...
@@ -376,6 +376,7 @@ include projects/library/file-read-chunks.tal
376 376
                          OR 00 otherwise )
377 377
 	;asma/token LDA2 DUP2 ,strlen JSR ( token* length^ )
378 378
 	DUP2 #0004 GTH2 ,&fail2 JCN
379
+	ORAk #00 EQU ,&fail2 JCN
379 380
 	&resume
380 381
 	#0002 GTH2 ROT ROT
381 382
 	LIT2r 0000