1 ! (c)2009 Joe Groff, Doug Coleman. see BSD license
2 USING: accessors combinators.short-circuit definitions functors
3 kernel lexer namespaces parser prettyprint sequences words ;
8 : (parse-annotation) ( accum -- accum )
9 lexer get [ line-text>> parsed ] [ next-line ] bi ;
11 : (non-annotation-usage) ( word -- usages )
13 [ { [ word? ] [ vocabulary>> "annotations" = ] } 1&& not ]
16 FUNCTOR: define-annotation ( NAME -- )
18 (NAME) DEFINES (${NAME})
19 !NAME DEFINES !${NAME}
20 NAMEs DEFINES ${NAME}s
21 NAMEs. DEFINES ${NAME}s.
25 : (NAME) ( str -- ) drop ; inline
26 : !NAME (parse-annotation) \ (NAME) parsed ; parsing
29 \ (NAME) (non-annotation-usage) ;
31 NAMEs sorted-definitions. ;
35 CONSTANT: annotation-tags {
36 "XXX" "TODO" "FIXME" "BUG" "REVIEW" "LICENSE"
37 "AUTHOR" "BROKEN" "HACK" "LOL" "NOTE"
40 annotation-tags [ define-annotation ] each