aboutsummaryrefslogtreecommitdiff
path: root/src/parser.cpp
diff options
context:
space:
mode:
authorAndrew Kelley <superjoe30@gmail.com>2018-09-13 16:34:33 -0400
committerAndrew Kelley <superjoe30@gmail.com>2018-09-13 16:34:33 -0400
commitc06a61e9bf93810174255474598cfeae785cfbd6 (patch)
tree27d8f4262d8cd8c72c75e348e63e6c7d6a6ec0d4 /src/parser.cpp
parent7c3636aaa38e8efa77b73ba94362802517ea739e (diff)
downloadzig-c06a61e9bf93810174255474598cfeae785cfbd6.tar.gz
zig-c06a61e9bf93810174255474598cfeae785cfbd6.zip
remove `this`. add `@This()`.
closes #1283
Diffstat (limited to 'src/parser.cpp')
-rw-r--r--src/parser.cpp9
1 files changed, 1 insertions, 8 deletions
diff --git a/src/parser.cpp b/src/parser.cpp
index 453ab7ce2c..8e6076c5e5 100644
--- a/src/parser.cpp
+++ b/src/parser.cpp
@@ -700,7 +700,7 @@ static AstNode *ast_parse_comptime_expr(ParseContext *pc, size_t *token_index, b
/*
PrimaryExpression = Integer | Float | String | CharLiteral | KeywordLiteral | GroupedExpression | BlockExpression(BlockOrExpression) | Symbol | ("@" Symbol FnCallExpression) | ArrayType | FnProto | AsmExpression | ContainerDecl | ("continue" option(":" Symbol)) | ErrorSetDecl | PromiseType
-KeywordLiteral = "true" | "false" | "null" | "undefined" | "error" | "this" | "unreachable" | "suspend"
+KeywordLiteral = "true" | "false" | "null" | "undefined" | "error" | "unreachable" | "suspend"
ErrorSetDecl = "error" "{" list(Symbol, ",") "}"
*/
static AstNode *ast_parse_primary_expr(ParseContext *pc, size_t *token_index, bool mandatory) {
@@ -756,10 +756,6 @@ static AstNode *ast_parse_primary_expr(ParseContext *pc, size_t *token_index, bo
AstNode *node = ast_create_node(pc, NodeTypeUndefinedLiteral, token);
*token_index += 1;
return node;
- } else if (token->id == TokenIdKeywordThis) {
- AstNode *node = ast_create_node(pc, NodeTypeThisLiteral, token);
- *token_index += 1;
- return node;
} else if (token->id == TokenIdKeywordUnreachable) {
AstNode *node = ast_create_node(pc, NodeTypeUnreachable, token);
*token_index += 1;
@@ -3021,9 +3017,6 @@ void ast_visit_node_children(AstNode *node, void (*visit)(AstNode **, void *cont
case NodeTypeUndefinedLiteral:
// none
break;
- case NodeTypeThisLiteral:
- // none
- break;
case NodeTypeIfBoolExpr:
visit_field(&node->data.if_bool_expr.condition, visit, context);
visit_field(&node->data.if_bool_expr.then_block, visit, context);