reformulated the parsing of the parameters and

made it memory safe
This commit is contained in:
Karma Riuk
2025-07-15 01:43:22 +02:00
parent 4a9deff8da
commit 6313027d07
2 changed files with 31 additions and 12 deletions

View File

@@ -53,13 +53,13 @@ TEST_SUITE("Parser: function") {
);
}
SUBCASE("Missing comma with no closing paren one param") {
test_failing_parsing("fn (x { return 2; }", {token::type::COMMA});
SUBCASE("Missing closing paren one param") {
test_failing_parsing("fn (x { return 2; }", {token::type::RPAREN});
}
SUBCASE("Missing closing paren two params") {
test_failing_parsing(
"fn (x, y { return 2; }",
{token::type::COMMA}
{token::type::RPAREN}
);
}