From 1e8d41ae656636bf8147cd14705bdc4e42fb4b6d Mon Sep 17 00:00:00 2001 From: Doug Coleman Date: Tue, 21 Jun 2016 12:49:54 -0700 Subject: [PATCH] modern.out: name some conditionals. --- core/modern/out/out.factor | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/core/modern/out/out.factor b/core/modern/out/out.factor index 9f5ea32f81..bc71ae3d98 100644 --- a/core/modern/out/out.factor +++ b/core/modern/out/out.factor @@ -101,16 +101,21 @@ M: line-comment-literal write-literal } cleave ; +: adding-semi? ( obj -- ? ) + { [ seq>> 3 swap ?nth not ] [ closing-tag>> ] } 1&& ; + +: removing-semi? ( obj -- ? ) + { [ seq>> 3 swap ?nth ] [ closing-tag>> not ] } 1&& ; : nice-semi-needed? ( obj -- ? ) { - [ seq>> 3 swap ?nth not ] - [ closing-tag>> ] + [ { [ adding-semi? ] [ removing-semi? ] } 1|| ] [ payload>> [ line-comment-literal? ] last? ] } 1&& ; : write-uppercase-colon-literal-nice ( obj -- ) +B { [ seq>> 0 swap nth write-whitespace ] [ tag>> write ]