:: map-case ( string string-quot char-quot -- case )
string length <sbuf> :> out
string [
- dup special-case
+ [ special-case ]
[ string-quot call out push-all ]
- [ char-quot call out push ] ?if-old
+ [ char-quot call out push ] ?if
] each out "" like ; inline
: locale>lower ( string -- string' )
! These numbers come from UAX 29
: initial? ( ch -- ? )
- dup 0x1100 0x1159 ?between? [ ] [ 0x115F = ] ?if-old ; inline
+ [ 0x1100 0x1159 ?between? ] [ 0x115F = ] ?unless ; inline
: medial? ( ch -- ? ) 0x1160 0x11A2 ?between? ; inline
: final? ( ch -- ? ) 0x11A8 0x11F9 ?between? ; inline
] [ drop f ] if* ;
: interpret-name ( str -- name )
- dup prefixed-name [ ] [ <simple-name> ] ?if-old ;
+ [ prefixed-name ] [ <simple-name> ] ?unless ;
PRIVATE>
] [ parse-named-entity ] if ;
: parse-pe ( accum -- )
- take-; dup pe-table get at
- [ swap push-all ] [ no-entity ] ?if-old ;
+ take-;
+ [ pe-table get at ]
+ [ swap push-all ] [ no-entity ] ?if ;
:: (parse-char) ( quot: ( ch -- ? ) accum spot -- )
spot char>> :> char
keys union-all [ alpha? ] reject sort ;
: keyword-map-no-word-sep* ( keyword-map -- str )
- dup no-word-sep>> [ ] [
+ [ no-word-sep>> ] [
dup (keyword-map-no-word-sep) >>no-word-sep
keyword-map-no-word-sep*
- ] ?if-old ;
+ ] ?unless ;
INSTANCE: keyword-map assoc
GENERIC: handle-rule-end ( match-count rule -- )
: find-escape-rule ( -- rule )
- context get dup
- in-rule-set>> escape-rule>> [ ] [
+ context get
+ [ in-rule-set>> escape-rule>> ] [
parent>> in-rule-set>>
- dup [ escape-rule>> ] when
- ] ?if-old ;
+ [ escape-rule>> ] ?transmute
+ ] ?unless ;
: check-escape-rule ( rule -- ? )
escape-rule>> [ find-escape-rule ] unless*