2009-02-11 19:35:08 -05:00
|
|
|
! (c)2009 Joe Groff, Doug Coleman. see BSD license
|
2017-12-02 09:06:38 -05:00
|
|
|
USING: accessors combinators.short-circuit kernel lexer
|
|
|
|
|
namespaces sequences tools.crossref words ;
|
2017-12-28 20:28:58 -05:00
|
|
|
FROM: functors2 => new-word \INLINE-FUNCTOR: ;
|
2009-02-11 19:35:08 -05:00
|
|
|
IN: annotations
|
|
|
|
|
|
|
|
|
|
<<
|
|
|
|
|
|
|
|
|
|
: (parse-annotation) ( accum -- accum )
|
2009-10-28 14:38:27 -04:00
|
|
|
lexer get [ line-text>> suffix! ] [ next-line ] bi ;
|
2009-02-11 19:35:08 -05:00
|
|
|
|
|
|
|
|
: (non-annotation-usage) ( word -- usages )
|
|
|
|
|
smart-usage
|
2009-02-11 19:58:42 -05:00
|
|
|
[ { [ word? ] [ vocabulary>> "annotations" = ] } 1&& not ]
|
2009-02-11 19:35:08 -05:00
|
|
|
filter ;
|
|
|
|
|
|
2017-12-28 22:15:31 -05:00
|
|
|
INLINE-FUNCTOR: annotation ( name: new-word -- ) [[
|
|
|
|
|
USING: annotations kernel sequences tools.crossref ;
|
2009-02-11 19:35:08 -05:00
|
|
|
|
2017-12-28 22:15:31 -05:00
|
|
|
: (${name}) ( str -- ) drop ; inline
|
2009-02-11 19:35:08 -05:00
|
|
|
|
2017-12-28 22:15:31 -05:00
|
|
|
SYNTAX: !${name} (parse-annotation) \ (${name}) suffix! ;
|
2009-02-11 19:35:08 -05:00
|
|
|
|
2017-12-28 22:15:31 -05:00
|
|
|
: ${name}s ( -- usages )
|
|
|
|
|
\ (${name}) (non-annotation-usage) ;
|
2009-02-11 19:35:08 -05:00
|
|
|
|
2017-12-28 22:15:31 -05:00
|
|
|
: ${name}s. ( -- )
|
|
|
|
|
${name}s sorted-definitions. ;
|
2017-12-02 09:06:38 -05:00
|
|
|
]]
|
2009-02-11 19:35:08 -05:00
|
|
|
|
2017-12-02 09:06:38 -05:00
|
|
|
SYNTAX: \ANNOTATIONS: ";" [ define-annotation ] each-token ;
|
2009-02-11 19:35:08 -05:00
|
|
|
>>
|
2017-12-02 09:06:38 -05:00
|
|
|
|
|
|
|
|
! SYMBOLS: XXX TODO FIXME BUG REVIEW LICENSE
|
|
|
|
|
! AUTHOR BROKEN HACK LOL NOTE ;
|
|
|
|
|
|
|
|
|
|
! CONSTANT: annotation-tags {
|
|
|
|
|
! XXX TODO FIXME BUG REVIEW LICENSE
|
|
|
|
|
! AUTHOR BROKEN HACK LOL NOTE
|
|
|
|
|
! }
|
|
|
|
|
|
|
|
|
|
ANNOTATIONS: XXX TODO FIXME BUG REVIEW LICENSE AUTHOR BROKEN HACK LOL NOTE ;
|