Handbook
Glossary
fresh-line ( n -- )
Vocabulary
prettyprint
.
sections
Inputs
n
the current column position
Outputs
None
Word description
Advances the prettyprinter by one line unless the current line is empty. If the line limit is exceeded, escapes the prettyprinter by restoring a continuation captured in
do-pprint
.
Definition
USING:
accessors
continuations
io
kernel
math
namespaces
;
IN:
prettyprint.sections
:
fresh-line
( n -- )
pprinter
get
2dup
last-newline>>
=
[
2drop
]
[
swap
>>last-newline
line-limit?
[
"..."
write
return
]
when
[
1
+
]
change-line-count
drop
nl
do-indent
]
if
;