modern.out: Add a <renamed> word to keep spacing correct when

refactoring.

"math" [ dup { [ slice? ] [ seq>> string? ] } 1&& [ dup >upper <renamed> ] when ] rewrite-vocab
modern-harvey2
Doug Coleman 2017-09-03 13:28:39 -05:00
parent 9a983d611f
commit 2773cbf889
1 changed files with 8 additions and 5 deletions

View File

@ -1,11 +1,14 @@
! Copyright (C) 2017 Doug Coleman.
! See http://factorcode.org/license.txt for BSD license.
USING: arrays assocs io io.encodings.utf8 io.files
io.streams.string kernel modern modern.paths modern.slices
multiline namespaces prettyprint sequences sequences.extras
splitting strings continuations fry ;
USING: accessors arrays assocs constructors continuations fry io
io.encodings.utf8 io.files io.streams.string kernel modern
modern.paths modern.slices multiline namespaces prettyprint
sequences sequences.extras splitting strings ;
IN: modern.out
TUPLE: renamed slice string ;
CONSTRUCTOR: <renamed> renamed ( slice string -- obj ) ;
: trim-before-newline ( seq -- seq' )
dup [ char: \s = not ] find
{ char: \r char: \n } member?
@ -19,7 +22,7 @@ IN: modern.out
GENERIC: write-literal* ( last obj -- last' )
M: slice write-literal* [ write-whitespace ] [ write ] [ ] tri ;
M: array write-literal* [ write-literal* ] each ;
M: string write-literal* [ write-whitespace ] [ write ] [ ] tri ; ! for refactoring
M: renamed write-literal* [ slice>> write-whitespace ] [ string>> write ] [ slice>> ] tri ; ! for refactoring