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

Introduce column number in AST nodes #1724

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

andreabergia
Copy link
Contributor

@andreabergia andreabergia commented Nov 11, 2024

This PR introduces column numbers in all AST nodes.
It also modifies the existing tests for the parser, and adds a lot more cases in a different class. I have gone through Parser measuring code coverage to ensure that the tests cover (almost) all the cases - the things I didn't really test are the non-standard things like xml, array comprehension, or let expression.

There is a breaking change: in case of a function call such as:

a.
 b()

rhino will now assign line 1 to the expression, not line 2 (i.e. we assign the start of the expression, not the position of the parenthesis for the function call). This is for coherency with other parsers - I've checked what happen via https://astexplorer.net/ and it seems like the consensus is what I have implemented.

@rbri
Copy link
Collaborator

rbri commented Nov 11, 2024

:-D Execution failed for task ':tests:spotlessJavaCheck'. :-D

@andreabergia andreabergia force-pushed the column-number branch 2 times, most recently from 83cb30a to d9fc589 Compare November 19, 2024 17:29
@andreabergia andreabergia changed the title WIP: Introduce column number in AST nodes Introduce column number in AST nodes Nov 19, 2024
@andreabergia andreabergia marked this pull request as ready for review November 19, 2024 17:45
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.

2 participants