UnionCompilerDesign / compiler_core

The core of the compiler, runtime, and builder setup.
MIT License
1 stars 1 forks source link

Lexer - C99 Update #97

Closed CalebLItalien closed 1 week ago

CalebLItalien commented 1 month ago

Details

Now that we're transitioning to C99, we need to update the lexer to accept C tokens exclusively. This will mean adding some tokens and removing others, as well as updating unit tests.

Issue Type

Requirements

The following will be the acceptable tokens, all of which need to be unit tested:

Notes

For unit testing this issue, I'd like you to have one test for each token (that just tests that one token in isolation) and then at least a couple tests per token aiming for edge cases and sequences of tokens. I'd also like you to organize the testing into a format similar to token.rs. This may involve making breaking changes to SyntaxElement, so make sure to discuss the progress of this issue with whoever is handling the C99 SynaxElement update.

kjwelch commented 1 month ago

3 more tokens that might need to be added are *= (multiplication assignment), /= (division assignment), and %= (modulo assignment).

CalebLItalien commented 1 month ago

@kjwelch We're going to hold off on assignment operators until a later date. Feel free to open an issue for them we can hold off of for now.

kjwelch commented 3 weeks ago

I changed the Token for MINUS and NEGATIVE to be one token that is parsed differently. The token is called DASH