Loading

Paste #pemgnti9i

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

Comments