mirror of
https://github.com/RGBCube/serenity
synced 2025-05-31 05:08:13 +00:00
LibJS: Remove syntax errors from lexer
Giving the lexer the ability to generate errors adds unnecessary complexity - also it only calls its syntax_error() function in one place anyway ("unterminated string literal"). But since the lexer *also* emits tokens like Eof or UnterminatedStringLiteral, it should be up to the consumer of these tokens to decide what to do. Also remove the option to not print errors to stderr as that's not relevant anymore.
This commit is contained in:
parent
3485613f4a
commit
00b61a212f
4 changed files with 2 additions and 20 deletions
|
@ -75,7 +75,7 @@ public:
|
|||
NonnullRefPtr<NewExpression> parse_new_expression();
|
||||
RefPtr<FunctionExpression> try_parse_arrow_function_expression(bool expect_parens);
|
||||
|
||||
bool has_errors() const { return m_parser_state.m_lexer.has_errors() || m_parser_state.m_has_errors; }
|
||||
bool has_errors() const { m_parser_state.m_has_errors; }
|
||||
|
||||
private:
|
||||
friend class ScopePusher;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue