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

AST nodes now have spans #1295

Closed
wants to merge 2 commits into from
Closed

AST nodes now have spans #1295

wants to merge 2 commits into from

Conversation

Razican
Copy link
Member

@Razican Razican commented May 29, 2021

This Pull Request fixes/closes #300.

It changes the following:

  • Node now has a span, that will start on the beginning of the first token and end on the end of the last token.
  • Added the NodeKindenumeration, that is equivalent to the old Node.
  • Some cleanups, that improve code by using more Self, among other things
  • Span and Position now implement the Default trait. The default position is to start on line 1, character 1. A default span starts and ends on that position.
  • Changed some as_ref().to_vec() references to Vec to clone(), that should improve performance there a bit

In general, I expect that these changes will have a negative performance impact. Nevertheless, this is needed to allow better interactivity with the parser. This is still WIP, and still doesn't build (we are still missing changes in most parsers, I'm slowly working towards it).

@Razican Razican added enhancement New feature or request parser Issues surrounding the parser labels May 29, 2021
@Razican Razican added this to the v0.13.0 milestone May 29, 2021
@Razican Razican force-pushed the feature/node_span branch 2 times, most recently from 819fea1 to 3441ce3 Compare May 30, 2021 08:49
@Razican Razican marked this pull request as draft May 30, 2021 08:50
@Razican Razican force-pushed the feature/node_span branch from 3441ce3 to 04f1be4 Compare June 11, 2021 10:09
@Razican Razican force-pushed the feature/node_span branch 2 times, most recently from da6b113 to 2ceee3c Compare June 18, 2021 15:40
@Razican Razican force-pushed the feature/node_span branch 2 times, most recently from 0ccda0c to 887a2f1 Compare June 28, 2021 14:04
@Razican Razican force-pushed the feature/node_span branch from 887a2f1 to 639f675 Compare June 30, 2021 15:55
@raskad raskad modified the milestones: v0.13.0, v0.14.0 Sep 25, 2021
@Razican Razican removed this from the v0.14.0 milestone Feb 5, 2022
@Razican
Copy link
Member Author

Razican commented Feb 5, 2022

I will close this, since this would require a huge rebase, and it will be easier to just start over.

@Razican Razican closed this Feb 5, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request parser Issues surrounding the parser
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Span nodes
2 participants