-
Notifications
You must be signed in to change notification settings - Fork 162
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: refactor scanner and reader #2371
Closed
Closed
Conversation
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
fingolfin
added
do not merge
PRs which are not yet ready to be merged (e.g. submitted for discussion, or test results)
topic: kernel
release notes: not needed
PRs introducing changes that are wholly irrelevant to the release notes
labels
Apr 18, 2018
Codecov Report
@@ Coverage Diff @@
## master #2371 +/- ##
==========================================
+ Coverage 73.69% 73.71% +0.02%
==========================================
Files 484 484
Lines 245670 245524 -146
==========================================
- Hits 181042 180985 -57
+ Misses 64628 64539 -89
|
fingolfin
force-pushed
the
mh/scanner-value
branch
2 times, most recently
from
April 19, 2018 22:15
e4c4ac3
to
b52c43f
Compare
This was referenced Apr 20, 2018
fingolfin
force-pushed
the
mh/scanner-value
branch
2 times, most recently
from
April 22, 2018 16:20
1e0159c
to
05d78e8
Compare
fingolfin
force-pushed
the
mh/scanner-value
branch
from
April 22, 2018 21:03
05d78e8
to
6ba518d
Compare
Parsing float literals that start with a dot, like `.123`, is implemented using a hack, where the reader tells the scanner that it should look for a number expression (normally, the scanner never changes the state of the reader, except for parsing long integers and float literals). We change the way this is done to make it stand out more. Further benefits from the change are that we can get rid of S_PARTIALFLOAT1, simplifying the intricate state machine for parsing. Moreover, STATE(Symbol) now is read-only in the reader.
... and not in ClearError
fingolfin
changed the title
WIP: refactor scanner and reader; simplify parsing of long string/float/integer literals
WIP: refactor scanner and reader
Apr 22, 2018
This has been superseded by various other PRs, most recently PR #2467 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
do not merge
PRs which are not yet ready to be merged (e.g. submitted for discussion, or test results)
release notes: not needed
PRs introducing changes that are wholly irrelevant to the release notes
topic: kernel
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.
This is currently based on #2040, so that PR should be merged first.
Also, I have not yet fully rewritten the float and integer literal scanning (to avoid the
S_PARTIAL*
states); or rather, I had changes for that, but decided to start from scratch with this PR, in an attempt to make the change more incremental, and hence easier to review, at least when looking at it commit-by-commit.However, I wanted to get this out now, to (a) see what the full test suite makes of it, and (b) to give people an early chance to spot issues and leave comments (though of course most likely nobody will have time to do that ;-).
One thing on which everybody can comment:The commit "scanner: remove GetCleanedChar" is a bit experimental, as it changes user visible behaviour; what do people think about this in terms of how "bad" it is? To illustrate, before the change, you might see this:
after:
To me, this is acceptable if this allow us to gain substantially simpler code, but I wonder if there are other reasons for the existence and use of
GetCleanedChar
in the float parser that I missed? Perhaps @stevelinton has some thought on this?