gleam-lang / tree-sitter-gleam

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

New attribute syntax #60

Closed lpil closed 1 year ago

lpil commented 1 year ago

Hello!

A new syntax has been added to Gleam, the attribute syntax

@target(erlang)
pub fn main() { todo }

Attributes proceed imports or definitions in modules. The compiler only accepts @target(erlang) and @target(javascript) but I believe the tree sitter should accept any name that would be a valid function name in place of target and any comma-delimited sequence of optionally labelled constant expressions within the ().

@deprecated(since: "1.2.0", replacement: wobble)
pub fn wibble() { todo }