diff --git a/nml/parser.py b/nml/parser.py index 8d28382..7193262 100644 --- a/nml/parser.py +++ b/nml/parser.py @@ -441,8 +441,12 @@ class NMLParser(object): else: t[0] = t[1] + [switch.RandomChoice(t[2], t[4])] def p_produce(self, t): - 'produce : PRODUCE LPAREN expression_list RPAREN SEMICOLON' - t[0] = produce.Produce(t[3], t.lineno(1)) + '''produce : PRODUCE LPAREN ID COMMA expression COMMA expression COMMA expression COMMA expression COMMA expression RPAREN SEMICOLON + | PRODUCE LPAREN ID COMMA expression COMMA expression COMMA expression COMMA expression COMMA expression COMMA expression RPAREN SEMICOLON''' + if len(t) == 16: + t[0] = produce.Produce([t[3], t[5], t[7], t[9], t[11], t[13]], t.lineno(1)) + else: + t[0] = produce.Produce([t[3], t[5], t[7], t[9], t[11], t[13], t[15]], t.lineno(1)) def p_produce_cargo_list(self, t): '''produce_cargo_list : LBRACKET RBRACKET