# HG changeset patch # User Leonard Ritter # Date 1685789810 -7200 # Sat Jun 03 12:56:50 2023 +0200 # Node ID 1d5a3b774e591328a7583b408198d4fc9d6283c1 # Parent 27e4b014af339ed12914a27bf8285ed5bc5c7bf5 * compiler.Printer: export new implementations of `print`, `report`, `repr` and `tostring` diff --git a/lib/scopes/compiler/Printer.sc b/lib/scopes/compiler/Printer.sc --- a/lib/scopes/compiler/Printer.sc +++ b/lib/scopes/compiler/Printer.sc @@ -248,7 +248,6 @@ countof self.string inline tostring (self) - 'flush-style self 'emit (storagecast self) 'string inline fwrite (self str size) @@ -456,9 +455,9 @@ inline /nostyle (...) @@ printer inline (ss) - 'flush-style ss prev-style := 'get-style ss 'set-style ss Style.None + 'flush-style ss do ss := 'change-options ss ANSI? = false @@ -643,6 +642,13 @@ inline crepr (...) sprint := (StringPrinter) (view sprint) ... + 'flush-style sprint + 'tostring sprint + +inline ctostring (...) + sprint := (StringPrinter) + (view sprint) + /nostyle ... 'tostring sprint spice creport (...) @@ -850,6 +856,11 @@ do let Printer ErrorPrinter StdPrinter Styled Style /nostyle /s /.. /n /p /t let /nolines /pc /ps /pn /tstyle ReprIndentToken /n? /quote /string - let cprint cprint2 StringPrinter printer creport /data /depth char-printable? - let crepr + let /data /depth char-printable? StringPrinter + let + print = cprint + print2 = cprint2 + report = creport + repr = crepr + tostring = ctostring locals;