Fix handling of invalid tokens in getPositionContext (#1006)
This commit is contained in:
parent
2071db440d
commit
dedb9deb08
@ -1576,8 +1576,9 @@ pub fn getPositionContext(
|
|||||||
},
|
},
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
const q = std.mem.lastIndexOf(u8, held_line, "\"") orelse return .other;
|
const s = held_line[tok.loc.start..tok.loc.end];
|
||||||
if (held_line[q -| 1] == '@') {
|
const q = std.mem.indexOf(u8, s, "\"") orelse return .other;
|
||||||
|
if (s[q -| 1] == '@') {
|
||||||
tok.tag = .identifier;
|
tok.tag = .identifier;
|
||||||
} else {
|
} else {
|
||||||
tok.tag = .string_literal;
|
tok.tag = .string_literal;
|
||||||
|
Loading…
Reference in New Issue
Block a user