Skip to content

(EARLY REVIEW/SPECULATIVE) Refactoring syntax spec #429

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

Closed
wants to merge 12 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 10 additions & 7 deletions spec/message.abnf
Original file line number Diff line number Diff line change
Expand Up @@ -2,21 +2,24 @@ message = [s] *(declaration [s]) body [s]

declaration = let s variable [s] "=" [s] expression
body = pattern
/ (selectors 1*([s] variant))
/ (matcher)

pattern = "{" *(text / expression) "}"

matcher = match 1*([s] selector) 1*([s] variant)
selector = expression
variant = when 1*(s key) [s] pattern

pattern = "{" *(text / expression) "}"
selectors = match 1*([s] expression)
variant = when 1*(s key) [s] pattern
key = literal / "*"

expression = "{" [s] ((operand [s annotation]) / annotation) [s] "}"
operand = literal / variable
operand = literal / variable
annotation = (function *(s option)) / reserved

literal = quoted / unquoted
literal = quoted / unquoted
variable = "$" name
function = (":" / "+" / "-") name
option = name [s] "=" [s] (literal / variable)
option = name [s] "=" [s] (literal / variable)

; reserved keywords are always lowercase
let = %x6C.65.74 ; "let"
Expand Down
Loading