-
-
Notifications
You must be signed in to change notification settings - Fork 176
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
[Help wanted] Turn lexer back into flex definition #485
Comments
This is actually progressing—who would've guessed. I have currently the following left to implement (at least, that I'm aware of):
We do have a problem, though. Some features need to be axed in order for this to be possible..!
Side note: if the above two |
How will this affect existing code? Can you give examples of what won't work afterwards? |
How this affects existing code is the question I always ask myself about each feature change. We don't have any usage statistics beyond pret's disassemblies, and this doesn't even include any hacks based on them.
The reason why I do not want to make "naked" interpolations work like macro args is that parsing such interpolations is very complex, especially as they can be nested. Thus, it's OK to handle inside a string, since we're already working with a blob of data, but outside of it, it's expected to span multiple tokens (like macro args). Macro args are not handled in the lexer rules proper, since they happen beyond the concept of tokens; instead, the code responsible for filling the lexer's text buffer ( The problem that "naked" symbol interpolations introduce is that they are really complicated to process. The hardest part is that they can be nested, which opens the can of worms of where to write the expanded results to, and so on. (It worked in the old lexer because the target buffer was large) |
The only issue I see is that some auto-generation tools (particularly sdcc) generate an |
This is irrelevant, because SDCC uses a custom weird assembler as its back-end instead of RGBDS. |
@ISSOtm And it also has an option to generate RGBDS assembly, which is where I found that example. |
But that wouldn't be valid RGBDS syntax; where is the code generating that? |
My best guess would be in |
The lexer is currently a 1 kloc (+ 800 kloc if you count
globlex
) monstrosity of a modified auto-generated file.This should really be changed back to a flex definition somehow. The modifications made to it might require a custom program skeleton (probably, I think, but eh), but that would be certainly much better than what we currently have.
The text was updated successfully, but these errors were encountered: