From fc748e2ccdf69dd02ae2e7e6e9913e2d98711129 Mon Sep 17 00:00:00 2001 From: Andrew Kelley Date: Sun, 10 Jan 2016 16:58:21 -0700 Subject: update enum parsing to new plan --- doc/langref.md | 18 ++++-------------- 1 file changed, 4 insertions(+), 14 deletions(-) (limited to 'doc') 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) -- cgit v1.2.3