sync with zig master version llvm15 (#652)

This commit is contained in:
max 2022-09-15 02:56:17 +08:00 committed by GitHub
parent bd6f60e451
commit 5aff17afb0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 6 additions and 10 deletions

View File

@ -1617,7 +1617,7 @@ pub fn documentPositionContext(arena: *std.heap.ArenaAllocator, document: types.
fn addOutlineNodes(allocator: std.mem.Allocator, tree: Ast, child: Ast.Node.Index, context: *GetDocumentSymbolsContext) anyerror!void {
switch (tree.nodes.items(.tag)[child]) {
.string_literal,
.integer_literal,
.number_literal,
.builtin_call,
.builtin_call_comma,
.builtin_call_two,
@ -3037,8 +3037,7 @@ fn makeScopeInternal(allocator: std.mem.Allocator, context: ScopeContext, node_i
.anyframe_type,
.anyframe_literal,
.char_literal,
.integer_literal,
.float_literal,
.number_literal,
.unreachable_literal,
.@"continue",
=> {},

View File

@ -462,8 +462,7 @@ pub fn lastToken(tree: Ast, node: Ast.Node.Index) Ast.TokenIndex {
.anyframe_literal,
.char_literal,
.integer_literal,
.float_literal,
.number_literal,
.unreachable_literal,
.identifier,
.deref,

View File

@ -326,8 +326,7 @@ fn writeNodeInlayHint(builder: *Builder, arena: *std.heap.ArenaAllocator, store:
.anyframe_type,
.anyframe_literal,
.char_literal,
.integer_literal,
.float_literal,
.number_literal,
.unreachable_literal,
.identifier,
.enum_literal,

View File

@ -109,7 +109,7 @@ const Builder = struct {
const tok_id = tree.tokens.items(.tag)[tok];
const tok_type: TokenType = switch (tok_id) {
.keyword_unreachable => .keywordLiteral,
.integer_literal, .float_literal => .number,
.number_literal => .number,
.string_literal, .multiline_string_literal_line, .char_literal => .string,
.period, .comma, .r_paren, .l_paren, .r_brace, .l_brace, .semicolon, .colon => return,
@ -720,8 +720,7 @@ fn writeNodeTokens(builder: *Builder, arena: *std.heap.ArenaAllocator, store: *D
try writeToken(builder, main_token, .keyword);
try await @asyncCall(child_frame, {}, writeNodeTokens, .{ builder, arena, store, node_data[node].lhs });
},
.integer_literal,
.float_literal,
.number_literal,
=> {
try writeToken(builder, main_token, .number);
},