Skip to content

Commit

Permalink
Flatten reference expressions into InlineExpression
Browse files Browse the repository at this point in the history
  • Loading branch information
stasm committed Mar 20, 2019
1 parent e100d19 commit 9ef072a
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 13 deletions.
9 changes: 4 additions & 5 deletions spec/fluent.ebnf
Expand Up @@ -52,18 +52,17 @@ block_placeable ::= blank_block blank_inline? inline_placeable
* syntax/abstract.mjs. */
InlineExpression ::= StringLiteral
| NumberLiteral
| ReferenceExpression
| FunctionReference
| MessageReference
| TermReference
| VariableReference
| inline_placeable

/* Literals */
StringLiteral ::= "\"" quoted_char* "\""
NumberLiteral ::= "-"? digits ("." digits)?

/* Inline Expressions */
ReferenceExpression ::= FunctionReference
| MessageReference
| TermReference
| VariableReference
FunctionReference ::= Identifier CallArguments
MessageReference ::= Identifier AttributeAccessor?
TermReference ::= "-" Identifier AttributeAccessor? CallArguments?
Expand Down
12 changes: 4 additions & 8 deletions syntax/grammar.mjs
Expand Up @@ -196,7 +196,10 @@ let InlineExpression = defer(() =>
either(
StringLiteral,
NumberLiteral,
ReferenceExpression,
FunctionReference,
MessageReference,
TermReference,
VariableReference,
inline_placeable));

/* -------- */
Expand Down Expand Up @@ -226,13 +229,6 @@ let NumberLiteral = defer(() =>

/* ------------------ */
/* Inline Expressions */
let ReferenceExpression = defer(() =>
either(
FunctionReference,
MessageReference,
TermReference,
VariableReference));

let FunctionReference = defer(() =>
sequence(
Identifier,
Expand Down

0 comments on commit 9ef072a

Please sign in to comment.