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;
|
||||
if (held_line[q -| 1] == '@') {
|
||||
const s = held_line[tok.loc.start..tok.loc.end];
|
||||
const q = std.mem.indexOf(u8, s, "\"") orelse return .other;
|
||||
if (s[q -| 1] == '@') {
|
||||
tok.tag = .identifier;
|
||||
} else {
|
||||
tok.tag = .string_literal;
|
||||
|
Loading…
Reference in New Issue
Block a user