-
-
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
Undeprecate ld [$ff00+c]
#1600
Comments
Personally, I don't think we should support anything other than |
I favor treating it like how we do |
Yes, that's how it's been ever since the lexer rewrite in 0.4.2. (Prior to that, Personally I'd like it if the parser allowed five-token |
Thanks to the community feedback, here's what I'll probably go with. Still deprecate |
In 0.9.0 we deprecated
ld [c]
in favor ofldh [c]
. We also deprecatedld [$ff00+c]
, expectingldh [c]
to be the sole accepted syntax, but that was not documented in rgbasm-old(5).ld [$ff00+c]
turns out to be common enough that it could be worth supporting.There is a problem with doing so. Old versions of RGBDS really did just support
[$ff00+c]
or single-spaced[$ff00 + c]
(it was treated as a single token). However, as we refactored and improved the lexer+parser, this ended up becoming way too general:$ff00
was easier to lex as a number than as a literal (case-insensitive) token. But that means RGBASM can technically parse cursed code like[65280 + c]
, or[0o177400 + C]
, or[0xff00+LOW(bc)]
. We never intended to allow that sort of flexibility -- and it's actually hard to avoid a parser ambiguity since+
is also an operator in numeric expressions.So. I kind of want to support the semi-popular
[$ff00+c]
/[$ff00 + c]
syntax. But I do not want to give the impression that all those weird nontraditional variants are supported. And ideally those variants would be an outright error.I'm open to community feedback on this question. (See the Discord poll!)
The text was updated successfully, but these errors were encountered: