@[inline]
Simplistic MonadQuotation that does not guarantee globally fresh names, that
is, between different runs of this or other MonadQuotation implementations.
It is only safe if the syntax quotations do not introduce bindings around
antiquotations, and if references to globals are prefixed with _root_.
(which is not allowed to refer to a local variable).
`Unhygienic` can also be seen as a model implementation of `MonadQuotation`
(since it is completely hygienic as long as it is "run" only once and can
assume that there are no other implentations in use, as is the case for the
elaboration monads that carry their macro scope state through the entire
processing of a file). It uses the state monad to query and allocate the
next macro scope, and uses the reader monad to store the stack of scopes
corresponding to `withFreshMacroScope` calls.
Equations
- One or more equations did not get rendered due to their size.
Equations
- Lean.Unhygienic.run x = StateT.run' (x { ref := Lean.Syntax.missing, scope := Lean.firstFrontendMacroScope }) (Lean.firstFrontendMacroScope + 1)
Equations
- options : Lean.Options
- nameStem2Idx : Lean.NameMap Nat
- userName2Sanitized : Lean.NameMap Lean.Name
Equations
- One or more equations did not get rendered due to their size.
Equations
- Lean.sanitizeSyntax stx = do let a ← get if Lean.getSanitizeNames a.options = true then Lean.sanitizeSyntaxAux stx else pure stx