I forgot about commas
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user