I forgot about commas

This commit is contained in:
2026-02-28 17:57:57 +11:00
parent 3a3e25c6c7
commit a434304e95
3 changed files with 16 additions and 2 deletions

View File

@@ -1165,7 +1165,7 @@ static inline ResultType(Nothing, charptr) parseLambda(SolsParser* parser) {
return Error(Nothing, charptr, type.as.error);
}
// Pattern of type, name
// Pattern of type, name, comma
SolsType tmpType;
@@ -1191,6 +1191,19 @@ static inline ResultType(Nothing, charptr) parseLambda(SolsParser* parser) {
// Add type to constructed SolsType
addChildToSolsType(&type.as.success, tmpType, argName);
parserConsume(parser);
next = parserPeek(parser, 1);
if (next.error) {
return Error(Nothing, charptr, "Expecting a comma or closing bracket");
}
if (next.as.success.type == STT_CLOSE_PAREN) {
parserConsume(parser);
break;
}
if (next.as.success.type != STT_COMMA) {
return Error(Nothing, charptr, "Expecting a comma or closing bracket");
}
parserConsume(parser);
}
// Parse type at the end