Skip to content
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

Fix some issues about negative number and expression #265

Merged
merged 5 commits into from
Jan 7, 2019

Conversation

lixingwang
Copy link
Contributor

What kind of change does this PR introduce? (check one with "x")

[*] Bugfix
[] Feature
[] Code style update (formatting, local variables)
[] Refactoring (no functional changes, no api changes)
[] Other... Please describe:

Fixes: #

What is the current behavior?
Have issue support expression like: 3-2, parser takes -2 as a negative number rather than operator - and number 2.
What is the new behavior?
Correct BNF to take negative out of lexer which should be part of grammar.

# Conflicts:
#	core/mapper/exprmapper/expression/gocc/parser/actiontable.go
#	core/mapper/exprmapper/expression/gocc/parser/gototable.go
#	core/mapper/exprmapper/expression/gocc/parser/parser.go
#	core/mapper/exprmapper/expression/gocc/parser/productionstable.go
@@ -117,6 +116,7 @@ ExprLiteral

Literal
: Int <<direction.NewIntLit($0)>>
| "-"Int <<direction.NewNagtiveLit($1)>>
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@lixingwang : what about negative floats?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@vijaynalawade I missed float. pushed negative float supporting in PR.

@lixingwang lixingwang merged commit ee48e79 into master Jan 7, 2019
@lixingwang lixingwang deleted the negative-expr branch January 7, 2019 17:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants