Skip to content

Added a new V2 AST module, with basic AST constructs#1492

Closed
teofr wants to merge 2 commits intomainfrom
teofr/v2-ast-first-iteration
Closed

Added a new V2 AST module, with basic AST constructs#1492
teofr wants to merge 2 commits intomainfrom
teofr/v2-ast-first-iteration

Conversation

@teofr
Copy link
Contributor

@teofr teofr commented Dec 12, 2025

This PR adds a new AST for V2 slang, it's still under active development so it may change.

There's a few things that will most likely change:

  • Right now every Terminal node is of the same type TerminalType and differentiated via a LexemeKind, this won't be the case for long
  • All Non terminals keep access to all their children, including terminals that carry no information (like a ;)
  • LexemeKinds are moved into the AST crate, this makes sense for now, but it may not in the future and we may want to take it back into the lexer, but we need it for now to avoid circular dependencies.

@teofr teofr requested review from a team as code owners December 12, 2025 14:07
@changeset-bot
Copy link

changeset-bot bot commented Dec 12, 2025

⚠️ No Changeset found

Latest commit: 0c4577d

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@teofr teofr marked this pull request as draft December 15, 2025 09:04
@teofr
Copy link
Contributor Author

teofr commented Dec 15, 2025

I'll leave it as a draft for now, was thinking about it over the weekend and want to improve the API a bit, but open to people's early suggestions

@teofr
Copy link
Contributor Author

teofr commented Dec 16, 2025

Closing in favour of #1493

@teofr teofr closed this Dec 16, 2025
@OmarTawfik OmarTawfik deleted the teofr/v2-ast-first-iteration branch December 18, 2025 01:25
github-merge-queue bot pushed a commit that referenced this pull request Feb 4, 2026
This PR adds a new AST for V2 slang, it's still under active development
so it will change.

There's a few things that will most likely change soon:

- All Non terminals keep access to all their children, including
terminals that carry no information (like a `;`)
- The AST is dependent on an arena, currently using `bumpalo`, this
should probably be abstracted away, and each constructor take a more
complex type having an arena, the source, a string interner, etc
- I haven't focused much on the public API for now, eventually we'll
need to do this.

Overhauling #1492
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.

1 participant