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

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

Merged
merged 2 commits into from
Oct 29, 2023

Conversation

the-mikedavis
Copy link
Member

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)
}

grammar.js Outdated Show resolved Hide resolved
@the-mikedavis the-mikedavis force-pushed the md-as-binary-pattern-matching branch 2 times, most recently from 794ac49 to 322d91f Compare September 30, 2023 16:01
This fixes the precedence so that `as` is correctly highlighted as a
keyword even when used like a binary operator (see the parent commit).
@the-mikedavis the-mikedavis merged commit c2665c3 into main Oct 29, 2023
2 of 4 checks passed
@the-mikedavis the-mikedavis deleted the md-as-binary-pattern-matching branch October 29, 2023 16:04
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