diff options
author | Linus Groh <mail@linusgroh.de> | 2020-05-14 16:08:40 +0100 |
---|---|---|
committer | Andreas Kling <kling@serenityos.org> | 2020-05-15 09:53:52 +0200 |
commit | 00b61a212fba0ca83f2682b9bc0a136536e55be7 (patch) | |
tree | 32526399159c4d2f5270ba1d3aac20909506db89 /Userland | |
parent | 3485613f4ad2e766378c6a503879d04a8884bf89 (diff) | |
download | serenity-00b61a212fba0ca83f2682b9bc0a136536e55be7.zip |
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.
Diffstat (limited to 'Userland')
-rw-r--r-- | Userland/js.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/Userland/js.cpp b/Userland/js.cpp index ed5ddb3c56..acfe17d87e 100644 --- a/Userland/js.cpp +++ b/Userland/js.cpp @@ -524,7 +524,7 @@ int main(int argc, char** argv) size_t open_indents = s_repl_line_level; - JS::Lexer lexer(str, false); + JS::Lexer lexer(str); bool indenters_starting_line = true; for (JS::Token token = lexer.next(); token.type() != JS::TokenType::Eof; token = lexer.next()) { auto length = token.value().length(); |