USING: io io.files io.streams.string io.encodings.utf8
-html.templates html.templates.fhtml kernel
+html.templates html.templates.fhtml kernel multiline
tools.test sequences parser splitting prettyprint ;
IN: html.templates.fhtml.tests
[
[ ] [ "<%\n%>" parse-template drop ] unit-test
] with-file-vocabs
+
+[
+ [ ] [
+ <"
+ <%
+ IN: html.templates.fhtml.tests
+ : test-word ( -- ) ;
+ %>
+ "> parse-template drop
+ ] unit-test
+] with-file-vocabs
USING: continuations sequences kernel namespaces debugger
combinators math quotations generic strings splitting accessors
assocs fry vocabs.parser parser parser.notes lexer io io.files
-io.streams.string io.encodings.utf8 html.templates ;
+io.streams.string io.encodings.utf8 html.templates compiler.units ;
IN: html.templates.fhtml
! We use a custom lexer so that %> ends a token even if not
: parse-template ( string -- quot )
[
+ [
"quiet" on
parser-notes off
"html.templates.fhtml" use-vocab
string-lines parse-template-lines
- ] with-file-vocabs ;
+ ] with-file-vocabs
+ ] with-compilation-unit ;
: eval-template ( string -- )
parse-template call( -- ) ;