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
Simplify the parser #1596
Open
certik
wants to merge
22
commits into
symengine:master
Choose a base branch
from
certik:parser
base: master
Could not load branches
Branch not found: {{ refName }}
Could not load tags
Nothing to show
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Simplify the parser #1596
Changes from all commits
Commits
Show all changes
22 commits
Select commit
Hold shift + click to select a range
1c6e804
Simplify parse_implicit_mul() and the parser
certik cb0e669
Update generated file
certik b8c896a
Get rid of rcp_static_cast()
certik b04d0f3
Simplify the grammar (slight speedup)
certik e4d4e2f
Update generated file
certik d7498ab
Move things together
certik bdcb6c9
Fix the shift/reduce conflict
certik ee175c1
Regenerate
certik 7df06e6
Use better formatting
certik 92e3c30
Regenerate
certik 372c0ce
Simplify func rule
certik e254b7c
Polish the syntax
certik 6afdbf9
Update
certik 64f0eb7
Simplify a few lines
certik f0a38da
Update generated file
certik 4f1a90d
Better formatting
certik 5fd6c92
Update generated file
certik 4b70f67
Enable warnings in Bison
certik cec1fde
Fix all warnings
certik f6cc107
Regenerate
certik 5f8eea5
Consolidate semantic declaration lines
certik 6e0ca77
Regenerate
certik File filter
Filter by extension
Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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'd rather this throw an exception even in Release mode instead of silently ignoring.
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.
Can you give an example when this can happen? I couldn't figure out any.
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.
And if we cannot figure out when this could happen for some user input, then the assert statement is appropriate. Asserts are for ensuring that our assumptions in the code are consistent/valid, but those do not run in release mode, because we assume our code is correct in release mode.
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.
If I remember correctly, there was some ambiguity in the grammar where 2e10 was parsed as an implicit mul.
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'll see if I can trigger it. Too bad there wasn't a test for this. All parsing tests pass. We need to test this.
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.
Quite frankly, I don't like this implicit mul parsing, due to such ambiguities. Do you think people want implicit mul to be parsed?
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.
Yes, julia people use this feature heavily in SymEngine.jl
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.
FWIW, I'm no fan of implicit mul.
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.
While we are at it, we should also fix #1462. We can even have a few different parsers if needed.