Quote an identifier string for SMT-LIB, adding pipe delimiters if needed.
Equations
- StrataDDM.quoteIdent s = if StrataDDM.needsPipeDelimiters✝ s = true then "|" ++ StrataDDM.escapePipeIdent✝ s ++ "|" else s
Instances For
Equations
Instances For
Options to control parenthesis
- alwaysParen : Bool
Always add parenthesis when feasible.
- smtStringEscaping : Bool
Use SMT-LIB 2.7 string escaping (
""for quotes) instead of C-style (\"). - formatModes : Std.HashMap String FormatMode
Force a format mode per literal kind (e.g.
"decimal"), overriding any dialect-declared spec. An absent entry means "use each type's default".
Instances For
A format context provides callbacks and information needed to properly pretty-print Strata AST types.
- opts : StrataDDM.FormatOptions
- getFnDecl : StrataDDM.QualifiedIdent → Option StrataDDM.FunctionDecl
- getOpDecl : StrataDDM.QualifiedIdent → Option StrataDDM.OpDecl
- globalContext : StrataDDM.GlobalContext
- argFormatMode : Option StrataDDM.FormatMode
Instances For
Set the format mode carried from the current argument's declaration.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Equations
- One or more equations did not get rendered due to their size.
Instances For
A format context that uses no syntactic sugar.
Equations
- StrataDDM.FormatState.empty = { openDialects := ∅ }
Instances For
Equations
Equations
- s.pushBinding ident = { openDialects := s.openDialects, bindings := s.bindings.push ident }
Instances For
A StrataFormat is a closure which given contextual information produces a format operation as well as a precedence. This is used for auto-inserting parenthesis when needed.
Formats should return maxPrec when parenthesis are not
required.
Equations
Instances For
Equations
Instances For
Equations
- StrataDDM.instToStrataFormatString = { mformat := fun (s : String) (x : StrataDDM.FormatContext) (x_1 : StrataDDM.FormatState) => StrataDDM.instToStrataFormatString._private_1 s }
Equations
- StrataDDM.instToStrataFormatFormat = { mformat := fun (s : Std.Format) (x : StrataDDM.FormatContext) (x_1 : StrataDDM.FormatState) => StrataDDM.instToStrataFormatFormat._private_1 s }
Equations
- StrataDDM.instToStrataFormatStrataFormat = { mformat := id }
Equations
- StrataDDM.instToStrataFormatNat = { mformat := fun (n : Nat) (x : StrataDDM.FormatContext) (x_1 : StrataDDM.FormatState) => StrataDDM.instToStrataFormatNat._private_1 n }
Equations
- One or more equations did not get rendered due to their size.
Equations
- One or more equations did not get rendered due to their size.
Equations
- StrataDDM.StrataFormat.withState f fmt c s = fmt c (f s)
Instances For
Equations
- One or more equations did not get rendered due to their size.
Instances For
Equations
- One or more equations did not get rendered due to their size.
Equations
- StrataDDM.TypeExprF.instToStrataFormat = { mformat := fun (e : StrataDDM.TypeExprF α) => StrataDDM.TypeExprF.instToStrataFormat._private_1 e }
Equations
Equations
Equations
- One or more equations did not get rendered due to their size.
Equations
- One or more equations did not get rendered due to their size.
Equations
- One or more equations did not get rendered due to their size.
This renders an operation returning its string representation and new state.
Equations
Instances For
Equations
Equations
- StrataDDM.MetadataAttr.instToStrataFormat = { mformat := fun (a : StrataDDM.MetadataAttr) => StrataDDM.MetadataAttr.instToStrataFormat._private_1 a }
Equations
- StrataDDM.Metadata.instToStrataFormat = { mformat := fun (m : StrataDDM.Metadata) => StrataDDM.Metadata.instToStrataFormat._private_1 m }
Equations
Equations
- StrataDDM.ArgDecl.instToStrataFormat = { mformat := fun (b : StrataDDM.ArgDecl) => StrataDDM.ArgDecl.instToStrataFormat._private_1 b }
Equations
- One or more equations did not get rendered due to their size.
Equations
Equations
- StrataDDM.SynCatDecl.instToStrataFormat = { mformat := fun (d : StrataDDM.SynCatDecl) => StrataDDM.SynCatDecl.instToStrataFormat._private_1 d }
Equations
- StrataDDM.OpDecl.instToStrataFormat = { mformat := fun (d : StrataDDM.OpDecl) => StrataDDM.OpDecl.instToStrataFormat._private_1 d }
Equations
- StrataDDM.TypeDecl.instToStrataFormat = { mformat := fun (d : StrataDDM.TypeDecl) => StrataDDM.TypeDecl.instToStrataFormat._private_1 d }
Equations
- StrataDDM.FunctionDecl.instToStrataFormat = { mformat := fun (d : StrataDDM.FunctionDecl) => StrataDDM.FunctionDecl.instToStrataFormat._private_1 d }
Equations
- StrataDDM.MetadataDecl.instToStrataFormat = { mformat := fun (d : StrataDDM.MetadataDecl) => StrataDDM.MetadataDecl.instToStrataFormat._private_1 d }
Equations
Pretty print the dialect with the given name in the map.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Equations
- p.formatContext opts = StrataDDM.FormatContext.ofDialects p.dialects p.globalContext opts
Instances For
Equations
- p.formatState = { openDialects := List.foldl (fun (a : Std.HashSet String) (d : StrataDDM.Dialect) => a.insert d.name) ∅ p.dialects.toList }
Instances For
Equations
- One or more equations did not get rendered due to their size.
Instances For
Equations
- p.toString opts = Std.Format.render✝ (p.format opts)
Instances For
Equations
- StrataDDM.Program.instToString = { toString := fun (p : StrataDDM.Program) => p.toString }
Equations
- One or more equations did not get rendered due to their size.