Fixes issue where string lex token position start would be off by one.
All checks were successful
continuous-integration/drone/push Build is passing
All checks were successful
continuous-integration/drone/push Build is passing
This commit is contained in:
parent
d907a58f64
commit
2327134e36
@ -432,6 +432,7 @@ namespace MalachScript::Parser {
|
||||
return Create<IntegerLiteral>(TextSpan(start, _position), value);
|
||||
}
|
||||
StringLiteral* Lexer::LexString(char8_t opening, bool heredoc) {
|
||||
auto openingPos = _position;
|
||||
Progress();
|
||||
if (heredoc) {
|
||||
Progress(2);
|
||||
@ -461,7 +462,8 @@ namespace MalachScript::Parser {
|
||||
if (heredoc) {
|
||||
Progress(2);
|
||||
}
|
||||
return Create<StringLiteral>(TextSpan(start, start + _position), ParseString(_script.substr(start, offset)));
|
||||
return Create<StringLiteral>(TextSpan(openingPos, openingPos + _position),
|
||||
ParseString(_script.substr(start, offset)));
|
||||
}
|
||||
|
||||
LexToken* Lexer::LexKeywordOrIdentifier() {
|
||||
|
Loading…
x
Reference in New Issue
Block a user