gleam-lang / tree-sitter-gleam

🌳 A tree-sitter grammar for the Gleam programming language
Apache License 2.0
78 stars 15 forks source link

Parsing error with new `@external` syntax #67

Closed rawhat closed 1 year ago

rawhat commented 1 year ago

The new updates seem to be working really well! One spot where I'm seeing a parsing error is with @external.

image

It seems like the fn ... block is failing to parse, I'm guessing due to missing curly braces. If I add those, it parses successfully, but I obviously then get a syntax error from gleam.

It seems like the function isn't nested below the attribute so I'm not sure how easy this would be to change.

Thank you!

the-mikedavis commented 1 year ago

Ah I see, function bodies can be optional with the attribute syntax. I think this should only take a small change to fix, I'll post a PR