-
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
More tokens #19
Conversation
Keywords (other than typedef) added from memory
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.
Thought of a couple more missing operators (thank you C, very cool)
src/lexer/token.h
Outdated
@@ -17,6 +17,73 @@ typedef enum { | |||
TT_CBRACKET, // ] | |||
TT_SEMI, // ; | |||
TT_NO_TOKEN, // Not a token | |||
|
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:
TT_XOR, // ^
TT_XOREQ // ^=
TT_POINT, // ->
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
and TT_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 .
.
src/lexer/token.h
Outdated
TT_GREATEREQ, // >= | ||
TT_LEFTSHIFT, // << | ||
TT_RIGHTSHIFT, // >> | ||
TT_LNOT, // ! |
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.
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.
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.
You mentioned you were going to add ttype_from_string
support for all operators, so I will approve once that is finished
Okay, sounds good |
STREQ has been added for all operators |
fixes #16