]> gitweb.factorcode.org Git - factor.git/blob - basis/help/syntax/syntax.factor
help.syntax: allow HELP: to have optional stack effect.
[factor.git] / basis / help / syntax / syntax.factor
1 ! Copyright (C) 2005, 2009 Slava Pestov.
2 ! See http://factorcode.org/license.txt for BSD license.
3 USING: accessors arrays compiler.units definitions effects help
4 help.topics kernel namespaces parser sequences vocabs
5 vocabs.parser words ;
6 IN: help.syntax
7
8 SYNTAX: HELP:
9     scan-word bootstrap-word
10     [ >link save-location ]
11     [
12         [
13             \ ; parse-until
14             dup ?first effect? [ rest ] when >array
15         ] dip set-word-help
16     ] bi ;
17
18 SYNTAX: ARTICLE:
19     location [
20         \ ; parse-until >array [ first2 ] [ 2 tail ] bi <article>
21         over add-article >link
22     ] dip remember-definition ;
23
24 SYNTAX: ABOUT:
25     current-vocab scan-object >>help changed-definition ;