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

Track local label scope, string equated as .. #1504

Merged
merged 2 commits into from
Sep 18, 2024

Conversation

Rangi42
Copy link
Contributor

@Rangi42 Rangi42 commented Sep 15, 2024

Follow-up to #1499

Fixes #1503

@Rangi42 Rangi42 added enhancement Typically new features; lesser priority than bugs rgbasm This affects RGBASM labels Sep 15, 2024
@Rangi42 Rangi42 added this to the v0.9.0 milestone Sep 15, 2024
@Rangi42 Rangi42 requested a review from ISSOtm September 15, 2024 03:37
Copy link
Member

@ISSOtm ISSOtm left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yep, looks good. I imagine that the debugfile macros can now make use of this:

def TIGHTEST_SCOPE equs "."
rept -1
    if !def({TIGHEST_SCOPE}.)
        break
    endc
    redef TIGHEST_SCOPE equs "{TIGHTEST_SCOPE}."
endr
println "@ - {{TIGHTEST_SCOPE}} = ", @ - {{TIGHTEST_SCOPE}}

@ISSOtm
Copy link
Member

ISSOtm commented Sep 18, 2024

(If this seems correct to you, then I'll let you merge this PR.)

@Rangi42
Copy link
Contributor Author

Rangi42 commented Sep 18, 2024

That looks basically correct. You can't rept by a negative count so that should be rept $7fff_ffff; "TIGHEST_SCOPE" is a typo; and I would add a sanity check in case !def(.); but the use of ., .., etc is correct (which I tested on the two label levels we currently support).

@Rangi42 Rangi42 merged commit 9ef2e43 into gbdev:master Sep 18, 2024
22 checks passed
@Rangi42 Rangi42 deleted the local-scope branch September 18, 2024 13:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement Typically new features; lesser priority than bugs rgbasm This affects RGBASM
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Split "label scope" into "global scope" and "local scope", tracking both, with . and .. string constants
2 participants