Fix examples so all ten parse

- 03: handler clause uses the canonical arrow (↯e ⟹ …, was ↯e ⇒ …)
- 05: give sin/cos a real placeholder body (⊥) — a comment-only body is
  empty and cannot parse
- Run parseExamples on the test runtime classpath; ParseExamples lives in
  the test source set and was never found on main.runtimeClasspath

./gradlew parseExamples now reports 10/10 PASS
This commit is contained in:
developtheweb 2026-07-09 02:54:10 -04:00
parent f076a1dade
commit acb98ae145
3 changed files with 7 additions and 5 deletions

View file

@ -47,8 +47,10 @@ test {
}
}
task parseExamples(type: JavaExec, dependsOn: classes) {
// ParseExamples lives in the test source set, so the task needs the test
// runtime classpath (with main.runtimeClasspath the class was never found).
task parseExamples(type: JavaExec, dependsOn: testClasses) {
mainClass = 'com.mpl.test.ParseExamples'
classpath = sourceSets.main.runtimeClasspath
classpath = sourceSets.test.runtimeClasspath
args = ['examples']
}

View file

@ -4,4 +4,4 @@ processFile ≜ λpath: {
result ← transform(data);
writeFile(result, 🖫"output.txt");
⟨"success"|"failed"⟩
} ↴ {↯e ⟨⊥|e⟩};
} ↴ {↯e ⟨⊥|e⟩};

View file

@ -1,8 +1,8 @@
-- Module definition example
𝓜 Mathematics ⇒ {
π ≜ 3.14159;
sin ≜ λx∈: {- implementation -};
cos ≜ λx∈: {- implementation -}
sin ≜ λx∈: {- implementation deferred until MPL executes -};
cos ≜ λx∈: {- implementation deferred until MPL executes -}
};
angle ← π/4;