@@ -3,19 +3,19 @@ synopsis: Utilities for constructing CLI node structures.
33author: Ingo Albrecht <prom@berlin.ccc.de>
44copyright: see accompanying file LICENSE
55
6- define method build-command (root :: <command- root>, name :: <sequence> ,
6+ define method build-command (root :: <root-node >, name :: <sequence> ,
77 #rest node-keys,
8- #key node-class :: <class> = <command-command >, #all-keys )
9- => (cmd :: <command- symbol>);
8+ #key node-class :: <class> = <command-node >, #all-keys )
9+ => (cmd :: <symbol-node >);
1010 local
11- method find-or-make-successor (node :: <command -node>,
11+ method find-or-make-successor (node :: <parse -node>,
1212 symbol :: <symbol> ,
1313 node-class :: <class> ,
1414 node-keys :: <sequence> )
1515 // find symbol in existing successors
1616 let found = #f ;
1717 for (s in node-successors(node), until: found)
18- if (instance? (s, <command- symbol>) & (node-symbol(s) == symbol))
18+ if (instance? (s, <symbol-node >) & (node-symbol(s) == symbol))
1919 found := s;
2020 end if ;
2121 end for ;
@@ -35,7 +35,7 @@ define method build-command (root :: <command-root>, name :: <sequence>,
3535 if (i == size (name) - 1 )
3636 values (node-class, node-keys);
3737 else
38- values (<command- symbol>, #[]);
38+ values (<symbol-node >, #[]);
3939 end ;
4040 // find or make the node
4141 cur := find-or-make-successor
@@ -45,24 +45,24 @@ define method build-command (root :: <command-root>, name :: <sequence>,
4545 cur;
4646end method ;
4747
48- define method build-command (root :: <command- root>, name :: <string> ,
48+ define method build-command (root :: <root-node >, name :: <string> ,
4949 #rest keys, #key , #all-keys )
50- => (cmd :: <command-symbol >);
50+ => (cmd :: <command-node >);
5151 apply (build-command, root, list (name), keys);
5252end method ;
5353
54- define method build-command (root :: <command- root>, name :: <symbol> ,
54+ define method build-command (root :: <root-node >, name :: <symbol> ,
5555 #rest keys, #key , #all-keys )
56- => (cmd :: <command-symbol >);
56+ => (cmd :: <command-node >);
5757 apply (build-command, root, list (name), keys);
5858end method ;
5959
6060
61- define function build-parameter (command :: <command-command >, name :: <symbol> ,
61+ define function build-parameter (command :: <command-node >, name :: <symbol> ,
6262 #rest keys,
6363 #key syntax :: <symbol> = # "named" ,
6464 #all-keys )
65- => (entry :: <command -node>);
65+ => (entry :: <parse -node>);
6666 select (syntax)
6767 # "flag" => apply (build-flag-parameter, command, name, keys);
6868 # "named" => apply (build-named-parameter, command, name, keys);
@@ -71,8 +71,9 @@ define function build-parameter (command :: <command-command>, name :: <symbol>,
7171 end ;
7272end ;
7373
74- define function build-flag-parameter (command :: <command-command>, name :: <symbol> ,
75- #rest keys, #key node-class :: <class> = <command-flag>, #all-keys )
74+ define function build-flag-parameter (command :: <command-node>, name :: <symbol> ,
75+ #rest keys, #key node-class :: <class> = <flag-node>, #all-keys )
76+ => (param :: <flag-node>);
7677 let param = apply (make , node-class,
7778 name:, name,
7879 symbol:, name,
@@ -85,9 +86,9 @@ define function build-flag-parameter (command :: <command-command>, name :: <sym
8586 param;
8687end function ;
8788
88- define function build-simple-parameter (command :: <command-command >, name :: <symbol> ,
89- #rest keys, #key node-class :: <class> = <command- string>, #all-keys )
90- => (entry :: <command -node>);
89+ define function build-simple-parameter (command :: <command-node >, name :: <symbol> ,
90+ #rest keys, #key node-class :: <class> = <string-parameter-node >, #all-keys )
91+ => (entry :: <parse -node>);
9192 let param = apply (make , node-class,
9293 name:, name,
9394 kind:, # "simple" ,
@@ -99,9 +100,9 @@ define function build-simple-parameter (command :: <command-command>, name :: <s
99100 param;
100101end function ;
101102
102- define method build-named-parameter (command :: <command-command >, names :: <sequence> ,
103- #rest keys, #key node-class :: <class> = <command- string>, #all-keys )
104- => (param :: <command -node>, symbols :: <sequence> );
103+ define method build-named-parameter (command :: <command-node >, names :: <sequence> ,
104+ #rest keys, #key node-class :: <class> = <string-parameter-node >, #all-keys )
105+ => (param :: <parameter -node>, symbols :: <sequence> );
105106 let param = apply (make , node-class,
106107 name:, element (names, 0 ),
107108 kind:, # "named" ,
@@ -110,7 +111,7 @@ define method build-named-parameter (command :: <command-command>, names :: <seq
110111 keys);
111112 let syms = #();
112113 for (name in names)
113- let sym = make (<command- symbol>,
114+ let sym = make (<symbol-node >,
114115 symbol: as (<symbol> , name),
115116 repeatable?: node-repeatable?(param),
116117 repeat-marker: param,
@@ -122,8 +123,8 @@ define method build-named-parameter (command :: <command-command>, names :: <seq
122123 values (param, syms);
123124end method ;
124125
125- define method build-named-parameter (command :: <command-command >, name :: <symbol> ,
126+ define method build-named-parameter (command :: <command-node >, name :: <symbol> ,
126127 #rest keys, #key , #all-keys )
127- => (param :: <command- parameter>, symbols :: <sequence> );
128+ => (param :: <parameter-node >, symbols :: <sequence> );
128129 apply (build-named-parameter, command, list (name), keys);
129130end method ;
0 commit comments