Skip to content

Commit

Permalink
Merge pull request #112 from objectionary/rule-2
Browse files Browse the repository at this point in the history
Add rule 2 to user-defined rules
  • Loading branch information
fizruk authored Feb 12, 2024
2 parents 088455e + 3387e84 commit 6eafd04
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions eo-phi-normalizer/test/eo/phi/rules/yegor.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,26 @@ rules:
output: '⟦ a ↦ ⟦ ν ↦ ⟦ Δ ⤍ 00- ⟧ ⟧ ⟧'
matches: true

- name: Rule 2
description: ''
pattern: |
⟦ !a ↦ ⟦ !b ↦ ⟦ !B1 ⟧, σ ↦ !obj, !B2 ⟧, !B_rest ⟧
result: |
⟦ !a ↦ ⟦ !b ↦ ⟦ σ ↦ !obj.!a, !B1 ⟧, σ ↦ !obj, !B2 ⟧, !B_rest ⟧
when:
- absent_attrs:
attrs: ['σ']
bindings: ['!B1']
tests:
- name: 'Adds home attribute'
input: '⟦ a ↦ ⟦ b ↦ ⟦ ⟧, σ ↦ ⟦ ⟧ ⟧ ⟧'
output: '⟦ a ↦ ⟦ b ↦ ⟦ σ ↦ ⟦ ⟧.a ⟧, σ ↦ ⟦ ⟧ ⟧ ⟧'
matches: true
- name: 'Leaves the object unchanged'
input: '⟦ a ↦ ⟦ b ↦ ⟦ σ ↦ ⟦ ⟧ ⟧ ⟧ ⟧'
output: '⟦ a ↦ ⟦ b ↦ ⟦ σ ↦ ⟦ ⟧ ⟧ ⟧ ⟧'
matches: false

- name: Rule 3
description: 'Initialization of parent attribute'
pattern: |
Expand Down

0 comments on commit 6eafd04

Please sign in to comment.