2 USING: accessors arrays kernel lexer locals math namespaces parser
5 IN: easy-help.expand-markup
7 ! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
9 : scan-one-array ( string -- array rest )
11 lexer-factory get call
14 \ } parse-until >array
16 lexer get column>> tail
22 ! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
24 : contains-markup? ( string -- ? ) "{ $" swap subseq? ;
26 ! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
28 :: expand-markup ( LINE -- lines )
33 [let | N [ "{ $" LINE start ] |
37 LINE N 2 + tail scan-one-array dup " " head? [ 1 tail ] [ ] if