From 47cf8520adb245dbd34ad60fc9206b7eaab5e0be Mon Sep 17 00:00:00 2001 From: Andrew Kelley Date: Sun, 22 Jan 2017 19:51:37 -0500 Subject: use comptime instead of inline for var and params See #221 --- src/parser.cpp | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) (limited to 'src/parser.cpp') diff --git a/src/parser.cpp b/src/parser.cpp index b0f909dc5d..569a23d130 100644 --- a/src/parser.cpp +++ b/src/parser.cpp @@ -250,7 +250,7 @@ static AstNode *ast_parse_type_expr(ParseContext *pc, size_t *token_index, bool } /* -ParamDecl = option("noalias" | "inline") option("Symbol" ":") TypeExpr | "..." +ParamDecl = option("noalias" | "comptime") option(Symbol ":") TypeExpr | "..." */ static AstNode *ast_parse_param_decl(ParseContext *pc, size_t *token_index) { Token *token = &pc->tokens->at(*token_index); @@ -266,7 +266,7 @@ static AstNode *ast_parse_param_decl(ParseContext *pc, size_t *token_index) { node->data.param_decl.is_noalias = true; *token_index += 1; token = &pc->tokens->at(*token_index); - } else if (token->id == TokenIdKeywordInline) { + } else if (token->id == TokenIdKeywordCompTime) { node->data.param_decl.is_inline = true; *token_index += 1; token = &pc->tokens->at(*token_index); @@ -1492,7 +1492,7 @@ static AstNode *ast_parse_defer_expr(ParseContext *pc, size_t *token_index) { } /* -VariableDeclaration = option("inline") ("var" | "const") Symbol option(":" TypeExpr) "=" Expression +VariableDeclaration = option("comptime") ("var" | "const") Symbol option(":" TypeExpr) "=" Expression */ static AstNode *ast_parse_variable_declaration_expr(ParseContext *pc, size_t *token_index, bool mandatory, VisibMod visib_mod) @@ -1501,9 +1501,9 @@ static AstNode *ast_parse_variable_declaration_expr(ParseContext *pc, size_t *to Token *var_token; bool is_const; - bool is_inline; - if (first_token->id == TokenIdKeywordInline) { - is_inline = true; + bool is_comptime; + if (first_token->id == TokenIdKeywordCompTime) { + is_comptime = true; var_token = &pc->tokens->at(*token_index + 1); if (var_token->id == TokenIdKeywordVar) { @@ -1518,12 +1518,12 @@ static AstNode *ast_parse_variable_declaration_expr(ParseContext *pc, size_t *to *token_index += 2; } else if (first_token->id == TokenIdKeywordVar) { - is_inline = false; + is_comptime = false; is_const = false; var_token = first_token; *token_index += 1; } else if (first_token->id == TokenIdKeywordConst) { - is_inline = false; + is_comptime = false; is_const = true; var_token = first_token; *token_index += 1; @@ -1535,7 +1535,7 @@ static AstNode *ast_parse_variable_declaration_expr(ParseContext *pc, size_t *to AstNode *node = ast_create_node(pc, NodeTypeVariableDeclaration, var_token); - node->data.variable_declaration.is_inline = is_inline; + node->data.variable_declaration.is_inline = is_comptime; node->data.variable_declaration.is_const = is_const; node->data.variable_declaration.visib_mod = visib_mod; -- cgit v1.2.3