-
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
Add operator lexing #35
Conversation
Do not want to merge yet until token type identification is fixed. |
Seems like it doesn't break anything, but I'm convinced that the code ungetc(c, l->fp);
t->contents[pos - 1] = '\0';
t->type = ttype_from_string(t->contents);
t->length = pos;
return 0; doesn't need to be duplicated inside of |
I could |
Try adding a return 1 to those places where you want to void the values of t. Then inside of lex() if it is determined to be 1, set t appropriately. I think that makes it just clearer. |
t->contents[pos++] = (c = getc(l->fp)); | ||
} | ||
// We've ended! | ||
// Can we reduce this code duplication from above in a smart way? |
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.
A few lines is okay imo
No description provided.