Raise errors on hex literals with zero length

This commit is contained in:
Andrew Alderwick 2021-10-30 07:48:41 +01:00
parent 80b4e4f88d
commit d5f3bc376e
2 changed files with 4 additions and 0 deletions

View File

@ -43,6 +43,9 @@ EOD
expect_failure 'Invalid hexadecimal: #defg' <<'EOD' expect_failure 'Invalid hexadecimal: #defg' <<'EOD'
|1000 #defg |1000 #defg
EOD EOD
expect_failure 'Invalid hexadecimal: #' <<'EOD'
|1000 #
EOD
expect_failure 'Address not in zero page: .hello' <<'EOD' expect_failure 'Address not in zero page: .hello' <<'EOD'
|1000 @hello |1000 @hello
.hello .hello

View File

@ -376,6 +376,7 @@ include projects/library/file-read-chunks.tal
OR 00 otherwise ) OR 00 otherwise )
;asma/token LDA2 DUP2 ,strlen JSR ( token* length^ ) ;asma/token LDA2 DUP2 ,strlen JSR ( token* length^ )
DUP2 #0004 GTH2 ,&fail2 JCN DUP2 #0004 GTH2 ,&fail2 JCN
ORAk #00 EQU ,&fail2 JCN
&resume &resume
#0002 GTH2 ROT ROT #0002 GTH2 ROT ROT
LIT2r 0000 LIT2r 0000