]> gitweb.factorcode.org Git - factor.git/blobdiff - basis/html/templates/fhtml/fhtml.factor
Delete empty unit tests files, remove 1- and 1+, reorder IN: lines in a lot of places...
[factor.git] / basis / html / templates / fhtml / fhtml.factor
index 6c5e78e917b7f75a0f30bb11238427595c9e800e..a98a21f177c2ca6ebdbaa4daf3e89a201220bec3 100644 (file)
@@ -4,7 +4,7 @@
 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
@@ -17,7 +17,7 @@ TUPLE: template-lexer < lexer ;
 M: template-lexer skip-word
     [
         {
-            { [ 2dup nth CHAR: " = ] [ drop 1+ ] }
+            { [ 2dup nth CHAR: " = ] [ drop 1 + ] }
             { [ 2dup swap tail-slice "%>" head? ] [ drop 2 + ] }
             [ f skip ]
         } cond
@@ -58,11 +58,13 @@ SYNTAX: %> lexer get parse-%> ;
 
 : 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( -- ) ;