-
Notifications
You must be signed in to change notification settings - Fork 4
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
More tokens #19
Merged
Merged
More tokens #19
Changes from 3 commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
a84f1d1
Add more tokens
JakeRoggenbuck 3b98677
Upper case
JakeRoggenbuck 98fd600
Add to lexer
JakeRoggenbuck 906169a
Merge branch 'main' into more-tokens
JakeRoggenbuck f82732d
Format
JakeRoggenbuck 0db7e6c
Add even more tokens from review
JakeRoggenbuck 3ae88de
Add all tokens
JakeRoggenbuck File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -17,6 +17,73 @@ typedef enum { | |
TT_CBRACKET, // ] | ||
TT_SEMI, // ; | ||
TT_NO_TOKEN, // Not a token | ||
|
||
TT_PERIOD, // . | ||
TT_COMMA, // , | ||
TT_MINUS, // - | ||
TT_PLUS, // + | ||
TT_STAR, // * | ||
TT_SLASH, // / | ||
TT_ASSIGN, // = | ||
TT_COLON, // : | ||
TT_MOD, // % | ||
TT_BAND, // & | ||
TT_LAND, // && | ||
TT_BOR, // | | ||
TT_LOR, // || | ||
TT_DEC, // -= | ||
TT_INC, // += | ||
TT_PLUSPLUS, // ++ | ||
TT_MINUSMINUS, // -- | ||
TT_DIVEQ, // /= | ||
TT_MULEQ, // *= | ||
TT_MODEQ, // %= | ||
TT_BANDEQ, // &= | ||
TT_BOREQ, // |= | ||
TT_LANDEQ, // &&= | ||
TT_LOREQ, // ||= | ||
TT_GREATER, // > | ||
TT_LESS, // < | ||
TT_LESSEQ, // <= | ||
TT_GREATEREQ, // >= | ||
TT_LEFTSHIFT, // << | ||
TT_RIGHTSHIFT, // >> | ||
TT_LNOT, // ! | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Also this is minor, but tilde is a bitwise NOT, so if we want to have naming consistent we could call them LNOT and BNOT respectively. |
||
TT_LTILDE, // ~ | ||
TT_EQUALS, // == | ||
|
||
TT_AUTO, // auto | ||
TT_BREAK, // break | ||
TT_CHAR, // char | ||
TT_CONST, // const | ||
TT_CASE, // case | ||
TT_CONTINUE, // continue | ||
TT_DOUBLE, // double | ||
TT_DO, // do | ||
TT_DEFAULT, // default | ||
TT_ENUM, // enum | ||
TT_ELSE, // else | ||
TT_EXTERN, // extern | ||
TT_FLOAT, // float | ||
TT_FOR, // for | ||
TT_GOTO, // goto | ||
TT_IF, // if | ||
TT_INT, // int | ||
TT_LONG, // long | ||
TT_RETURN, // return | ||
TT_REGISTER, // register | ||
TT_STATIC, // static | ||
TT_SWITCH, // switch | ||
TT_SHORT, // short | ||
TT_SIGNED, // signed | ||
TT_STRUCT, // struct | ||
TT_SIZEOF, // sizeof | ||
TT_TYPEDEF, // typedef | ||
TT_UNSIGNED, // unsigned | ||
TT_UNION, // union | ||
TT_VOID, // void | ||
TT_VOLATILE, // volitile | ||
TT_WHILE, // while | ||
} TokenType; | ||
|
||
// The maximum possible length of a token. | ||
|
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I thought of a couple more that need to be added:
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just realized -- also
TT_LEFTSHIFTEQUALS
andTT_RIGHTSHIFTEQUALS
for<<=
and>>=
.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh one more!!! (Hopefully this is the last one) there's also the dot operator
.
.