Skip to content

Commit

Permalink
Fix #3. Use { and } for explicit grouping
Browse files Browse the repository at this point in the history
  • Loading branch information
stasm committed Jan 30, 2017
1 parent c13be13 commit 26ec797
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 11 deletions.
18 changes: 10 additions & 8 deletions fluent.asdl
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,16 @@ module Fluent

pat = Pattern(expr* elements, bool quoted)

expr = MessageReference(iden id)
| ExternalArgument(iden id)
| CallExpression(iden callee, expr* args)
| SelectExpression(expr exp, mem* vars)
| MemberExpression(expr obj, memkey key)
| KeyValueArgument(iden name, argval val)
| Number(string value)
| String(string value)
expr = Selector(sel)
| SelectExpression(sel sel, mem* vars)

sel = MessageReference(iden id)
| ExternalArgument(iden id)
| CallExpression(iden callee, expr* args)
| MemberExpression(expr obj, memkey key)
| KeyValueArgument(iden name, argval val)
| Number(string value)
| String(string value)

mem = Member(memkey key, pat value, bool default)
memkey = Number(string value)
Expand Down
8 changes: 5 additions & 3 deletions fluent.ebnf
Original file line number Diff line number Diff line change
Expand Up @@ -32,15 +32,17 @@ quoted-text ::= ([^{"] | '\{' | '\"')+
block-text ::= NL __ '|' unquoted-pattern

placeable ::= '{' __ expression __ '}'
expression ::= quoted-pattern
expression ::= selector-expression | select-expression

selector-expression ::= quoted-pattern
| number
| identifier
| variable
| select-expression
| member-expression
| call-expression
| placeable

select-expression ::= expression __ ' ->' __ variants-list
select-expression ::= selector-expression __ ' ->' __ variants-list
member-expression ::= identifier '[' keyword ']'
call-expression ::= builtin '(' __ arglist? __ ')'
arglist ::= argument (__ ',' __ arglist)?
Expand Down

0 comments on commit 26ec797

Please sign in to comment.