Skip to content

Commit 84bbfa1

Browse files
committed
Define let, match, when as separate tokens
1 parent 6ee08f4 commit 84bbfa1

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

spec/message.abnf

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
message = [s] *(declaration [s]) body [s]
22

3-
declaration = "let" s variable [s] "=" [s] "{" [s] expression [s] "}"
3+
declaration = let s variable [s] "=" [s] "{" [s] expression [s] "}"
44
body = pattern
55
/ (selectors 1*([s] variant))
66

77
pattern = "{" *(text / placeholder) "}"
8-
selectors = "match" 1*([s] selector)
8+
selectors = match 1*([s] selector)
99
selector = "{" [s] expression [s] "}"
10-
variant = "when" 1*(s key) [s] pattern
10+
variant = when 1*(s key) [s] pattern
1111
key = nmtoken / literal / "*"
1212

1313
placeholder = "{" [s] (expression / markup / markup-end) [s] "}"
@@ -19,6 +19,10 @@ option = name [s] "=" [s] (literal / nmtoken / variable)
1919

2020
markup = markup-start *(s option)
2121

22+
let = %x6C.65.74
23+
match = %x6D.61.74.63.68
24+
when = %x77.68.65.6E
25+
2226
non-ascii-char = %x80-D7FF / %xE000-10FFFF
2327

2428
text = 1*(text-char / text-escape)

0 commit comments

Comments
 (0)