! (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}
WHERE
: (NAME) ( str -- ) drop ; inline
-SYNTAX: !NAME (parse-annotation) \ (NAME) parsed ;
+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"
annotation-tags [ define-annotation ] each
>>
-