Commits

Steven! Ragnarök committed f796a80

Make tweaks to grammar to keep it context free.

Comments (0)

Files changed (2)

 
 /* The parser takes an input array of tokens and builds an
  * Abstract Syntax Tree for the following Grammar
- * Start ::= Command | VarAssign
- * CommandSequence ::= Command [Arglist] | NegatedCommand | BackgroundCommand | BooleanCommand | PipedCommand
- * Command
+ *
+ * Start ::= CommandSequence | VarAssign
+ * CommandSequence ::= Command | NegatedCommand | BackgroundCommand | BooleanCommand | PipedCommand
+ * Command ::= Value [ Arglist ]
  * NegatedCommand ::= ! CommandSequence
  * BackgroundCommand ::= CommandSequence &
  * BooleanCommand ::= AndedCommand | OrredCommand
 ast_node *parse_negated_command() {
 	ast_node *negated_command;
 	strip_head();
-	negated_command = parse_command();
+	negated_command = parse_command_seq();
 	negated_command->type = NEGATED_COMMAND;
 	return negated_command;
 }