Skip to content

Commit

Permalink
Merge pull request #109 from objectionary/rule-12
Browse files Browse the repository at this point in the history
Add rule 12 to the user-defined rules
  • Loading branch information
aabounegm authored Feb 11, 2024
2 parents 937ca10 + c248d60 commit 456d83a
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 0 deletions.
1 change: 1 addition & 0 deletions eo-phi-normalizer/src/Language/EO/Phi/Rules/Yaml.hs
Original file line number Diff line number Diff line change
Expand Up @@ -240,6 +240,7 @@ matchObject (MetaObject m) obj =
, bindingsMetas = []
, attributeMetas = []
}
matchObject Termination Termination = [emptySubst]
matchObject _ _ = [] -- ? emptySubst ?

matchBindings :: [Binding] -> [Binding] -> [Subst]
Expand Down
17 changes: 17 additions & 0 deletions eo-phi-normalizer/test/eo/phi/rules/yegor.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -136,3 +136,20 @@ rules:
input: '⟦ ρ ↦ ⟦ ⟧, σ ↦ ⟦ ⟧ ⟧.x'
output: ''
matches: true

- name: Rule 12
description: 'Accessing an attribute on bottom'
pattern: |
⊥.!a
result: |
when: []
tests:
- name: 'Dispatch on bottom is bottom'
input: '⊥.a'
output: ''
matches: true
- name: 'Dispatch on anything else is not touched'
input: '⟦ ⟧.a'
output: '⟦ ⟧.a'
matches: false

0 comments on commit 456d83a

Please sign in to comment.