From 73644eda850cab10504db52cc7cc74af764015cb Mon Sep 17 00:00:00 2001 From: Doug Coleman Date: Fri, 3 Aug 2018 17:22:00 -0400 Subject: [PATCH] modern.out: Write literals better. --- extra/modern/out/out.factor | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) diff --git a/extra/modern/out/out.factor b/extra/modern/out/out.factor index 775e6e55c4..c1fc0124f1 100644 --- a/extra/modern/out/out.factor +++ b/extra/modern/out/out.factor @@ -27,13 +27,12 @@ GENERIC: write-literal* ( last obj -- last' ) M: slice write-literal* [ write-whitespace ] [ write ] [ ] tri ; M: array write-literal* [ write-literal* ] each ; M: renamed write-literal* [ slice>> write-whitespace ] [ string>> write ] [ slice>> ] tri ; ! for refactoring - - +M: string write-literal* write ; DEFER: map-literals : (map-literals) ( obj quot: ( obj -- obj' ) -- seq ) over [ array? ] any? [ - [ call drop ] [ map-literals ] 2bi + [ call ] [ map-literals ] bi ] [ over array? [ map-literals ] [ call ] if ] if ; inline recursive @@ -42,7 +41,6 @@ DEFER: map-literals '[ _ (map-literals) ] map ; inline recursive - ! Start with no slice as ``last`` : write-literal ( obj -- ) f swap write-literal* drop ; @@ -106,3 +104,15 @@ DEFER: map-literals { "" } surround "resource:core-parsed.factor" utf8 [ ... ] with-file-writer ; + +![[ +: rewrite-core-paths-with-semis ( -- ) + core-source-paths first [ + dup { [ array? ] [ ?first upper-colon? ] } 1&& [ + dup ?first >strings . + dup length 2 = [ + first2 1 cut* { " " ";" } swap 3append 2array + ] when + ] when + ] rewrite-path ; +]] \ No newline at end of file