modern.out: name some conditionals.

locals-and-roots
Doug Coleman 2016-06-21 12:49:54 -07:00
parent 8d14e79f8b
commit 1e8d41ae65
1 changed files with 7 additions and 2 deletions

View File

@ -101,16 +101,21 @@ M: line-comment-literal write-literal
} cleave ; } 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 -- ? ) : nice-semi-needed? ( obj -- ? )
{ {
[ seq>> 3 swap ?nth not ] [ { [ adding-semi? ] [ removing-semi? ] } 1|| ]
[ closing-tag>> ]
[ payload>> [ line-comment-literal? ] last? ] [ payload>> [ line-comment-literal? ] last? ]
} 1&& ; } 1&& ;
: write-uppercase-colon-literal-nice ( obj -- ) : write-uppercase-colon-literal-nice ( obj -- )
B
{ {
[ seq>> 0 swap nth write-whitespace ] [ seq>> 0 swap nth write-whitespace ]
[ tag>> write ] [ tag>> write ]