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

Minor fixes for parser.mly #1844

Merged
merged 2 commits into from Jun 19, 2018

Conversation

Projects
None yet
2 participants
@let-def
Copy link
Contributor

commented Jun 19, 2018

In some rules, the locations of () or [] were wrong (only the closing token is considered).
With this patch, the locations are improved and the gain in uniformity will help the switch to Menhir parser.

Also refactors some code to use mkrhs.

let-def added some commits Jun 19, 2018

Better locations for () / [] in the parser
When LPAREN RPAREN or LBRACKET RBRACKET was used directly in a
production, only the location of one of the token was used.

Now the full location is used (beginning at LPAREN and ending at
RPAREN). The locations are more precise and the uniformity will help the
Menhir port.
Factor some locations in parser.mly
`mkrhs $x x` is defined to be `mkloc $x (rhs_loc x)`, though some
occurrences of the later were still used in the parser.

@let-def let-def requested review from gasche and trefis Jun 19, 2018

@trefis

trefis approved these changes Jun 19, 2018

Copy link
Contributor

left a comment

LGTM.

@let-def let-def merged commit 3deec24 into ocaml:trunk Jun 19, 2018

0 of 2 checks passed

continuous-integration/appveyor/pr Waiting for AppVeyor build to complete
Details
continuous-integration/travis-ci/pr The Travis CI build is in progress
Details

@let-def let-def deleted the let-def:parser-minor-fix branch Jun 19, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.