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

Collect syntax kinds directly from DSL v2 and isolate parser generation logic #991

Merged
merged 20 commits into from
Jun 4, 2024

Conversation

Xanewok
Copy link
Contributor

@Xanewok Xanewok commented May 29, 2024

Work towards #638

Mainly:

  • We bundle quoteing or any (old) parser codegen now in the new generator/src/parser/codegen module
  • To expand the kinds.rs.jinja2 we use a new, dedicated KindsModel to disentangle, limiting the workarounds like removing the built-in labels only after visiting the grammar
  • simplified collecting the ParserModel.referenced_versions (it's de facto Language::collect_breaking_changes but with a caveat; I'll submit a separate PR for that since it's not 100% obvious and would change how we define ParserModel).
  • and some minor fixes like pub(super) visibility or updated referenced issues.

Now, the remaining work will be to actually revamp how we visit the resulting grammar.

@Xanewok Xanewok requested a review from a team as a code owner May 29, 2024 12:51
Copy link

changeset-bot bot commented May 29, 2024

⚠️ No Changeset found

Latest commit: dd934b0

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

Copy link
Collaborator

@OmarTawfik OmarTawfik left a comment

Choose a reason for hiding this comment

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

Left a few questions/suggestions.
Thanks!

@Xanewok Xanewok requested a review from OmarTawfik June 3, 2024 13:54
Copy link
Collaborator

@OmarTawfik OmarTawfik left a comment

Choose a reason for hiding this comment

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

Left two comment threads unresolved as FYI. But not blocking. This looks great to merge as-is. Thanks!

@Xanewok Xanewok enabled auto-merge June 4, 2024 09:54
@Xanewok Xanewok added this pull request to the merge queue Jun 4, 2024
Merged via the queue into NomicFoundation:main with commit 12e0c18 Jun 4, 2024
1 check passed
@Xanewok Xanewok deleted the collect-kinds-from-dslv2 branch June 4, 2024 10:07
github-merge-queue bot pushed a commit that referenced this pull request Jun 5, 2024
Part of #638 

Follow-up to #991

Pretty straightforward: instead of visiting the previously built v1
definition structure, we defer to `Language::collect_breaking_changes`
as the definitions overlap - the breaking changes are defined as
versions in which the syntax items may be evaluated differently, which
means that these are exactly the versions that will be referenced for
the conditional syntax item evaluation in the parser/lexer.
OmarTawfik pushed a commit to OmarTawfik-forks/slang that referenced this pull request Aug 4, 2024
…Foundation#1002)

Part of NomicFoundation#638

Follow-up to NomicFoundation#991

Pretty straightforward: instead of visiting the previously built v1
definition structure, we defer to `Language::collect_breaking_changes`
as the definitions overlap - the breaking changes are defined as
versions in which the syntax items may be evaluated differently, which
means that these are exactly the versions that will be referenced for
the conditional syntax item evaluation in the parser/lexer.

Refactor `BuiltInLabel` to avoid duplication (NomicFoundation#992)

Spin off of NomicFoundation#976

Moves the `BuiltInLabel` enum from the parser generator into the
language definition and remove duplication in the `kinds` template.

add wit

generating wit and glue

stub adaptors, wit feature flag

glue macros

remove wit_bindgen

fix wit gen paths

add wit-bindgen

export the kinds

pub export macro for wit

improve export macro

world => slang

fully implement glue

convert query matches

refactor ffi glue macros

refactor wit

variant rather than enum

back to enum
OmarTawfik added a commit to OmarTawfik-forks/slang that referenced this pull request Aug 5, 2024
…Foundation#1002)

Part of NomicFoundation#638

Follow-up to NomicFoundation#991

Pretty straightforward: instead of visiting the previously built v1
definition structure, we defer to `Language::collect_breaking_changes`
as the definitions overlap - the breaking changes are defined as
versions in which the syntax items may be evaluated differently, which
means that these are exactly the versions that will be referenced for
the conditional syntax item evaluation in the parser/lexer.

Refactor `BuiltInLabel` to avoid duplication (NomicFoundation#992)

Spin off of NomicFoundation#976

Moves the `BuiltInLabel` enum from the parser generator into the
language definition and remove duplication in the `kinds` template.

add wit

generating wit and glue

stub adaptors, wit feature flag

glue macros

remove wit_bindgen

fix wit gen paths

add wit-bindgen

export the kinds

pub export macro for wit

improve export macro

world => slang

fully implement glue

convert query matches

refactor ffi glue macros

refactor wit

variant rather than enum

back to enum
OmarTawfik pushed a commit to OmarTawfik-forks/slang that referenced this pull request Aug 5, 2024
…Foundation#1002)

Part of NomicFoundation#638 

Follow-up to NomicFoundation#991

Pretty straightforward: instead of visiting the previously built v1
definition structure, we defer to `Language::collect_breaking_changes`
as the definitions overlap - the breaking changes are defined as
versions in which the syntax items may be evaluated differently, which
means that these are exactly the versions that will be referenced for
the conditional syntax item evaluation in the parser/lexer.
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