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:
parent
f076a1dade
commit
acb98ae145
3 changed files with 7 additions and 5 deletions
|
|
@ -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']
|
||||
}
|
||||
|
|
@ -4,4 +4,4 @@ processFile ≜ λpath: {
|
|||
result ← transform(data);
|
||||
writeFile(result, 🖫"output.txt");
|
||||
⟨"success"|"failed"⟩
|
||||
} ↴ {↯e ⇒ ⟨⊥|e⟩};
|
||||
} ↴ {↯e ⟹ ⟨⊥|e⟩};
|
||||
|
|
@ -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;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue