support new ast token changes

- some ast token tags were renamed: ie .bit_shift_left => .shl
- add initial support for saturating operators: +|, -|, *|, <<|, +|=, -|=, *|=, <<|=
This commit is contained in:
Travis Staloch 2021-09-28 21:15:37 -07:00
parent 03f70be32a
commit 50aa71c10f
4 changed files with 44 additions and 20 deletions

View File

@ -1681,8 +1681,8 @@ fn addOutlineNodes(allocator: *std.mem.Allocator, tree: Analysis.Tree, child: as
.assign,
.assign_bit_and,
.assign_bit_or,
.assign_bit_shift_left,
.assign_bit_shift_right,
.assign_shl,
.assign_shr,
.assign_bit_xor,
.assign_div,
.assign_sub,
@ -1695,8 +1695,8 @@ fn addOutlineNodes(allocator: *std.mem.Allocator, tree: Analysis.Tree, child: as
.bang_equal,
.bit_and,
.bit_or,
.bit_shift_left,
.bit_shift_right,
.shl,
.shr,
.bit_xor,
.bool_and,
.bool_or,
@ -3262,14 +3262,18 @@ fn makeScopeInternal(
.assign_mod,
.assign_add,
.assign_sub,
.assign_bit_shift_left,
.assign_bit_shift_right,
.assign_shl,
.assign_shr,
.assign_bit_and,
.assign_bit_xor,
.assign_bit_or,
.assign_mul_wrap,
.assign_add_wrap,
.assign_sub_wrap,
.assign_mul_sat,
.assign_add_sat,
.assign_sub_sat,
.assign_shl_sat,
.assign,
.merge_error_sets,
.mul,
@ -3277,13 +3281,17 @@ fn makeScopeInternal(
.mod,
.array_mult,
.mul_wrap,
.mul_sat,
.add,
.sub,
.array_cat,
.add_wrap,
.sub_wrap,
.bit_shift_left,
.bit_shift_right,
.add_sat,
.sub_sat,
.shl,
.shl_sat,
.shr,
.bit_and,
.bit_xor,
.bit_or,

View File

@ -391,14 +391,18 @@ pub fn lastToken(tree: Tree, node: ast.Node.Index) ast.TokenIndex {
.assign_mod,
.assign_add,
.assign_sub,
.assign_bit_shift_left,
.assign_bit_shift_right,
.assign_shl,
.assign_shr,
.assign_bit_and,
.assign_bit_xor,
.assign_bit_or,
.assign_mul_wrap,
.assign_add_wrap,
.assign_sub_wrap,
.assign_mul_sat,
.assign_add_sat,
.assign_sub_sat,
.assign_shl_sat,
.assign,
.merge_error_sets,
.mul,
@ -406,13 +410,17 @@ pub fn lastToken(tree: Tree, node: ast.Node.Index) ast.TokenIndex {
.mod,
.array_mult,
.mul_wrap,
.mul_sat,
.add,
.sub,
.array_cat,
.add_wrap,
.sub_wrap,
.bit_shift_left,
.bit_shift_right,
.add_sat,
.sub_sat,
.shl,
.shl_sat,
.shr,
.bit_and,
.bit_xor,
.bit_or,

View File

@ -474,8 +474,8 @@ fn symbolReferencesInternal(
.assign,
.assign_bit_and,
.assign_bit_or,
.assign_bit_shift_left,
.assign_bit_shift_right,
.assign_shl,
.assign_shr,
.assign_bit_xor,
.assign_div,
.assign_sub,
@ -488,8 +488,8 @@ fn symbolReferencesInternal(
.bang_equal,
.bit_and,
.bit_or,
.bit_shift_left,
.bit_shift_right,
.shl,
.shr,
.bit_xor,
.bool_or,
.div,

View File

@ -815,27 +815,33 @@ fn writeNodeTokens(
},
.add,
.add_wrap,
.add_sat,
.array_cat,
.array_mult,
.assign,
.assign_bit_and,
.assign_bit_or,
.assign_bit_shift_left,
.assign_bit_shift_right,
.assign_shl,
.assign_shl_sat,
.assign_shr,
.assign_bit_xor,
.assign_div,
.assign_sub,
.assign_sub_wrap,
.assign_sub_sat,
.assign_mod,
.assign_add,
.assign_add_wrap,
.assign_add_sat,
.assign_mul,
.assign_mul_wrap,
.assign_mul_sat,
.bang_equal,
.bit_and,
.bit_or,
.bit_shift_left,
.bit_shift_right,
.shl,
.shl_sat,
.shr,
.bit_xor,
.bool_and,
.bool_or,
@ -850,9 +856,11 @@ fn writeNodeTokens(
.mod,
.mul,
.mul_wrap,
.mul_sat,
.switch_range,
.sub,
.sub_wrap,
.sub_sat,
.@"orelse",
=> {
try await @asyncCall(child_frame, {}, writeNodeTokens, .{ builder, arena, store, node_data[node].lhs });