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

refactor: avoid parsing logic on locations #13200

Merged
merged 1 commit into from
Apr 25, 2021

Conversation

JLHwung
Copy link
Contributor

@JLHwung JLHwung commented Apr 24, 2021

Q                       A
Fixed Issues? A small refactor that avoids any parsing logic on locations
Tests Added + Pass? Yes
License MIT

I plan to introduce locations: boolean in @babel/parser and default it to false in Babel 8. This PR is the first step to ensure we do not rely on locations in parsing logic.

@JLHwung JLHwung added PR: Internal 🏠 A type of pull request used for our changelog categories pkg: parser labels Apr 24, 2021
const moduloPos = this.state.start;
this.expect(tt.modulo);
const checksLoc = this.state.startLoc;
this.next(); // eat `%`
Copy link
Contributor Author

Choose a reason for hiding this comment

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

flowParsePredicate is always guarded by this.match(tt.modulo).

@babel-bot
Copy link
Collaborator

Build successful! You can test your changes in the REPL here: https://babeljs.io/repl/build/45550/

@codesandbox-ci
Copy link

This pull request is automatically built and testable in CodeSandbox.

To see build info of the built libraries, click here or the icon next to each commit SHA.

Latest deployment of this branch, based on commit ada1a64:

Sandbox Source
babel-repl-custom-plugin Configuration
babel-plugin-multi-config Configuration

@JLHwung JLHwung merged commit 10f4d08 into babel:main Apr 25, 2021
@JLHwung JLHwung deleted the avoid-parsing-logic-on-loc branch April 25, 2021 13:15
@github-actions github-actions bot added the outdated A closed issue/PR that is archived due to age. Recommended to make a new issue label Jul 26, 2021
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jul 26, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
outdated A closed issue/PR that is archived due to age. Recommended to make a new issue pkg: parser PR: Internal 🏠 A type of pull request used for our changelog categories
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

6 participants