darklang / dark

Darklang main repo, including language, backend, and infra
https://darklang.com
Other
1.66k stars 90 forks source link

Tree-sitter grammar: support characters #5323

Closed OceanOak closed 6 months ago

OceanOak commented 6 months ago

Changelog:

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

5321

OceanOak commented 6 months ago

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 commented 6 months ago

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!