mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 16:37:35 +00:00
LibJS: Fix incorrect token column values (#2401)
- initializing m_line_column to 1 in the lexer results in incorrect column values in tokens on the first line of input. - not incrementing m_line_column when EOF is reached results in an incorrect column value on the last token.
This commit is contained in:
parent
7bb69bb9bf
commit
11405c5139
4 changed files with 15 additions and 17 deletions
|
@ -55,11 +55,11 @@ private:
|
|||
bool match(char, char, char, char) const;
|
||||
|
||||
StringView m_source;
|
||||
size_t m_position = 0;
|
||||
size_t m_position { 0 };
|
||||
Token m_current_token;
|
||||
int m_current_char = 0;
|
||||
size_t m_line_number = 1;
|
||||
size_t m_line_column = 1;
|
||||
int m_current_char { 0 };
|
||||
size_t m_line_number { 1 };
|
||||
size_t m_line_column { 0 };
|
||||
|
||||
struct TemplateState {
|
||||
bool in_expr;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue