Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions Cslib/Foundations/Data/Relation.lean
Original file line number Diff line number Diff line change
Expand Up @@ -473,17 +473,18 @@ initialize Lean.registerBuiltinAttribute {
name := `reduction_sys
descr := "Register notation for a relation and its closures."
add := fun decl stx _ => MetaM.run' do
let currNamespace ← getCurrNamespace
match stx with
| `(attr | reduction_sys $sym) =>
let mut sym := sym
unless sym.getString.endsWith " " do
sym := Syntax.mkStrLit (sym.getString ++ " ")
liftCommandElabM <| do
modifyScope ({ · with currNamespace := decl.getPrefix })
modifyScope ({ · with currNamespace })
elabCommand (← `(scoped reduction_notation $(mkIdent decl) $sym))
| `(attr | reduction_sys) =>
liftCommandElabM <| do
modifyScope ({ · with currNamespace := decl.getPrefix })
modifyScope ({ · with currNamespace })
elabCommand (← `(scoped reduction_notation $(mkIdent decl)))
| _ => throwError "invalid syntax for 'reduction_sys' attribute"
}
Expand Down
Loading