8000 ca65: .undef doesn't work inside macros · Issue #2678 · cc65/cc65 · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content
ca65: .undef doesn't work inside macros #2678
Open
@everything8215

Description

@everything8215

.undef doesn't seem to work when used inside .macro-style or .define-style macros. A few minimal examples are below. It seems like macro replacement isn't getting switched off, so it's trying to undefine the defined value rather than the macro itself. Note that .define works as expected when used inside a macro.

; case 1: undefine macro outside a macro (works fine)
.define def1 1
.undef def1


; case 2: undefine a constant-valued macro inside a macro (fails)
.define def2 2
.mac undef2
  .undef def2
.endmac
undef2

; undef.asm(11): Error: Identifier expected
; undef.asm(2): Note: Macro was defined here


; case 3: undefine a variable-valued macro inside a macro (fails differently)
.define def3 Three
.mac undef3
  .undef def3
.endmac
undef3

; undef.asm(22): Error: No such macro: Three
; undef.asm(18): Note: Macro was defined here


; case 4: undefine a macro inside a C-style macro (fails)
.define def4 4
.define undef4 .undef def4
undef4

; undef.asm(31): Error: Identifier expected
; undef.asm(29): Note: Macro was defined here

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      0