-
-
Notifications
You must be signed in to change notification settings - Fork 173
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
Implement [[ fragment literals ]]
#1614
base: master
Are you sure you want to change the base?
Conversation
This feature is referred to as "code/data literals" in ASMotor, and simply as "literals" in some older assemblers like MIDAS for the PDP-10. RGBASM already had the "section fragments" feature for keeping disparate contents together when linked, so these worked naturally as "fragment literals".
Summarizing some points from the discussion in #500:
|
Since this is a backwards-compatible feature, I think it's fine to add in a patch-level release (i.e. 0.9.1 instead of 0.10.0). We've done so before, like with 0.6.1 adding |
Note that one of the initial blockers to this feature was the global parser state that fragment literals had to back up. We've long since gotten rid of that, consolidating them into the stacks of lexer state and fstack nodes. |
If anyone wants to build this and test it out before it gets merged -- notice any bugs, inconvenient limits, nice use cases, etc -- that would be very helpful! |
Fixes #500
Replaces #716 and #1603
Anywhere you would normally use an address, such as
dw Label
orld hl, Label
orcall Label
, you can use a[[ fragment literal ]]
instead. Each fragment literal becomes its ownSECTION FRAGMENT
to be appended to the current section.