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 characters #5323

Merged
merged 2 commits into from
Mar 13, 2024

Conversation

OceanOak
Copy link
Collaborator

@OceanOak OceanOak commented Mar 12, 2024

Changelog:

Tree-sitter-darklang
- Update the grammar to support characters 

#5321

@OceanOak OceanOak changed the title wip: Update the grammar to support characters Update the grammar to support characters Mar 13, 2024
@OceanOak OceanOak marked this pull request as ready for review March 13, 2024 08:18
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.

One minor change requested.

Also, doesn't need to be part of this PR, but it's worth considering using ".immediate()' more in our grammar. I'm not sure what happens for things like ' a ' right now -- I suspect those spaces are ignored, where they shouldn't be (and this probably applies to other parts of our grammar, like potentially 1 . 2 parsing of floats, etc. Anyway, doesn't need to be addressed in this PR but worth some effort in this space.

@OceanOak
Copy link
Collaborator Author

OceanOak commented Mar 13, 2024

I'm not sure what happens for things like ' a ' right now -- I suspect those spaces are ignored

Currently, it returns an error, it doesn't ignore the spaces
(ERROR (UNEXPECTED 'a'))

same for 1 . 2

(ERROR (positive_digits) (symbol) (positive_digits)))

Would you expect a different result?

@StachuDotNet
Copy link
Member

I'm not sure what happens for things like ' a ' right now -- I suspect those spaces are ignored

Currently, it returns an error, it doesn't ignore the spaces (ERROR (UNEXPECTED 'a'))

same for 1 . 2

(ERROR (positive_digits) (symbol) (positive_digits)))

Would you expect a different result?

No that's great! .immediate() is just a thing that's been in the back of my head as something we might need to look into, but it seems I was overestimating its need in some way. Thanks for looking into it!

@StachuDotNet StachuDotNet merged commit b0b7d65 into darklang:main Mar 13, 2024
8 checks passed
@OceanOak OceanOak changed the title Update the grammar to support characters Tree-sitter grammar: support characters Mar 28, 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.

2 participants