Further grammar.md fixes: union types, idents, string constants.
authorWouter van Oortmerssen <aardappel@gmail.com>
Mon, 14 Aug 2017 19:18:06 +0000 (12:18 -0700)
committerWouter van Oortmerssen <aardappel@gmail.com>
Mon, 14 Aug 2017 19:18:06 +0000 (12:18 -0700)
Change-Id: I51db0511c52c79f2b322a1fdef798b061941887b

docs/source/Grammar.md

index e31970b..84e762c 100755 (executable)
@@ -14,8 +14,8 @@ attribute\_decl = `attribute` string\_constant `;`
 
 type\_decl = ( `table` | `struct` ) ident metadata `{` field\_decl+ `}`
 
-enum\_decl = ( `enum` | `union` ) ident [ `:` type ] metadata `{` commasep(
-enumval\_decl ) `}`
+enum\_decl = ( `enum` ident [ `:` type ] | `union` ident )  metadata `{`
+commasep( enumval\_decl ) `}`
 
 root\_decl = `root_type` ident `;`
 
@@ -49,6 +49,11 @@ file_extension_decl = `file_extension` string\_constant `;`
 
 file_identifier_decl = `file_identifier` string\_constant `;`
 
-integer\_constant = -?[0-9]+ | `true` | `false`
+integer\_constant = `-?[0-9]+` | `true` | `false`
+
+float\_constant = `-?[0-9]+.[0-9]+((e|E)(+|-)?[0-9]+)?`
+
+string\_constant = `\".*?\"`
+
+ident = `[a-zA-Z_][a-zA-Z0-9_]*`
 
-float\_constant = -?[0-9]+.[0-9]+((e|E)(+|-)?[0-9]+)?