Skip to content

Commit

Permalink
Fixed end-of-line sequence to the source end-of-lines
Browse files Browse the repository at this point in the history
This should make the tests succeed on the Windows CI machine
  • Loading branch information
PieterOlivier authored and toinehartman committed Oct 4, 2024
1 parent bd25ac7 commit 1796da6
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ Tree parsePico(str input, bool visualize=false)

bool checkError(Tree t, str expectedError) {
str bestError = getErrorText(findBestError(t));
println("best error: <bestError>, expected: <expectedError>");
//println("best error: <bestError>, expected: <expectedError>");
return size(bestError) == size(expectedError);
}

Expand Down Expand Up @@ -88,7 +88,8 @@ test bool picoMissingSemi() {
input := input - 1
od
end");
return checkError(t, "input := input - 1\n od");
return checkError(t, "input := input - 1
od");
}

test bool picoTypoSmall() {
Expand All @@ -112,5 +113,6 @@ test bool picoMissingSemiSmall() {
od
end");

return checkError(t, "output := 0\n od");
return checkError(t, "output := 0
od");
}
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,11 @@ import lang::rascal::\syntax::Rascal;
import ParseTree;
import IO;

bool debugging = false;

Tree parseRascal(type[&T] t, str input, bool visualize=false) {
Tree result = parser(t, allowRecovery=true, allowAmbiguity=true)(input, |unknown:///?visualize=<"<visualize>">|);
if (debugging) {
list[Tree] errors = findAllErrors(result);
if (errors != []) {
println("Tree has <size(errors)> errors");
Expand All @@ -31,6 +34,7 @@ Tree parseRascal(type[&T] t, str input, bool visualize=false) {
Tree disambiguated = defaultErrorDisambiguationFilter(result);
println("Best error: <getErrorText(findFirstError(disambiguated))>");
}
}

return result;
}
Expand Down

0 comments on commit 1796da6

Please sign in to comment.