diff options
| author | Andrew Kelley <superjoe30@gmail.com> | 2016-12-18 16:56:50 -0500 |
|---|---|---|
| committer | Andrew Kelley <superjoe30@gmail.com> | 2016-12-18 16:56:50 -0500 |
| commit | e50ced44a2cf6268c19df901ad56b367d8d802fe (patch) | |
| tree | b4bd67b3a0a8bdbc853dba760c0d66a406e11d4a /doc/langref.md | |
| parent | 2e6aa6d813cf3fd4180b8c9ffc671b4bcee54586 (diff) | |
| download | zig-e50ced44a2cf6268c19df901ad56b367d8d802fe.tar.gz zig-e50ced44a2cf6268c19df901ad56b367d8d802fe.zip | |
IR: all structs anonymous
Diffstat (limited to 'doc/langref.md')
| -rw-r--r-- | doc/langref.md | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/doc/langref.md b/doc/langref.md index 74bbcf48da..d3e0dd63d7 100644 --- a/doc/langref.md +++ b/doc/langref.md @@ -7,7 +7,7 @@ Root = many(TopLevelItem) "EOF" TopLevelItem = ErrorValueDecl | Block | TopLevelDecl -TopLevelDecl = option(VisibleMod) (FnDef | ExternDecl | ContainerDecl | GlobalVarDecl | TypeDecl | UseDecl) +TopLevelDecl = option(VisibleMod) (FnDef | ExternDecl | GlobalVarDecl | TypeDecl | UseDecl) TypeDecl = "type" Symbol "=" TypeExpr ";" @@ -17,9 +17,7 @@ GlobalVarDecl = VariableDeclaration ";" VariableDeclaration = option("inline") ("var" | "const") Symbol option(":" TypeExpr) "=" Expression -ContainerDecl = ("struct" | "enum" | "union") Symbol option(ParamDeclList) "{" many(StructMember) "}" - -StructMember = (StructField | FnDef | GlobalVarDecl | ContainerDecl) +StructMember = (StructField | FnDef | GlobalVarDecl) StructField = Symbol option(":" Expression) ",") @@ -143,7 +141,7 @@ StructLiteralField = "." Symbol "=" Expression PrefixOp = "!" | "-" | "~" | "*" | ("&" option("const")) | "?" | "%" | "%%" | "??" | "-%" -PrimaryExpression = Number | String | CharLiteral | KeywordLiteral | GroupedExpression | GotoExpression | BlockExpression | Symbol | ("@" Symbol FnCallExpression) | ArrayType | (option("extern") FnProto) | AsmExpression | ("error" "." Symbol) +PrimaryExpression = Number | String | CharLiteral | KeywordLiteral | GroupedExpression | GotoExpression | BlockExpression | Symbol | ("@" Symbol FnCallExpression) | ArrayType | (option("extern") FnProto) | AsmExpression | ("error" "." Symbol) | ContainerDecl ArrayType = "[" option(Expression) "]" option("const") TypeExpr @@ -152,6 +150,9 @@ GotoExpression = option("inline") "goto" Symbol GroupedExpression = "(" Expression ")" KeywordLiteral = "true" | "false" | "null" | "break" | "continue" | "undefined" | "zeroes" | "error" | "type" | "this" + +ContainerDecl = ("struct" | "enum" | "union") "{" many(StructMember) "}" + ``` ## Operator Precedence |
