| ... | ... | @@ -91,9 +91,6 @@ const Parser = struct { |
| 91 | 91 | extra_data: std.ArrayListUnmanaged(Node.Index), |
| 92 | 92 | scratch: std.ArrayListUnmanaged(Node.Index), |
| 93 | 93 | |
| 94 | | /// Used for the error note of decl_between_fields error. |
| 95 | | last_field: TokenIndex = undefined, |
| 96 | | |
| 97 | 94 | const SmallSpan = union(enum) { |
| 98 | 95 | zero_or_one: Node.Index, |
| 99 | 96 | multi: Node.SubRange, |
| ... | ... | @@ -252,6 +249,8 @@ const Parser = struct { |
| 252 | 249 | err, |
| 253 | 250 | } = .none; |
| 254 | 251 | |
| 252 | var last_field: TokenIndex = undefined; |
| 253 | |
| 255 | 254 | // Skip container doc comments. |
| 256 | 255 | while (p.eatToken(.container_doc_comment)) |_| {} |
| 257 | 256 | |
| ... | ... | @@ -274,7 +273,7 @@ const Parser = struct { |
| 274 | 273 | .identifier => { |
| 275 | 274 | p.tok_i += 1; |
| 276 | 275 | const identifier = p.tok_i; |
| 277 | | defer p.last_field = identifier; |
| 276 | defer last_field = identifier; |
| 278 | 277 | const container_field = try p.expectContainerFieldRecoverable(); |
| 279 | 278 | if (container_field != 0) { |
| 280 | 279 | switch (field_state) { |
| ... | ... | @@ -288,7 +287,7 @@ const Parser = struct { |
| 288 | 287 | try p.warnMsg(.{ |
| 289 | 288 | .tag = .previous_field, |
| 290 | 289 | .is_note = true, |
| 291 | | .token = p.last_field, |
| 290 | .token = last_field, |
| 292 | 291 | }); |
| 293 | 292 | try p.warnMsg(.{ |
| 294 | 293 | .tag = .next_field, |
| ... | ... | @@ -389,7 +388,7 @@ const Parser = struct { |
| 389 | 388 | }, |
| 390 | 389 | .identifier => { |
| 391 | 390 | const identifier = p.tok_i; |
| 392 | | defer p.last_field = identifier; |
| 391 | defer last_field = identifier; |
| 393 | 392 | const container_field = try p.expectContainerFieldRecoverable(); |
| 394 | 393 | if (container_field != 0) { |
| 395 | 394 | switch (field_state) { |
| ... | ... | @@ -402,7 +401,7 @@ const Parser = struct { |
| 402 | 401 | }); |
| 403 | 402 | try p.warnMsg(.{ |
| 404 | 403 | .tag = .previous_field, |
| 405 | | .token = p.last_field, |
| 404 | .token = last_field, |
| 406 | 405 | }); |
| 407 | 406 | try p.warnMsg(.{ |
| 408 | 407 | .tag = .next_field, |