@@ -636,7 +636,6 @@ pub fn firstToken(tree: Ast, node: Node.Index) TokenIndex {
636636 .@"nosuspend" ,
637637 .asm_simple ,
638638 .@"asm" ,
639- .asm_legacy ,
640639 .array_type ,
641640 .array_type_sentinel ,
642641 .error_value ,
@@ -1050,11 +1049,6 @@ pub fn lastToken(tree: Ast, node: Node.Index) TokenIndex {
10501049 n = @enumFromInt (tree .extra_data [@intFromEnum (members .end ) - 1 ]); // last parameter
10511050 }
10521051 },
1053- .asm_legacy = > {
1054- _ , const extra_index = tree .nodeData (n ).node_and_extra ;
1055- const extra = tree .extraData (extra_index , Node .AsmLegacy );
1056- return extra .rparen + end_offset ;
1057- },
10581052 .@"asm" = > {
10591053 _ , const extra_index = tree .nodeData (n ).node_and_extra ;
10601054 const extra = tree .extraData (extra_index , Node .Asm );
@@ -1897,18 +1891,6 @@ pub fn asmSimple(tree: Ast, node: Node.Index) full.Asm {
18971891 });
18981892}
18991893
1900- pub fn asmLegacy (tree : Ast , node : Node.Index ) full.AsmLegacy {
1901- const template , const extra_index = tree .nodeData (node ).node_and_extra ;
1902- const extra = tree .extraData (extra_index , Node .AsmLegacy );
1903- const items = tree .extraDataSlice (.{ .start = extra .items_start , .end = extra .items_end }, Node .Index );
1904- return tree .legacyAsmComponents (.{
1905- .asm_token = tree .nodeMainToken (node ),
1906- .template = template ,
1907- .items = items ,
1908- .rparen = extra .rparen ,
1909- });
1910- }
1911-
19121894pub fn asmFull (tree : Ast , node : Node.Index ) full.Asm {
19131895 const template , const extra_index = tree .nodeData (node ).node_and_extra ;
19141896 const extra = tree .extraData (extra_index , Node .Asm );
@@ -2214,67 +2196,6 @@ fn fullSwitchCaseComponents(tree: Ast, info: full.SwitchCase.Components, node: N
22142196 return result ;
22152197}
22162198
2217- fn legacyAsmComponents (tree : Ast , info : full.AsmLegacy.Components ) full.AsmLegacy {
2218- var result : full.AsmLegacy = .{
2219- .ast = info ,
2220- .volatile_token = null ,
2221- .inputs = &.{},
2222- .outputs = &.{},
2223- .first_clobber = null ,
2224- };
2225- if (tree .tokenTag (info .asm_token + 1 ) == .keyword_volatile ) {
2226- result .volatile_token = info .asm_token + 1 ;
2227- }
2228- const outputs_end : usize = for (info .items , 0.. ) | item , i | {
2229- switch (tree .nodeTag (item )) {
2230- .asm_output = > continue ,
2231- else = > break i ,
2232- }
2233- } else info .items .len ;
2234-
2235- result .outputs = info .items [0.. outputs_end ];
2236- result .inputs = info .items [outputs_end .. ];
2237-
2238- if (info .items .len == 0 ) {
2239- // asm ("foo" ::: "a", "b");
2240- const template_token = tree .lastToken (info .template );
2241- if (tree .tokenTag (template_token + 1 ) == .colon and
2242- tree .tokenTag (template_token + 2 ) == .colon and
2243- tree .tokenTag (template_token + 3 ) == .colon and
2244- tree .tokenTag (template_token + 4 ) == .string_literal )
2245- {
2246- result .first_clobber = template_token + 4 ;
2247- }
2248- } else if (result .inputs .len != 0 ) {
2249- // asm ("foo" :: [_] "" (y) : "a", "b");
2250- const last_input = result .inputs [result .inputs .len - 1 ];
2251- const rparen = tree .lastToken (last_input );
2252- var i = rparen + 1 ;
2253- // Allow a (useless) comma right after the closing parenthesis.
2254- if (tree .tokenTag (i ) == .comma ) i = i + 1 ;
2255- if (tree .tokenTag (i ) == .colon and
2256- tree .tokenTag (i + 1 ) == .string_literal )
2257- {
2258- result .first_clobber = i + 1 ;
2259- }
2260- } else {
2261- // asm ("foo" : [_] "" (x) :: "a", "b");
2262- const last_output = result .outputs [result .outputs .len - 1 ];
2263- const rparen = tree .lastToken (last_output );
2264- var i = rparen + 1 ;
2265- // Allow a (useless) comma right after the closing parenthesis.
2266- if (tree .tokenTag (i ) == .comma ) i = i + 1 ;
2267- if (tree .tokenTag (i ) == .colon and
2268- tree .tokenTag (i + 1 ) == .colon and
2269- tree .tokenTag (i + 2 ) == .string_literal )
2270- {
2271- result .first_clobber = i + 2 ;
2272- }
2273- }
2274-
2275- return result ;
2276- }
2277-
22782199fn fullAsmComponents (tree : Ast , info : full.Asm.Components ) full.Asm {
22792200 var result : full.Asm = .{
22802201 .ast = info ,
@@ -2492,14 +2413,6 @@ pub fn fullAsm(tree: Ast, node: Node.Index) ?full.Asm {
24922413 };
24932414}
24942415
2495- /// To be deleted after 0.15.0 is tagged
2496- pub fn legacyAsm (tree : Ast , node : Node.Index ) ? full.AsmLegacy {
2497- return switch (tree .nodeTag (node )) {
2498- .asm_legacy = > tree .asmLegacy (node ),
2499- else = > null ,
2500- };
2501- }
2502-
25032416pub fn fullCall (tree : Ast , buffer : * [1 ]Ast.Node.Index , node : Node.Index ) ? full.Call {
25042417 return switch (tree .nodeTag (node )) {
25052418 .call , .call_comma = > tree .callFull (node ),
@@ -2894,21 +2807,6 @@ pub const full = struct {
28942807 };
28952808 };
28962809
2897- pub const AsmLegacy = struct {
2898- ast : Components ,
2899- volatile_token : ? TokenIndex ,
2900- first_clobber : ? TokenIndex ,
2901- outputs : []const Node.Index ,
2902- inputs : []const Node.Index ,
2903-
2904- pub const Components = struct {
2905- asm_token : TokenIndex ,
2906- template : Node.Index ,
2907- items : []const Node.Index ,
2908- rparen : TokenIndex ,
2909- };
2910- };
2911-
29122810 pub const Call = struct {
29132811 ast : Components ,
29142812
@@ -3905,14 +3803,6 @@ pub const Node = struct {
39053803 ///
39063804 /// The `main_token` field is the `asm` token.
39073805 asm_simple ,
3908- /// `asm(lhs, a)`.
3909- ///
3910- /// The `data` field is a `.node_and_extra`:
3911- /// 1. a `Node.Index` to lhs.
3912- /// 2. a `ExtraIndex` to `AsmLegacy`.
3913- ///
3914- /// The `main_token` field is the `asm` token.
3915- asm_legacy ,
39163806 /// `asm(a, b)`.
39173807 ///
39183808 /// The `data` field is a `.node_and_extra`:
@@ -4089,14 +3979,6 @@ pub const Node = struct {
40893979 callconv_expr : OptionalIndex ,
40903980 };
40913981
4092- /// To be removed after 0.15.0 is tagged
4093- pub const AsmLegacy = struct {
4094- items_start : ExtraIndex ,
4095- items_end : ExtraIndex ,
4096- /// Needed to make lastToken() work.
4097- rparen : TokenIndex ,
4098- };
4099-
41003982 pub const Asm = struct {
41013983 items_start : ExtraIndex ,
41023984 items_end : ExtraIndex ,
0 commit comments