Skip to content

Commit

Permalink
Merge pull request #79 from homura/custom-union-id
Browse files Browse the repository at this point in the history
add custom union id in ebnf definition
  • Loading branch information
quake authored Jan 8, 2024
2 parents 3b277d8 + a6f3f96 commit c03e59c
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions docs/grammar/grammar.ebnf
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ newline = "\n" | "\r\n";
identifier = letter, { letter | digit | "_" };
number = nonzero, { digit };
number_greater_or_equal_than_zero = zero | { number };
whitespace = ifs | newline;
break = whitespace, { whitespace };
Expand All @@ -29,15 +30,18 @@ item_decl = identifier, break_opt,
field_decl = identifier, break_opt, ":", break_opt,
identifier, break_opt,
field_end;
custom_union_item_decl = identifier, break_opt, ":", break_opt,
number_greater_or_equal_than_zero, break_opt,
field_end;
option_decl = "option", break, identifier, break_opt,
"(", break_opt,
identifier, break_opt,
")", break_opt,
stmt_end;
union_decl = "union", break, identifier, break_opt,
"{", break_opt,
item_decl, break_opt,
{ item_decl, break_opt },
(item_decl | custom_union_item_decl), break_opt,
{ (item_decl | custom_union_item_decl), break_opt },
"}";
array_decl = "array", break, identifier, break_opt,
"[", break_opt,
Expand Down

0 comments on commit c03e59c

Please sign in to comment.