File: .lake/packages/lean4/src/lean/Lean/Hygiene.lean

full_name: Lean.Unhygienic.Context.ref
code: structure Unhygienic.Context where
  ref   : Syntax
  scope : MacroScope
goal: Lean.Syntax

full_name: Lean.Unhygienic.Context.scope
code: structure Unhygienic.Context where
  ref   : Syntax
  scope : MacroScope
goal: Lean.MacroScope

full_name: Lean.Unhygienic.Context
code: structure Unhygienic.Context where
  ref   : Syntax
  scope : MacroScope
goal: Type

full_name: Lean.Unhygienic
code: /--
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 implementations 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.
-/
abbrev Unhygienic 
goal: Type

full_name: Lean.Unhygienic.instMonadQuotation
code: instance : MonadQuotation Unhygienic 
goal: Lean.MonadQuotation Lean.Unhygienic

full_name: Lean.Unhygienic.run
code: @[inline]
protected def run {α : Type} (x : Unhygienic α) : α 
goal: α

full_name: _private.«.lake».packages.lean4.src.lean.Lean.Hygiene.0.Lean.mkInaccessibleUserNameAux
code: private def mkInaccessibleUserNameAux (unicode : Bool) (name : Name) (idx : Nat) : Name 
goal: Lean.Name

full_name: _private.«.lake».packages.lean4.src.lean.Lean.Hygiene.0.Lean.mkInaccessibleUserName
code: private def mkInaccessibleUserName (unicode : Bool) : Name → Name
  
goal: Lean.Name → Lean.Name

full_name: Lean.initFn._@..lake.packages.lean4.src.lean.Lean.Hygiene._hyg.342
code: register_builtin_option pp.sanitizeNames : Bool := {
  defValue := true
  group    := "pp"
  descr    := "add suffix to shadowed/inaccessible variables when pretty printing"
}
goal: IO (Lean.Option Bool)

full_name: Lean.pp.sanitizeNames
code: register_builtin_option pp.sanitizeNames : Bool := {
  defValue := true
  group    := "pp"
  descr    := "add suffix to shadowed/inaccessible variables when pretty printing"
}
goal: Lean.Option Bool

full_name: Lean.getSanitizeNames
code: def getSanitizeNames (o : Options) : Bool 
goal: Bool

full_name: Lean.NameSanitizerState.options
code: structure NameSanitizerState where
  options            : Options
  /-- `x` ~> 2 if we're already using `x✝`, `x✝¹` -/
  nameStem2Idx       : NameMap Nat := {}
  /-- `x._hyg...` ~> `x✝` -/
  userName2Sanitized : NameMap Name := {}
goal: Lean.Options

full_name: Lean.NameSanitizerState.nameStem2Idx
code: structure NameSanitizerState where
  options            : Options
  /-- `x` ~> 2 if we're already using `x✝`, `x✝¹` -/
  nameStem2Idx       : NameMap Nat := {}
  /-- `x._hyg...` ~> `x✝` -/
  userName2Sanitized : NameMap Name := {}
goal: Lean.NameMap Nat

full_name: Lean.NameSanitizerState
code: structure NameSanitizerState where
  options            : Options
  /-- `x` ~> 2 if we're already using `x✝`, `x✝¹` -/
  nameStem2Idx       : NameMap Nat := {}
  /-- `x._hyg...` ~> `x✝` -/
  userName2Sanitized : NameMap Name := {}
goal: Type

full_name: Lean.NameSanitizerState.userName2Sanitized
code: structure NameSanitizerState where
  options            : Options
  /-- `x` ~> 2 if we're already using `x✝`, `x✝¹` -/
  nameStem2Idx       : NameMap Nat := {}
  /-- `x._hyg...` ~> `x✝` -/
  userName2Sanitized : NameMap Name := {}
goal: Lean.NameMap Lean.Name

full_name: _private.«.lake».packages.lean4.src.lean.Lean.Hygiene.0.Lean.mkFreshInaccessibleUserName
code: private partial def mkFreshInaccessibleUserName (userName : Name) (idx : Nat) : StateM NameSanitizerState Name 
goal: StateM Lean.NameSanitizerState Lean.Name

full_name: Lean.sanitizeName
code: /-- Erase macro scopes from `userName` and add "tombstone" + superscript (or `._hyg`). -/
def sanitizeName (userName : Name) : StateM NameSanitizerState Name 
goal: StateM Lean.NameSanitizerState Lean.Name

full_name: _private.«.lake».packages.lean4.src.lean.Lean.Hygiene.0.Lean.sanitizeSyntaxAux
code: private partial def sanitizeSyntaxAux : Syntax → StateM NameSanitizerState Syntax
  
goal: Lean.Syntax → StateM Lean.NameSanitizerState Lean.Syntax

full_name: Lean.sanitizeSyntax
code: def sanitizeSyntax (stx : Syntax) : StateM NameSanitizerState Syntax 
goal: StateM Lean.NameSanitizerState Lean.Syntax