mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 23:37:35 +00:00
LibJS: Plumb line and column information through Lexer / Parser
While debugging test failures, it's pretty frustrating to have to go do printf debugging to figure out what test is failing right now. While watching your JS Raytracer stream it seemed like this was pretty furstrating as well. So I wanted to start working on improving the diagnostics here. In the future I hope we can eventually be able to plumb the info down to the Error classes so any thrown exceptions will contain enough metadata to know where they came from.
This commit is contained in:
parent
4f200def9c
commit
dd112421b4
4 changed files with 34 additions and 7 deletions
|
@ -54,8 +54,10 @@ private:
|
|||
StringView m_source;
|
||||
size_t m_position = 0;
|
||||
Token m_current_token;
|
||||
int m_current_char;
|
||||
int m_current_char = 0;
|
||||
bool m_has_errors = false;
|
||||
size_t m_line_number = 1;
|
||||
size_t m_line_column = 1;
|
||||
|
||||
static HashMap<String, TokenType> s_keywords;
|
||||
static HashMap<String, TokenType> s_three_char_tokens;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue