-
Notifications
You must be signed in to change notification settings - Fork 171
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
[WIP] Fix minus literal #557
Conversation
compiler/lexer/lexer.go
Outdated
return true | ||
} | ||
|
||
p -= 1 |
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.
should replace p -= 1 with p--
Codecov Report
@@ Coverage Diff @@
## master #557 +/- ##
==========================================
- Coverage 82.68% 82.39% -0.29%
==========================================
Files 53 53
Lines 7001 7045 +44
==========================================
+ Hits 5789 5805 +16
- Misses 967 992 +25
- Partials 245 248 +3
Continue to review full report at Codecov.
|
Updated the PR and fixed most issues. I believe the PR has been simplified than the initial one. The remaining issues are related with » a=1; +a
#» 2 # invalid: should be 1 FYI: current master is also affected by the issue. |
} | ||
} | ||
|
||
func (l *Lexer) isUnary() bool { |
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 think this should be a helper function that receives an rune
argument just like isIdentifier
, instead of a lexer
's function. We should change either its behavior or its name for the consistency.
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.
First I thought as that. But this helper function goes backward the lexer so *Lexer
is needed.
Passing *Lexer
via argument might be ineffective.
I will change the function name to checkUnary()
.
To close #379 and to fix:
+1
unhandled #555Currently
-1.class
or-1.0.class
works, but I'm wondering how deep-duplicated operators like--+- -++-- -
or1 + + - + 1
.1- - - 1
works.1+ ++ -- +1
does not work well.I guess the implementation should be more simplified.
Looks like I'm catching cold and will be back soon.