-
Notifications
You must be signed in to change notification settings - Fork 26
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
Using the "not" keyword in variable names #115
Comments
The space only gets inserted in if one uses |
The reason for this is that
The |
@EliasC |
@TheGrandmother Check my example again. |
@EliasC Using my imaginary "knowlege" of the parser i traced it to this in
|
Just changing it to |
@TheGrandmother Something like that*. Probably even making sure that the following character is not a letter ( *where "that" isn't your last comment :) |
How could we do that? Do we have any "regex" like stuffs in the parser? |
We have a parser ;) |
I understand :P But how would one go about adding the check for something not being a letter? |
Changing line 224 to this |
@albertnetymk That breaks a bunch of other things it seems. |
@EliasC Indeed. Need to deal with it systematically. |
How about this?
|
@albertnetymk That would solve this particular instance of the problem, but it would be nice with a solution that is general enough to solve the problem for the infix operators as well (see above). |
@EliasC Indeed. The problem seems a lexer problem, treating |
The solution turned out to be very simple! Here is the code for parsing prefix operators:
In our case I think we should keep the |
Neat. +1 |
When using the string "not" as a prefix of a variable name, interesting things happen.
See this example program:
The output:
The problem goes away if you add some char before "not", e.g. replacing "notice" with "a_notice".
The text was updated successfully, but these errors were encountered: