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

Tree-sitter grammar: support Constant Declaration #5377

Merged
merged 7 commits into from
Jun 3, 2024

Conversation

OceanOak
Copy link
Collaborator

Changelog:

Tree-sitter-darklang
- Update the grammar to support Constant Declaration

#5321

@OceanOak OceanOak force-pushed the grammar-updates-constants branch 2 times, most recently from 5045260 to 5743d55 Compare May 29, 2024 10:48
@OceanOak OceanOak changed the title WIP: Tree-sitter grammar: support Constant Declaration Tree-sitter grammar: support Constant Declaration May 29, 2024
@OceanOak OceanOak marked this pull request as ready for review May 29, 2024 13:47
@OceanOak OceanOak requested a review from StachuDotNet May 29, 2024 13:47
@StachuDotNet
Copy link
Member

StachuDotNet commented May 29, 2024

I would expect this to be much simpler: rather than reinvent each grammar part, the RHS of a const declaration should be a normal Expression - and in the parser side of things (or maybe later, even), that's where we could error on trying to set an 'illegal' (unsupported) constant.

Edit: Hmm - I need to think about this a bit more. In ProgramTypes, we have separate things for each legal constant option. Maybe this is OK, or maybe we should make PT a bit simpler 🤔

@OceanOak OceanOak marked this pull request as draft May 31, 2024 05:57
@OceanOak OceanOak force-pushed the grammar-updates-constants branch 2 times, most recently from b87976b to 5052112 Compare June 3, 2024 16:40
@OceanOak OceanOak force-pushed the grammar-updates-constants branch from 5052112 to d1e0c03 Compare June 3, 2024 16:44
@OceanOak OceanOak marked this pull request as ready for review June 3, 2024 16:53
Copy link
Member

@StachuDotNet StachuDotNet left a comment

Choose a reason for hiding this comment

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

Great! Btw, I think 'typesAndFnsAndConsts' could be renamed to 'declarations' (incl when it includes handler definitions)

@StachuDotNet StachuDotNet merged commit 124927b into darklang:main Jun 3, 2024
9 checks passed
StachuDotNet added a commit that referenced this pull request Jun 4, 2024
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.

None yet

2 participants