]> gitweb.factorcode.org Git - factor.git/blobdiff - extra/annotations/annotations.factor
factor: trim using lists
[factor.git] / extra / annotations / annotations.factor
index b3eccad6a32d4d33c65ddd4b0912318811224871..2aa7174720a96767d7085edb9153e0bdf92eb1c3 100644 (file)
@@ -1,20 +1,19 @@
 ! (c)2009 Joe Groff, Doug Coleman. see BSD license
-USING: accessors combinators.short-circuit definitions functors
-kernel lexer namespaces parser prettyprint tools.crossref
-sequences words ;
+USING: accessors combinators.short-circuit functors kernel lexer
+namespaces sequences tools.crossref words ;
 IN: annotations
 
 <<
 
 : (parse-annotation) ( accum -- accum )
-    lexer get [ line-text>> parsed ] [ next-line ] bi ;
+    lexer get [ line-text>> suffix! ] [ next-line ] bi ;
 
 : (non-annotation-usage) ( word -- usages )
     smart-usage
     [ { [ word? ] [ vocabulary>> "annotations" = ] } 1&& not ]
     filter ;
 
-FUNCTOR: define-annotation ( NAME -- )
+<FUNCTOR: define-annotation ( NAME -- )
 
 (NAME) DEFINES (${NAME})
 !NAME  DEFINES !${NAME}
@@ -24,14 +23,14 @@ NAMEs. DEFINES ${NAME}s.
 WHERE
 
 : (NAME) ( str -- ) drop ; inline
-: !NAME (parse-annotation) \ (NAME) parsed ; parsing
+SYNTAX: !NAME (parse-annotation) \ (NAME) suffix! ;
 
 : NAMEs ( -- usages )
     \ (NAME) (non-annotation-usage) ;
 : NAMEs. ( -- )
     NAMEs sorted-definitions. ;
 
-;FUNCTOR
+;FUNCTOR>
 
 CONSTANT: annotation-tags {
     "XXX" "TODO" "FIXME" "BUG" "REVIEW" "LICENSE"
@@ -41,4 +40,3 @@ CONSTANT: annotation-tags {
 annotation-tags [ define-annotation ] each
 
 >>
-