Skip to content
This repository was archived by the owner on May 31, 2024. It is now read-only.

fix: False-error when a variable is declared or assigned after a 0-arg statement #81

Merged
merged 1 commit into from
May 26, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/main/java/fr/cyu/chromatynk/parsing/StatementParser.java
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ public static Parser<Token, Statement> zeroArg() {
if (ZERO_ARG_STATEMENTS.containsKey(token.getClass()))
return ZERO_ARG_STATEMENTS.get(token.getClass()).apply(token.range());
else
throw new ParsingException.Fatal(new UnexpectedInputException(token.range(), "0-arg statement", token.toPrettyString()));
throw new ParsingException.Fatal(new UnexpectedInputException(token.range(), "0/1-arg statement", token.toPrettyString()));
});
}

Expand All @@ -75,7 +75,7 @@ public static Parser<Token, Statement> oneArg() {
if (ONE_ARG_STATEMENTS.containsKey(token.getClass()))
return ONE_ARG_STATEMENTS.get(token.getClass()).apply(range, expr);
else
throw new ParsingException.Fatal(new UnexpectedInputException(token.range(), "1-arg statement", token.toPrettyString()));
throw new UnexpectedInputException(token.range(), "1-arg statement", token.toPrettyString());
});
}

Expand Down