Fixed some low hanging fruit in performance.

This commit is contained in:
2020-10-09 12:55:49 +02:00
parent 43f080cc48
commit dcb6c58f90
6 changed files with 79 additions and 53 deletions

View File

@@ -7,11 +7,12 @@ using namespace MalachScript;
#define PARSE_TEST(name, scriptText, asserts) \
TEST_CASE(name) { \
Diagnostics::Diagnostics diags; \
auto lexer = Parser::Lexer(u8##name, u8##scriptText, &diags); \
auto lexer = Parser::Lexer(u8##name, u8##scriptText, &diags); \
auto token = lexer.Lex(); \
auto parser = Parser::Parser(u8##name, token, &diags); \
auto parser = Parser::Parser(u8##name, token, &diags); \
auto script = parser.Parse(); \
asserts; \
delete script; \
}
PARSE_TEST("Parse class without definition", "class foobar;", {