mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 21:37:35 +00:00
LibJS: Set Token's m_offset to the value's start index
This makes much more sense than the current way of setting it to the Lexer's m_position after consuming the full value.
This commit is contained in:
parent
c1d3b557d5
commit
95a9f12b97
2 changed files with 9 additions and 4 deletions
|
@ -832,7 +832,7 @@ Token Lexer::next()
|
|||
m_filename,
|
||||
m_line_number,
|
||||
m_line_column - 1,
|
||||
m_position);
|
||||
value_start + 1);
|
||||
m_hit_invalid_unicode.clear();
|
||||
// Do not produce any further tokens.
|
||||
VERIFY(is_eof());
|
||||
|
@ -845,7 +845,7 @@ Token Lexer::next()
|
|||
m_filename,
|
||||
value_start_line_number,
|
||||
value_start_column_number,
|
||||
m_position);
|
||||
value_start - 1);
|
||||
}
|
||||
|
||||
if (identifier.has_value())
|
||||
|
@ -889,7 +889,7 @@ Token Lexer::force_slash_as_regex()
|
|||
m_filename,
|
||||
m_current_token.line_number(),
|
||||
m_current_token.line_column(),
|
||||
m_position);
|
||||
value_start - 1);
|
||||
|
||||
if constexpr (LEXER_DEBUG) {
|
||||
dbgln("------------------------------");
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue