@@ -719,17 +719,17 @@ elab "create_lts" lt:ident name:ident : command => do
719719 also used this as a constructor name, you will need quotes to access corresponding cases, e.g. «β»
720720 in the above example.
721721-/
722- syntax "lts_transition_notation" ident (str)? : command
722+ syntax attrKind "lts_transition_notation" ident (str)? : command
723723macro_rules
724- | `(lts_transition_notation $lts $sym) =>
724+ | `($kind:attrKind lts_transition_notation $lts $sym) =>
725725 `(
726- notation3 t:39 "[" μ"]⭢" $sym:str t':39 => (LTS.Tr.toRelation $lts μ) t t'
727- notation3 t:39 "[" μs"]↠" $sym:str t':39 => (LTS.MTr.toRelation $lts μs) t t'
726+ $kind:attrKind notation3 t:39 "[" μ"]⭢" $sym:str t':39 => (LTS.Tr.toRelation $lts μ) t t'
727+ $kind:attrKind notation3 t:39 "[" μs"]↠" $sym:str t':39 => (LTS.MTr.toRelation $lts μs) t t'
728728 )
729- | `(lts_transition_notation $lts) =>
729+ | `($kind:attrKind lts_transition_notation $lts) =>
730730 `(
731- notation3 t:39 "[" μ"]⭢" t':39 => (LTS.Tr.toRelation $lts μ) t t'
732- notation3 t:39 "[" μs"]↠" t':39 => (LTS.MTr.toRelation $lts μs) t t'
731+ $kind:attrKind notation3 t:39 "[" μ"]⭢" t':39 => (LTS.Tr.toRelation $lts μ) t t'
732+ $kind:attrKind notation3 t:39 "[" μs"]↠" t':39 => (LTS.MTr.toRelation $lts μs) t t'
733733 )
734734
735735/-- This attribute calls the `lts_transition_notation` command for the annotated declaration. -/
@@ -746,11 +746,15 @@ initialize Lean.registerBuiltinAttribute {
746746 sym := Syntax.mkStrLit (sym.getString ++ " " )
747747 let lts := lts.getId.updatePrefix decl.getPrefix |> Lean.mkIdent
748748 liftCommandElabM <| Command.elabCommand (← `(create_lts $(mkIdent decl) $lts))
749- liftCommandElabM <| Command.elabCommand (← `(lts_transition_notation $lts $sym))
749+ liftCommandElabM <| (do
750+ modifyScope ({ · with currNamespace := decl.getPrefix })
751+ Command.elabCommand (← `(scoped lts_transition_notation $lts $sym)))
750752 | `(attr | lts $lts) =>
751753 let lts := lts.getId.updatePrefix decl.getPrefix |> Lean.mkIdent
752754 liftCommandElabM <| Command.elabCommand (← `(create_lts $(mkIdent decl) $lts))
753- liftCommandElabM <| Command.elabCommand (← `(lts_transition_notation $lts))
755+ liftCommandElabM <| (do
756+ modifyScope ({ · with currNamespace := decl.getPrefix })
757+ Command.elabCommand (← `(scoped lts_transition_notation $lts)))
754758 | _ => throwError "invalid syntax for 'lts' attribute"
755759}
756760
0 commit comments