diff options
| author | Andrew Kelley <superjoe30@gmail.com> | 2016-01-10 16:58:21 -0700 |
|---|---|---|
| committer | Andrew Kelley <superjoe30@gmail.com> | 2016-01-10 16:58:21 -0700 |
| commit | fc748e2ccdf69dd02ae2e7e6e9913e2d98711129 (patch) | |
| tree | 09c61380319db35dbdd2bf8a06bc6778bcd3aa10 /doc | |
| parent | 3ef2f7058b0bbe2c81f79f990398aaab2e5a7a2f (diff) | |
| download | zig-fc748e2ccdf69dd02ae2e7e6e9913e2d98711129.tar.gz zig-fc748e2ccdf69dd02ae2e7e6e9913e2d98711129.zip | |
update enum parsing to new plan
Diffstat (limited to 'doc')
| -rw-r--r-- | doc/langref.md | 18 |
1 files changed, 4 insertions, 14 deletions
diff --git a/doc/langref.md b/doc/langref.md index e6eca3005e..3481f3ffda 100644 --- a/doc/langref.md +++ b/doc/langref.md @@ -32,23 +32,15 @@ zig | C equivalent | Description ``` Root : many(TopLevelDecl) token(EOF) -TopLevelDecl : FnDef | ExternBlock | RootExportDecl | Use | StructDecl | VariableDeclaration | EnumDecl +TopLevelDecl : FnDef | ExternBlock | RootExportDecl | Use | ContainerDecl | VariableDeclaration VariableDeclaration : option(FnVisibleMod) (token(Var) | token(Const)) token(Symbol) (token(Eq) Expression | token(Colon) Type option(token(Eq) Expression)) -StructDecl : many(Directive) option(FnVisibleMod) token(Struct) StructPayload - -StructPayload: token(Symbol) token(LBrace) many(StructMember) token(RBrace) - -EnumDecl : many(Directive) option(FnVisibleMod) token(Enum) token(Symbol) token(LBrace) many(EnumField) token(RBrace) +ContainerDecl : many(Directive) option(FnVisibleMod) (token(Struct) | token(Enum)) token(Symbol) token(LBrace) many(StructMember) token(RBrace) StructMember: StructField | FnDecl -StructField : token(Symbol) token(Colon) Type token(Comma) - -EnumField : (EnumDiscriminant | StructPayload) token(Comma) - -EnumDiscriminant : token(Symbol) option(token(Eq) Expression) +StructField : token(Symbol) option(token(Colon) Type token(Comma)) Use : many(Directive) token(Use) token(String) token(Semicolon) @@ -168,9 +160,7 @@ SliceExpression : token(LBracket) Expression token(Ellipsis) option(Expression) PrefixOp : token(Not) | token(Dash) | token(Tilde) | token(Star) | (token(Ampersand) option(token(Const))) -PrimaryExpression : token(Number) | token(String) | token(CharLiteral) | KeywordLiteral | GroupedExpression | Goto | token(Break) | token(Continue) | BlockExpression | token(Symbol) | StructValueExpression | CompilerFnType | (token(AtSign) token(Symbol) FnCallExpression) | NamespaceSymbol - -NamespaceSymbol : token(Symbol) token(ColonColon) token(Symbol) +PrimaryExpression : token(Number) | token(String) | token(CharLiteral) | KeywordLiteral | GroupedExpression | Goto | token(Break) | token(Continue) | BlockExpression | token(Symbol) | StructValueExpression | CompilerFnType | (token(AtSign) token(Symbol) FnCallExpression) StructValueExpression : token(Type) token(LBrace) list(StructValueExpressionField, token(Comma)) token(RBrace) |
