-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Support --chain option, sketch more rules in yegor.yaml
- Loading branch information
Showing
3 changed files
with
66 additions
and
14 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,22 @@ | ||
title: Tests for Rule 6 | ||
tests: | ||
- name: 'Case (1)' | ||
- name: "Case (1)" | ||
input: | | ||
{ a ↦ ⟦ b ↦ ⟦ Δ ⤍ 00- ⟧, c ↦ ⟦ Δ ⤍ 03- ⟧ ⟧.b } | ||
normalized: | | ||
{ a ↦ ⟦ Δ ⤍ 00- ⟧(ρ ↦ ⟦ c ↦ ⟦ Δ ⤍ 03- ⟧ ⟧) } | ||
prettified: | | ||
{ a ↦ ⟦ b ↦ ⟦ Δ ⤍ 00- ⟧, c ↦ ⟦ Δ ⤍ 03- ⟧ ⟧.b } | ||
{ a ↦ ⟦ b ↦ ⟦ Δ ⤍ 00- ⟧, c ↦ ⟦ Δ ⤍ 03- ⟧ ⟧.b } | ||
- name: "Case (2)" | ||
input: | | ||
{ | ||
a ↦ | ||
⟦ | ||
b ↦ | ||
⟦ | ||
c ↦ ∅, | ||
d ↦ ⟦ φ ↦ ξ.ρ.c ⟧ | ||
⟧, | ||
e ↦ ξ.b(c ↦ ⟦⟧).d | ||
⟧.e | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,19 +1,48 @@ | ||
title: "Rule set based on Yegor's draft" | ||
rules: | ||
- name: Rule 5 | ||
description: "ξ-dispatch" | ||
pattern: | | ||
⟦ !a ↦ ξ.!b, !B ⟧ | ||
result: | | ||
⟦ !a ↦ ⟦ !B ⟧.!b, !B ⟧ | ||
when: [] | ||
tests: [] | ||
|
||
- name: Rule 6 | ||
description: "Accessing an α-binding" | ||
pattern: | | ||
⟦ !a ↦ !n, !B ⟧.!a | ||
result: | | ||
!n(ρ ↦ ⟦ !B ⟧) | ||
when: | ||
- nf: [ "!n" ] | ||
- nf: ["!n"] | ||
tests: | ||
- name: Should match | ||
input: ⟦ hello ↦ ⟦⟧ ⟧.hello | ||
output: ⟦⟧(ρ ↦ ⟦⟧) | ||
matches: true | ||
- name: Shouldn't match | ||
input: ⟦ ⟧.hello | ||
output: '' | ||
output: "" | ||
matches: false | ||
|
||
- name: Rule 7 | ||
description: "Application" | ||
pattern: | | ||
⟦ !a ↦ ∅, !B ⟧(!a ↦ !n) | ||
result: | | ||
⟦ !a ↦ !n, !B ⟧ | ||
when: | ||
- nf: ["!n"] | ||
tests: [] | ||
|
||
# - name: Rule 8 | ||
|
||
- name: Rule 9 | ||
description: "Parent application" | ||
pattern: ⟦ ρ ↦ !t, !B ⟧(ρ ↦ !n) | ||
result: ⟦ ρ ↦ !n, !B ⟧ | ||
when: | ||
- nf: ["!n"] | ||
tests: [] |