Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Keep track of parameters by kind
Will be used for better help and possibly other things.
  • Loading branch information
promovicz committed Mar 18, 2014
1 parent f200e0f commit 37e02fe
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions command-interface/nodes.dylan
Expand Up @@ -170,6 +170,10 @@ define open class <command-command> (<command-symbol>)
init-keyword: handler:;
/* parameters (collected while building) */
slot command-parameters :: <list> = #();
/* all named parameters */
slot command-named-parameters :: <list> = #();
/* all simple parameters */
slot command-simple-parameters :: <list> = #();
end class;

define method node-accept (node :: <command-command>, parser :: <command-parser>, token :: <command-token>)
Expand All @@ -182,6 +186,12 @@ end method;
define method command-add-parameter (node :: <command-command>, parameter :: <command-parameter>)
=> ();
command-parameters(node) := add!(command-parameters(node), parameter);
select (parameter-kind(parameter))
#"named" =>
command-named-parameters(node) := add!(command-named-parameters(node), parameter);
#"simple" =>
command-simple-parameters(node) := add!(command-simple-parameters(node), parameter);
end;
end method;


Expand Down

0 comments on commit 37e02fe

Please sign in to comment.