factor/extra/multiline/multiline.factor

20 lines
535 B
Factor
Raw Normal View History

2007-12-11 01:39:32 -05:00
! Copyright (C) 2007 Daniel Ehrenberg
! See http://factorcode.org/license.txt for BSD license.
USING: namespaces parser kernel sequences words quotations ;
IN: multiline
: next-line-text ( -- str )
lexer get dup next-line line-text ;
: (parse-here) ( -- )
next-line-text dup ";" =
[ drop lexer get next-line ] [ % "\n" % (parse-here) ] if ;
: parse-here ( -- str )
2007-12-11 01:54:16 -05:00
[ (parse-here) ] "" make 1 head*
2007-12-11 01:39:32 -05:00
lexer get next-line ;
: STRING:
CREATE dup reset-generic
parse-here 1quotation define-compound ; parsing