Fixes issue where string lex token position start would be off by one.
continuous-integration/drone/push Build is passing
Details
continuous-integration/drone/push Build is passing
Details
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…
Reference in New Issue