diff options
| author | Andrew Kelley <superjoe30@gmail.com> | 2017-01-23 23:30:20 -0500 |
|---|---|---|
| committer | Andrew Kelley <superjoe30@gmail.com> | 2017-01-23 23:30:20 -0500 |
| commit | 32d8686da80d282e8cd6d84a0e5c331d269a1f69 (patch) | |
| tree | 889c1f634f4ff2e7b9d8cb078f11dbb41c4a1b2a /doc | |
| parent | 17cb85dfb837949cd3a559fe8e99dee1f72463a4 (diff) | |
| download | zig-32d8686da80d282e8cd6d84a0e5c331d269a1f69.tar.gz zig-32d8686da80d282e8cd6d84a0e5c331d269a1f69.zip | |
various fixes
* comptime expression is a block expression as it should be
* fix var args when number of args passed is 0
* implement const value equality for structs
* fix indent when rendering container decl AST
* IR: prevent duplicate generation of code when it is partially
compile-time evaluated
* implement compile time struct field pointer evaluation
* fix compile time evaluation of slicing
Diffstat (limited to 'doc')
| -rw-r--r-- | doc/langref.md | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/doc/langref.md b/doc/langref.md index 5df990ad65..6c2789367b 100644 --- a/doc/langref.md +++ b/doc/langref.md @@ -69,7 +69,9 @@ AssignmentExpression = UnwrapExpression AssignmentOperator UnwrapExpression | Un AssignmentOperator = "=" | "*=" | "/=" | "%=" | "+=" | "-=" | "<<=" | ">>=" | "&=" | "^=" | "|=" | "&&=" | "||=" | "*%=" | "+%=" | "-%=" | "<<%=" -BlockExpression = IfExpression | Block | WhileExpression | ForExpression | SwitchExpression +BlockExpression = IfExpression | Block | WhileExpression | ForExpression | SwitchExpression | CompTimeExpression + +CompTimeExpression = option("comptime") Expression SwitchExpression = option("inline") "switch" "(" Expression ")" "{" many(SwitchProng) "}" @@ -141,14 +143,12 @@ StructLiteralField = "." Symbol "=" Expression PrefixOp = "!" | "-" | "~" | "*" | ("&" option("const")) | "?" | "%" | "%%" | "??" | "-%" -PrimaryExpression = Number | String | CharLiteral | KeywordLiteral | GroupedExpression | GotoExpression | CompTimeExpression | BlockExpression | Symbol | ("@" Symbol FnCallExpression) | ArrayType | (option("extern") FnProto) | AsmExpression | ("error" "." Symbol) | ContainerDecl +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 GotoExpression = "goto" Symbol -CompTimeExpression = option("comptime") Expression - GroupedExpression = "(" Expression ")" KeywordLiteral = "true" | "false" | "null" | "break" | "continue" | "undefined" | "error" | "type" | "this" |
