File tree 2 files changed +7
-2
lines changed
2 files changed +7
-2
lines changed Original file line number Diff line number Diff line change @@ -886,6 +886,7 @@ pub const TokenStream = struct {
886
886
887
887
pub fn next (self : * TokenStream ) Error ! ? Token {
888
888
if (self .token ) | token | {
889
+ // TODO: Audit this pattern once #2915 is closed
889
890
const copy = token ;
890
891
self .token = null ;
891
892
return copy ;
Original file line number Diff line number Diff line change @@ -411,8 +411,10 @@ pub const Tokenizer = struct {
411
411
412
412
pub fn next (self : * Tokenizer ) Token {
413
413
if (self .pending_invalid_token ) | token | {
414
+ // TODO: Audit this pattern once #2915 is closed
415
+ const copy = token ;
414
416
self .pending_invalid_token = null ;
415
- return token ;
417
+ return copy ;
416
418
}
417
419
const start_index = self .index ;
418
420
var state = State .Start ;
@@ -1265,8 +1267,10 @@ pub const Tokenizer = struct {
1265
1267
1266
1268
if (result .id == Token .Id .Eof ) {
1267
1269
if (self .pending_invalid_token ) | token | {
1270
+ // TODO: Audit this pattern once #2915 is closed
1271
+ const copy = token ;
1268
1272
self .pending_invalid_token = null ;
1269
- return token ;
1273
+ return copy ;
1270
1274
}
1271
1275
}
1272
1276
You can’t perform that action at this time.
0 commit comments