remove deleted keywords

This commit is contained in:
Lee Cannon 2021-08-30 13:54:27 +01:00
parent 86199ca9a0
commit 2ffd93280e
3 changed files with 2 additions and 19 deletions

View File

@ -1764,14 +1764,10 @@ fn addOutlineNodes(allocator: *std.mem.Allocator, tree: ast.Tree, child: ast.Nod
.@"while", .@"while",
.while_simple, .while_simple,
.while_cont, .while_cont,
.true_literal,
.false_literal,
.null_literal,
.@"defer", .@"defer",
.@"if", .@"if",
.if_simple, .if_simple,
.multiline_string_literal, .multiline_string_literal,
.undefined_literal,
.@"anytype", .@"anytype",
.block, .block,
.block_semicolon, .block_semicolon,
@ -3225,10 +3221,6 @@ fn makeScopeInternal(
.char_literal, .char_literal,
.integer_literal, .integer_literal,
.float_literal, .float_literal,
.false_literal,
.true_literal,
.null_literal,
.undefined_literal,
.unreachable_literal, .unreachable_literal,
.@"continue", .@"continue",
=> {}, => {},

View File

@ -446,10 +446,6 @@ pub fn lastToken(tree: ast.Tree, node: ast.Node.Index) ast.TokenIndex {
.char_literal, .char_literal,
.integer_literal, .integer_literal,
.float_literal, .float_literal,
.false_literal,
.true_literal,
.null_literal,
.undefined_literal,
.unreachable_literal, .unreachable_literal,
.identifier, .identifier,
.deref, .deref,

View File

@ -107,7 +107,7 @@ const Builder = struct {
// TODO More highlighting here // TODO More highlighting here
const tok_id = tree.tokens.items(.tag)[tok]; const tok_id = tree.tokens.items(.tag)[tok];
const tok_type: TokenType = switch (tok_id) { const tok_type: TokenType = switch (tok_id) {
.keyword_true, .keyword_false, .keyword_null, .keyword_undefined, .keyword_unreachable => .keywordLiteral, .keyword_unreachable => .keywordLiteral,
.integer_literal, .float_literal => .number, .integer_literal, .float_literal => .number,
.string_literal, .multiline_string_literal_line, .char_literal => .string, .string_literal, .multiline_string_literal_line, .char_literal => .string,
.period, .comma, .r_paren, .l_paren, .r_brace, .l_brace, .semicolon, .colon => return, .period, .comma, .r_paren, .l_paren, .r_brace, .l_brace, .semicolon, .colon => return,
@ -770,12 +770,7 @@ fn writeNodeTokens(
while (cur_tok <= last_tok) : (cur_tok += 1) try writeToken(builder, cur_tok, .string); while (cur_tok <= last_tok) : (cur_tok += 1) try writeToken(builder, cur_tok, .string);
}, },
.true_literal, .unreachable_literal => {
.false_literal,
.null_literal,
.undefined_literal,
.unreachable_literal,
=> {
try writeToken(builder, main_token, .keywordLiteral); try writeToken(builder, main_token, .keywordLiteral);
}, },
.error_set_decl => { .error_set_decl => {