Merge pull request #2777 from kugelfuhr/kugelfuhr/ca65-errors

Improve error handling for ca65
This commit is contained in:
Bob Andrews
2025-07-10 17:05:32 +02:00
committed by GitHub
94 changed files with 973 additions and 399 deletions

View File

@@ -1,6 +1,4 @@
.macpack cpu
; step 1: try to assemble an instruction that's exclusive to this set
; (when possible)

View File

@@ -0,0 +1 @@
0:

View File

@@ -0,0 +1 @@
foo

View File

@@ -0,0 +1,3 @@
.struct x
.word
.endstruct

View File

@@ -0,0 +1 @@
lda #$00 foo

View File

@@ -0,0 +1 @@
lda ($00),a

View File

@@ -0,0 +1 @@
lda ($00,a)

View File

@@ -0,0 +1,3 @@
.struct foo
bar
.endstruct

View File

@@ -0,0 +1 @@
127

View File

@@ -0,0 +1 @@
.fileopt author

View File

@@ -0,0 +1 @@
.assert 1

View File

@@ -0,0 +1,2 @@
lda |

View File

@@ -0,0 +1 @@
.byte 0 1

View File

@@ -0,0 +1 @@
.define debug(x) .out x

View File

@@ -0,0 +1,3 @@
.repeat 10
.byte $00

View File

@@ -0,0 +1,4 @@
.import foo
foo = 3

View File

@@ -0,0 +1,5 @@
foo = 3
foo = 2

View File

@@ -0,0 +1,5 @@
.macro mac
lda #$00
.byte 3

View File

@@ -0,0 +1,5 @@
.mac lda, val
ldx #val
txa

View File

@@ -0,0 +1,4 @@
.macro mac
.local .endmacro
.endmacro
mac

View File

@@ -0,0 +1,6 @@
.macro mac val
lda #val
.endmacro
.macro mac val
lda #val
.endmacro

View File

@@ -0,0 +1,5 @@
.macro foo a1, a2
.byte a1, a2
.endmacro
foo 1, 2, 3

View File

@@ -0,0 +1,7 @@
.macro mac1
.delmac mac2
.endmacro
.macro mac2
mac1
.endmacro
mac2

View File

@@ -0,0 +1,6 @@
.macro mac
.define endmac .endmacro
.endmacro
.macro mac
.define endmac .endmacro
.endmacro

View File

@@ -1,6 +1,6 @@
110-capabilities.s:3: Error: Arguments to .CAPABILITY must be identifiers
110-capabilities.s:8: Error: Arguments to .CAPABILITY must be identifiers
110-capabilities.s:8: Error: ')' expected
110-capabilities.s:3: Error: Expected a capability name but found ')'
110-capabilities.s:8: Error: Expected a capability name but found 'end-of-line'
110-capabilities.s:8: Error: Expected ')' but found 'end-of-line'
110-capabilities.s:12: Error: Not a valid capability name: CPU_HAS_BR
110-capabilities.s:17: Error: ')' expected
110-capabilities.s:17: Error: Unexpected trailing garbage characters
110-capabilities.s:17: Error: Expected ')' but found 'cpu_has_bra8'
110-capabilities.s:17: Error: Expected 'end-of-line' but found 'cpu_has_bra8'

View File

@@ -0,0 +1 @@
120-errormsg.s:1: Error: Expected a mnemonic but found '0'

View File

@@ -0,0 +1 @@
121-errormsg.s:1: Error: Expected ':' after identifier to form a label but found 'end-of-line'

View File

@@ -0,0 +1 @@
122-errormsg.s:1: Error: Expected a struct/union name but found 'X'

View File

@@ -0,0 +1 @@
123-errormsg.s:1: Error: Expected 'end-of-line' but found 'foo'

View File

@@ -0,0 +1 @@
124-errormsg.s:1: Error: Expected 'Y' but found 'A'

View File

@@ -0,0 +1,2 @@
125-errormsg.s:1: Error: Expected 'X' or 'S' but found 'A'
125-errormsg.s:1: Error: Illegal addressing mode

View File

@@ -0,0 +1 @@
126-errormsg.s:2: Error: Expected a storage allocator after the field name but found 'end-of-line'

View File

@@ -0,0 +1 @@
127-errormsg.s:1: Error: Expected a mnemonic but found '127'

View File

@@ -0,0 +1 @@
128-errormsg.s:1: Error: Expected ',' but found 'end-of-line'

View File

@@ -0,0 +1 @@
129-errormsg.s:1: Error: Expected ',' but found 'end-of-line'

View File

@@ -0,0 +1,2 @@
130-errormsg.s:1: Error: Expected an expression but found '|'
130-errormsg.s:1: Error: Expected an expression but found 'end-of-line'

View File

@@ -0,0 +1 @@
131-errormsg.s:1: Error: Expected 'end-of-line' but found '1'

View File

@@ -0,0 +1,2 @@
132-errormsg.s:1: Error: Expected a parameter name but found 'X'
132-errormsg.s:1: Error: Expected ')' but found 'X'

View File

@@ -0,0 +1,2 @@
133-errormsg.s:3: Error: Expected '.ENDREPEAT' but found 'end-of-file'
133-errormsg.s:1: Note: For this '.REPEAT' command

View File

@@ -0,0 +1,2 @@
134-errormsg.s:3: Error: Symbol 'foo' is already an import
134-errormsg.s:1: Note: The symbol was previously imported here

View File

@@ -0,0 +1,2 @@
135-errormsg.s:4: Error: Symbol 'foo' is already defined
135-errormsg.s:1: Note: The symbol was previously defined here

View File

@@ -0,0 +1,2 @@
136-errormsg.s:5: Error: Missing '.ENDMACRO' for definition of macro 'mac'
136-errormsg.s:1: Note: Macro definition started here

View File

@@ -0,0 +1,3 @@
137-errormsg.s:1: Error: Cannot use an instruction as macro name
137-errormsg.s:5: Error: Expected '.ENDMACRO' but found 'end-of-file'
137-errormsg.s:1: Note: Macro definition started here

View File

@@ -0,0 +1,3 @@
138-errormsg.s:2: Error: Expected an identifier but found '.ENDMACRO'
138-errormsg.s:4: Error: Macro 'mac' contains errors and cannot be expanded
138-errormsg.s:1: Note: Definition of macro 'mac' was here

View File

@@ -0,0 +1,2 @@
139-errormsg.s:4: Error: A macro named 'mac' is already defined
139-errormsg.s:1: Note: Previous definition of macro 'mac' was here

View File

@@ -0,0 +1,2 @@
140-errormsg.s:5: Error: Too many parameters for macro 'foo'
140-errormsg.s:1: Note: See definition of macro 'foo' which was here

View File

@@ -0,0 +1,3 @@
141-errormsg.s:7: Error: Cannot delete macro 'mac2' which is currently expanded
141-errormsg.s:5: Note: Expanded from macro here
141-errormsg.s:2: Note: Expanded from macro here

View File

@@ -0,0 +1,2 @@
142-errormsg.s:4: Error: A macro named 'mac' is already defined
142-errormsg.s:1: Note: Previous definition of macro 'mac' was here