mirror of
https://gitlab.kit.edu/uskyk/typicalc.git
synced 2024-11-08 10:20:41 +00:00
parent
0285305f13
commit
5e6cb6ca4c
@ -172,7 +172,9 @@ public class TypeAssumptionParser {
|
||||
if (t.getType() == TokenType.COLON) {
|
||||
return new ParserResult<>(new ExpectingTypeDef(alreadyParsed, var));
|
||||
} else {
|
||||
return new ParserResult<>(ParseError.unexpectedToken(t, ParseError.ErrorType.TYPE_ASSUMPTION_ERROR));
|
||||
return new ParserResult<>(ParseError
|
||||
.unexpectedToken(t, ParseError.ErrorType.TYPE_ASSUMPTION_ERROR)
|
||||
.expectedType(TokenType.COLON));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -349,6 +349,16 @@ class TypeAssumptionParserTest {
|
||||
assertEquals(Token.TokenType.EOF, e.getCause().get().getType());
|
||||
}
|
||||
|
||||
@Test
|
||||
void errorCase3() {
|
||||
ParseError e = parse("s");
|
||||
assertEquals(ParseError
|
||||
.unexpectedToken(new Token(Token.TokenType.EOF, "", "s", 1),
|
||||
ParseError.ErrorType.TYPE_ASSUMPTION_ERROR)
|
||||
.expectedType(Token.TokenType.COLON),
|
||||
e);
|
||||
}
|
||||
|
||||
static ParseError parse(String input) {
|
||||
return new TypeAssumptionParser().parse(input).unwrapError();
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user