1 ! (c)2009 Joe Groff, Doug Coleman. see BSD license
2 USING: accessors combinators.short-circuit definitions functors
3 kernel lexer namespaces parser prettyprint tools.crossref
9 : (parse-annotation) ( accum -- accum )
10 lexer get [ line-text>> parsed ] [ next-line ] bi ;
12 : (non-annotation-usage) ( word -- usages )
14 [ { [ word? ] [ vocabulary>> "annotations" = ] } 1&& not ]
17 FUNCTOR: define-annotation ( NAME -- )
19 (NAME) DEFINES (${NAME})
20 !NAME DEFINES !${NAME}
21 NAMEs DEFINES ${NAME}s
22 NAMEs. DEFINES ${NAME}s.
26 : (NAME) ( str -- ) drop ; inline
27 : !NAME (parse-annotation) \ (NAME) parsed ; parsing
30 \ (NAME) (non-annotation-usage) ;
32 NAMEs sorted-definitions. ;
36 CONSTANT: annotation-tags {
37 "XXX" "TODO" "FIXME" "BUG" "REVIEW" "LICENSE"
38 "AUTHOR" "BROKEN" "HACK" "LOL" "NOTE"
41 annotation-tags [ define-annotation ] each