modern.out: if there are non-whitespace characters, perhaps after editing, turn them into whitespace.
fixs a bug like this when trying to rename CONSTANT: CONSTANT: a 1 ; CONSTANT: b 1 ; -> CONSTANT: a 1 ; CONSTANT: b 1locals-and-roots
parent
8b90c1a729
commit
20e1a1590c
|
@ -4,13 +4,17 @@ USING: accessors combinators combinators.short-circuit
|
|||
combinators.smart continuations fry io io.encodings.utf8
|
||||
io.files io.streams.string kernel modern modern.paths
|
||||
modern.slices multiline namespaces prettyprint sequences sets
|
||||
splitting strings arrays ;
|
||||
splitting strings arrays unicode ;
|
||||
IN: modern.out
|
||||
|
||||
symbol: last-slice
|
||||
|
||||
: replace-whitespace ( string -- string' )
|
||||
[ dup blank? [ drop char: \s ] unless ] map ;
|
||||
|
||||
: write-whitespace ( obj -- )
|
||||
[ last-slice get [ swap slice-between ] [ slice-before ] if* io:write ]
|
||||
! [ last-slice get [ swap slice-between ] [ slice-before ] if* io:write ]
|
||||
[ last-slice get [ swap slice-between replace-whitespace io:write ] [ drop ] if* ]
|
||||
[ last-slice namespaces:set ] bi ;
|
||||
|
||||
defer: write-literal
|
||||
|
|
Loading…
Reference in New Issue