Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

macros within macros fails ? #168

Closed
JettMonstersGoBoom opened this issue Jun 3, 2021 · 1 comment
Closed

macros within macros fails ? #168

JettMonstersGoBoom opened this issue Jun 3, 2021 · 1 comment
Labels
bug Something isn't working
Milestone

Comments

@JettMonstersGoBoom
Copy link


.macro MA(value) {
	ldx #value 
}

.macro MB(value) {
	MA(32)
	ldy #value
}

MB(64)

.. expect ..


ldx #32
ldy #64  

.. result ..
ldy #64

@sagacity sagacity added the bug Something isn't working label Jun 3, 2021
@sagacity sagacity added this to the 0.7.0 milestone Jun 3, 2021
@sagacity
Copy link
Member

sagacity commented Jun 4, 2021

It turns it out this is a symbol resolution issue. When you are inside MB and then call MA, then MB.MA will become a scope (so you could, in theory, refer to any labels that were created in MB.MA).

However, when looking up the macro definition (which is MA, on the root scope), it will actually try to pick up MB.MA as the macro definition instead, since that's locally in scope in MB. Anyway. Doesn't work, because a scope definition isn't a macro definition.

tl;dr I'll fix it :)

sagacity added a commit that referenced this issue Jun 4, 2021
…re in scope with the same name that are NOT macro definitions. Closes #168.
sagacity added a commit that referenced this issue Jun 4, 2021
…re in scope with the same name that are NOT macro definitions. Closes #168.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants