gleam-lang / tree-sitter-gleam

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

Allow 'as' keyword in binary pattern match expressions #71

Closed the-mikedavis closed 1 year ago

the-mikedavis commented 1 year ago

This is from the 0.31.0 release notes: https://gleam.run/news/v0.31-keeping-dependencies-explicit/#quality-of-life-improvements

case tag {
  "category " as key <> value
  | "region " as key <> value
  | "priority " as key <> value -> {
    let key = string.trim(key)
    Ok(Tag(key, value))
  }
  _ -> Error(Nil)
}