| SMLFormat |
structure PrettyPrinter :> PRETTYPRINTER =
struct
type environmentEntry =
{requiredColumns : int, newline : bool ref, priority : FE.priority}
type environment = environmentEntry list
datatype symbol =
Term of int * string
| List of {symbols : symbol list, environment : environment}
| Indicator of {space : bool, newline : bool ref}
| DeferredIndicator of {space : bool, requiredColumns : int ref}
| StartOfIndent of int
| EndOfIndent
exception Fail of string
val format : PrinterParameter.parameter list -> symbol -> string
end
Type detail |
---|
type environmentEntry =
{requiredColumns : int, newline : bool ref, priority : FE.priority}
type environment = environmentEntry list
Datatype detail |
---|
datatype symbol =
Term of int * string
| List of {symbols : symbol list, environment : environment}
| Indicator of {space : bool, newline : bool ref}
| DeferredIndicator of {space : bool, requiredColumns : int ref}
| StartOfIndent of int
| EndOfIndent
DataConstructor detail |
---|
constructor Term : int * string -> symbol
constructor List : {symbols : symbol list, environment : environment} -> symbol
constructor Indicator : {space : bool, newline : bool ref} -> symbol
constructor DeferredIndicator
: {space : bool, requiredColumns : int ref} -> symbol
constructor StartOfIndent : int -> symbol
constructor EndOfIndent : symbol
Value detail |
---|
fun format parameter symbol
: PrinterParameter.parameter list -> symbol -> string
This function tries to insert newline characters so that the text can fit within the specified column width, but it may exceed the specified column width if the column width is too small.
parameter
symbol
Exception detail |
---|
exception Fail of string
message
| SMLFormat: Pretty-Printer library for SML |