Commits

Ahmed Youssef  committed 5ce3823

args visitor fix

  • Participants
  • Parent commits 1297a66

Comments (0)

Files changed (4)

File pykid/parser.out

 Rule 0     S' -> program
 Rule 1     program -> stmtlist
 Rule 2     innerblock -> LBRACE stmtlist RBRACE
-Rule 3     innerblock -> LBRACE RBRACE
+Rule 3     innerblock -> <empty>
 Rule 4     stmtlist -> stmt stmtlist
 Rule 5     stmtlist -> <empty>
 Rule 6     stmt -> funcdef
 GT                   : 32
 ID                   : 18 19 20 38
 IF                   : 16 17
-LBRACE               : 2 3
+LBRACE               : 2
 LE                   : 35
 LPAREN               : 14 15 16 17 18 20 36
 LT                   : 33
 NE                   : 31
 NUMBER               : 40
 PLUS                 : 26
-RBRACE               : 2 3
+RBRACE               : 2
 RPAREN               : 14 15 16 17 18 20 36
 SEMICOLON            : 
 STRING               : 39
     (39) qexpr -> . STRING
     (40) qexpr -> . NUMBER
     (2) innerblock -> . LBRACE stmtlist RBRACE
-    (3) innerblock -> . LBRACE RBRACE
+    (3) innerblock -> .
 
   ! reduce/reduce conflict for RPAREN resolved using rule 25 (argslist -> .)
-    RPAREN          reduce using rule 25 (argslist -> .)
+  ! reduce/reduce conflict for COMMA resolved using rule 3 (innerblock -> .)
+  ! reduce/reduce conflict for RPAREN resolved using rule 3 (innerblock -> .)
     ID              shift and go to state 34
     LPAREN          shift and go to state 15
-    COMMA           reduce using rule 37 (qexpr -> .)
     PLUS            reduce using rule 37 (qexpr -> .)
     MINUS           reduce using rule 37 (qexpr -> .)
     TIMES           reduce using rule 37 (qexpr -> .)
     STRING          shift and go to state 9
     NUMBER          shift and go to state 3
     LBRACE          shift and go to state 54
-
+    COMMA           reduce using rule 3 (innerblock -> .)
+    RPAREN          reduce using rule 3 (innerblock -> .)
+
+  ! RPAREN          [ reduce using rule 25 (argslist -> .) ]
+  ! COMMA           [ reduce using rule 37 (qexpr -> .) ]
   ! RPAREN          [ reduce using rule 37 (qexpr -> .) ]
 
     innerblock                     shift and go to state 52
     (39) qexpr -> . STRING
     (40) qexpr -> . NUMBER
     (2) innerblock -> . LBRACE stmtlist RBRACE
-    (3) innerblock -> . LBRACE RBRACE
+    (3) innerblock -> .
 
   ! reduce/reduce conflict for RPAREN resolved using rule 25 (argslist -> .)
-    RPAREN          reduce using rule 25 (argslist -> .)
+  ! reduce/reduce conflict for COMMA resolved using rule 3 (innerblock -> .)
+  ! reduce/reduce conflict for RPAREN resolved using rule 3 (innerblock -> .)
     ID              shift and go to state 34
     LPAREN          shift and go to state 15
-    COMMA           reduce using rule 37 (qexpr -> .)
     PLUS            reduce using rule 37 (qexpr -> .)
     MINUS           reduce using rule 37 (qexpr -> .)
     TIMES           reduce using rule 37 (qexpr -> .)
     STRING          shift and go to state 9
     NUMBER          shift and go to state 3
     LBRACE          shift and go to state 54
-
+    COMMA           reduce using rule 3 (innerblock -> .)
+    RPAREN          reduce using rule 3 (innerblock -> .)
+
+  ! RPAREN          [ reduce using rule 25 (argslist -> .) ]
+  ! COMMA           [ reduce using rule 37 (qexpr -> .) ]
   ! RPAREN          [ reduce using rule 37 (qexpr -> .) ]
 
     innerblock                     shift and go to state 52
 state 54
 
     (2) innerblock -> LBRACE . stmtlist RBRACE
-    (3) innerblock -> LBRACE . RBRACE
     (4) stmtlist -> . stmt stmtlist
     (5) stmtlist -> .
     (6) stmt -> . funcdef
     (39) qexpr -> . STRING
     (40) qexpr -> . NUMBER
 
-  ! shift/reduce conflict for RBRACE resolved as shift
-  ! shift/reduce conflict for RBRACE resolved as shift
+  ! reduce/reduce conflict for RBRACE resolved using rule 5 (stmtlist -> .)
   ! shift/reduce conflict for ID resolved as shift
   ! shift/reduce conflict for WHILE resolved as shift
   ! shift/reduce conflict for FOREACH resolved as shift
   ! shift/reduce conflict for LPAREN resolved as shift
   ! reduce/reduce conflict for STRING resolved using rule 13 (stmt -> .)
   ! reduce/reduce conflict for NUMBER resolved using rule 13 (stmt -> .)
-  ! shift/reduce conflict for RBRACE resolved as shift
+  ! reduce/reduce conflict for RBRACE resolved using rule 5 (stmtlist -> .)
   ! shift/reduce conflict for STRING resolved as shift
   ! shift/reduce conflict for NUMBER resolved as shift
-    RBRACE          shift and go to state 64
+    RBRACE          reduce using rule 5 (stmtlist -> .)
     PLUS            reduce using rule 13 (stmt -> .)
     MINUS           reduce using rule 13 (stmt -> .)
     TIMES           reduce using rule 13 (stmt -> .)
     STRING          shift and go to state 9
     NUMBER          shift and go to state 3
 
-  ! RBRACE          [ reduce using rule 5 (stmtlist -> .) ]
   ! ID              [ reduce using rule 13 (stmt -> .) ]
   ! WHILE           [ reduce using rule 13 (stmt -> .) ]
   ! FOREACH         [ reduce using rule 13 (stmt -> .) ]
     (34) qexpr -> qexpr . GE qexpr
     (35) qexpr -> qexpr . LE qexpr
 
-    COMMA           shift and go to state 65
+    COMMA           shift and go to state 64
     RPAREN          reduce using rule 23 (argslist -> qexpr .)
     PLUS            shift and go to state 27
     MINUS           shift and go to state 29
     (34) qexpr -> qexpr . GE qexpr
     (35) qexpr -> qexpr . LE qexpr
 
-    RPAREN          shift and go to state 66
+    RPAREN          shift and go to state 65
     PLUS            shift and go to state 27
     MINUS           shift and go to state 29
     TIMES           shift and go to state 24
 
     (14) whilestmt -> WHILE LPAREN qexpr RPAREN . innerblock
     (2) innerblock -> . LBRACE stmtlist RBRACE
-    (3) innerblock -> . LBRACE RBRACE
+    (3) innerblock -> .
 
     LBRACE          shift and go to state 54
-
-    innerblock                     shift and go to state 67
+    ID              reduce using rule 3 (innerblock -> .)
+    WHILE           reduce using rule 3 (innerblock -> .)
+    FOREACH         reduce using rule 3 (innerblock -> .)
+    IF              reduce using rule 3 (innerblock -> .)
+    DEF             reduce using rule 3 (innerblock -> .)
+    LPAREN          reduce using rule 3 (innerblock -> .)
+    STRING          reduce using rule 3 (innerblock -> .)
+    NUMBER          reduce using rule 3 (innerblock -> .)
+    PLUS            reduce using rule 3 (innerblock -> .)
+    MINUS           reduce using rule 3 (innerblock -> .)
+    TIMES           reduce using rule 3 (innerblock -> .)
+    DIVIDE          reduce using rule 3 (innerblock -> .)
+    EQ              reduce using rule 3 (innerblock -> .)
+    NE              reduce using rule 3 (innerblock -> .)
+    GT              reduce using rule 3 (innerblock -> .)
+    LT              reduce using rule 3 (innerblock -> .)
+    GE              reduce using rule 3 (innerblock -> .)
+    LE              reduce using rule 3 (innerblock -> .)
+    $end            reduce using rule 3 (innerblock -> .)
+    RBRACE          reduce using rule 3 (innerblock -> .)
+
+    innerblock                     shift and go to state 66
 
 state 58
 
     STRING          shift and go to state 9
     NUMBER          shift and go to state 3
 
-    qexpr                          shift and go to state 68
+    qexpr                          shift and go to state 67
 
 state 60
 
     (20) qexpr -> ID LPAREN argslist . RPAREN
 
-    RPAREN          shift and go to state 69
+    RPAREN          shift and go to state 68
 
 
 state 61
     (39) qexpr -> . STRING
     (40) qexpr -> . NUMBER
     (2) innerblock -> . LBRACE stmtlist RBRACE
-    (3) innerblock -> . LBRACE RBRACE
+    (3) innerblock -> .
 
   ! reduce/reduce conflict for RPAREN resolved using rule 25 (argslist -> .)
-    RPAREN          reduce using rule 25 (argslist -> .)
+  ! reduce/reduce conflict for COMMA resolved using rule 3 (innerblock -> .)
+  ! reduce/reduce conflict for RPAREN resolved using rule 3 (innerblock -> .)
     ID              shift and go to state 34
     LPAREN          shift and go to state 15
-    COMMA           reduce using rule 37 (qexpr -> .)
     PLUS            reduce using rule 37 (qexpr -> .)
     MINUS           reduce using rule 37 (qexpr -> .)
     TIMES           reduce using rule 37 (qexpr -> .)
     STRING          shift and go to state 9
     NUMBER          shift and go to state 3
     LBRACE          shift and go to state 54
-
+    COMMA           reduce using rule 3 (innerblock -> .)
+    RPAREN          reduce using rule 3 (innerblock -> .)
+
+  ! RPAREN          [ reduce using rule 25 (argslist -> .) ]
+  ! COMMA           [ reduce using rule 37 (qexpr -> .) ]
   ! RPAREN          [ reduce using rule 37 (qexpr -> .) ]
 
     innerblock                     shift and go to state 52
-    argslist                       shift and go to state 70
+    argslist                       shift and go to state 69
     qexpr                          shift and go to state 55
 
 state 62
     (18) funcdef -> ID LPAREN argslist RPAREN . EQUALS FUNCTION innerblock
     (20) qexpr -> ID LPAREN argslist RPAREN .
 
-    EQUALS          shift and go to state 71
+    EQUALS          shift and go to state 70
     PLUS            reduce using rule 20 (qexpr -> ID LPAREN argslist RPAREN .)
     MINUS           reduce using rule 20 (qexpr -> ID LPAREN argslist RPAREN .)
     TIMES           reduce using rule 20 (qexpr -> ID LPAREN argslist RPAREN .)
 
     (2) innerblock -> LBRACE stmtlist . RBRACE
 
-    RBRACE          shift and go to state 72
+    RBRACE          shift and go to state 71
 
 
 state 64
 
-    (3) innerblock -> LBRACE RBRACE .
-
-    ID              reduce using rule 3 (innerblock -> LBRACE RBRACE .)
-    WHILE           reduce using rule 3 (innerblock -> LBRACE RBRACE .)
-    FOREACH         reduce using rule 3 (innerblock -> LBRACE RBRACE .)
-    IF              reduce using rule 3 (innerblock -> LBRACE RBRACE .)
-    DEF             reduce using rule 3 (innerblock -> LBRACE RBRACE .)
-    LPAREN          reduce using rule 3 (innerblock -> LBRACE RBRACE .)
-    STRING          reduce using rule 3 (innerblock -> LBRACE RBRACE .)
-    NUMBER          reduce using rule 3 (innerblock -> LBRACE RBRACE .)
-    PLUS            reduce using rule 3 (innerblock -> LBRACE RBRACE .)
-    MINUS           reduce using rule 3 (innerblock -> LBRACE RBRACE .)
-    TIMES           reduce using rule 3 (innerblock -> LBRACE RBRACE .)
-    DIVIDE          reduce using rule 3 (innerblock -> LBRACE RBRACE .)
-    EQ              reduce using rule 3 (innerblock -> LBRACE RBRACE .)
-    NE              reduce using rule 3 (innerblock -> LBRACE RBRACE .)
-    GT              reduce using rule 3 (innerblock -> LBRACE RBRACE .)
-    LT              reduce using rule 3 (innerblock -> LBRACE RBRACE .)
-    GE              reduce using rule 3 (innerblock -> LBRACE RBRACE .)
-    LE              reduce using rule 3 (innerblock -> LBRACE RBRACE .)
-    $end            reduce using rule 3 (innerblock -> LBRACE RBRACE .)
-    RBRACE          reduce using rule 3 (innerblock -> LBRACE RBRACE .)
-    ELSE            reduce using rule 3 (innerblock -> LBRACE RBRACE .)
-    COMMA           reduce using rule 3 (innerblock -> LBRACE RBRACE .)
-    RPAREN          reduce using rule 3 (innerblock -> LBRACE RBRACE .)
-
-
-state 65
-
     (21) argslist -> qexpr COMMA . argslist
     (21) argslist -> . qexpr COMMA argslist
     (22) argslist -> . innerblock COMMA argslist
     (39) qexpr -> . STRING
     (40) qexpr -> . NUMBER
     (2) innerblock -> . LBRACE stmtlist RBRACE
-    (3) innerblock -> . LBRACE RBRACE
+    (3) innerblock -> .
 
   ! reduce/reduce conflict for RPAREN resolved using rule 25 (argslist -> .)
-    RPAREN          reduce using rule 25 (argslist -> .)
+  ! reduce/reduce conflict for COMMA resolved using rule 3 (innerblock -> .)
+  ! reduce/reduce conflict for RPAREN resolved using rule 3 (innerblock -> .)
     ID              shift and go to state 34
     LPAREN          shift and go to state 15
-    COMMA           reduce using rule 37 (qexpr -> .)
     PLUS            reduce using rule 37 (qexpr -> .)
     MINUS           reduce using rule 37 (qexpr -> .)
     TIMES           reduce using rule 37 (qexpr -> .)
     STRING          shift and go to state 9
     NUMBER          shift and go to state 3
     LBRACE          shift and go to state 54
-
+    COMMA           reduce using rule 3 (innerblock -> .)
+    RPAREN          reduce using rule 3 (innerblock -> .)
+
+  ! RPAREN          [ reduce using rule 25 (argslist -> .) ]
+  ! COMMA           [ reduce using rule 37 (qexpr -> .) ]
   ! RPAREN          [ reduce using rule 37 (qexpr -> .) ]
 
     innerblock                     shift and go to state 52
-    argslist                       shift and go to state 73
+    argslist                       shift and go to state 72
     qexpr                          shift and go to state 55
 
-state 66
+state 65
 
     (16) ifelsestmt -> IF LPAREN qexpr RPAREN . innerblock ELSE innerblock
     (17) ifstmt -> IF LPAREN qexpr RPAREN . innerblock
     (2) innerblock -> . LBRACE stmtlist RBRACE
-    (3) innerblock -> . LBRACE RBRACE
+    (3) innerblock -> .
 
     LBRACE          shift and go to state 54
-
-    innerblock                     shift and go to state 74
-
-state 67
+    ELSE            reduce using rule 3 (innerblock -> .)
+    ID              reduce using rule 3 (innerblock -> .)
+    WHILE           reduce using rule 3 (innerblock -> .)
+    FOREACH         reduce using rule 3 (innerblock -> .)
+    IF              reduce using rule 3 (innerblock -> .)
+    DEF             reduce using rule 3 (innerblock -> .)
+    LPAREN          reduce using rule 3 (innerblock -> .)
+    STRING          reduce using rule 3 (innerblock -> .)
+    NUMBER          reduce using rule 3 (innerblock -> .)
+    PLUS            reduce using rule 3 (innerblock -> .)
+    MINUS           reduce using rule 3 (innerblock -> .)
+    TIMES           reduce using rule 3 (innerblock -> .)
+    DIVIDE          reduce using rule 3 (innerblock -> .)
+    EQ              reduce using rule 3 (innerblock -> .)
+    NE              reduce using rule 3 (innerblock -> .)
+    GT              reduce using rule 3 (innerblock -> .)
+    LT              reduce using rule 3 (innerblock -> .)
+    GE              reduce using rule 3 (innerblock -> .)
+    LE              reduce using rule 3 (innerblock -> .)
+    $end            reduce using rule 3 (innerblock -> .)
+    RBRACE          reduce using rule 3 (innerblock -> .)
+
+    innerblock                     shift and go to state 73
+
+state 66
 
     (14) whilestmt -> WHILE LPAREN qexpr RPAREN innerblock .
 
     RBRACE          reduce using rule 14 (whilestmt -> WHILE LPAREN qexpr RPAREN innerblock .)
 
 
-state 68
+state 67
 
     (15) foreachstmt -> FOREACH LPAREN qexpr COLON qexpr . RPAREN innerblock
     (26) qexpr -> qexpr . PLUS qexpr
     (34) qexpr -> qexpr . GE qexpr
     (35) qexpr -> qexpr . LE qexpr
 
-    RPAREN          shift and go to state 75
+    RPAREN          shift and go to state 74
     PLUS            shift and go to state 27
     MINUS           shift and go to state 29
     TIMES           shift and go to state 24
     LE              shift and go to state 26
 
 
-state 69
+state 68
 
     (20) qexpr -> ID LPAREN argslist RPAREN .
 
     COMMA           reduce using rule 20 (qexpr -> ID LPAREN argslist RPAREN .)
 
 
+state 69
+
+    (22) argslist -> innerblock COMMA argslist .
+
+    RPAREN          reduce using rule 22 (argslist -> innerblock COMMA argslist .)
+
+
 state 70
 
-    (22) argslist -> innerblock COMMA argslist .
-
-    RPAREN          reduce using rule 22 (argslist -> innerblock COMMA argslist .)
+    (18) funcdef -> ID LPAREN argslist RPAREN EQUALS . FUNCTION innerblock
+
+    FUNCTION        shift and go to state 75
 
 
 state 71
 
-    (18) funcdef -> ID LPAREN argslist RPAREN EQUALS . FUNCTION innerblock
-
-    FUNCTION        shift and go to state 76
-
-
-state 72
-
     (2) innerblock -> LBRACE stmtlist RBRACE .
 
     ID              reduce using rule 2 (innerblock -> LBRACE stmtlist RBRACE .)
     RPAREN          reduce using rule 2 (innerblock -> LBRACE stmtlist RBRACE .)
 
 
+state 72
+
+    (21) argslist -> qexpr COMMA argslist .
+
+    RPAREN          reduce using rule 21 (argslist -> qexpr COMMA argslist .)
+
+
 state 73
 
-    (21) argslist -> qexpr COMMA argslist .
-
-    RPAREN          reduce using rule 21 (argslist -> qexpr COMMA argslist .)
-
-
-state 74
-
     (16) ifelsestmt -> IF LPAREN qexpr RPAREN innerblock . ELSE innerblock
     (17) ifstmt -> IF LPAREN qexpr RPAREN innerblock .
 
-    ELSE            shift and go to state 77
+    ELSE            shift and go to state 76
     ID              reduce using rule 17 (ifstmt -> IF LPAREN qexpr RPAREN innerblock .)
     WHILE           reduce using rule 17 (ifstmt -> IF LPAREN qexpr RPAREN innerblock .)
     FOREACH         reduce using rule 17 (ifstmt -> IF LPAREN qexpr RPAREN innerblock .)
     RBRACE          reduce using rule 17 (ifstmt -> IF LPAREN qexpr RPAREN innerblock .)
 
 
-state 75
+state 74
 
     (15) foreachstmt -> FOREACH LPAREN qexpr COLON qexpr RPAREN . innerblock
     (2) innerblock -> . LBRACE stmtlist RBRACE
-    (3) innerblock -> . LBRACE RBRACE
+    (3) innerblock -> .
 
     LBRACE          shift and go to state 54
-
-    innerblock                     shift and go to state 78
-
-state 76
+    ID              reduce using rule 3 (innerblock -> .)
+    WHILE           reduce using rule 3 (innerblock -> .)
+    FOREACH         reduce using rule 3 (innerblock -> .)
+    IF              reduce using rule 3 (innerblock -> .)
+    DEF             reduce using rule 3 (innerblock -> .)
+    LPAREN          reduce using rule 3 (innerblock -> .)
+    STRING          reduce using rule 3 (innerblock -> .)
+    NUMBER          reduce using rule 3 (innerblock -> .)
+    PLUS            reduce using rule 3 (innerblock -> .)
+    MINUS           reduce using rule 3 (innerblock -> .)
+    TIMES           reduce using rule 3 (innerblock -> .)
+    DIVIDE          reduce using rule 3 (innerblock -> .)
+    EQ              reduce using rule 3 (innerblock -> .)
+    NE              reduce using rule 3 (innerblock -> .)
+    GT              reduce using rule 3 (innerblock -> .)
+    LT              reduce using rule 3 (innerblock -> .)
+    GE              reduce using rule 3 (innerblock -> .)
+    LE              reduce using rule 3 (innerblock -> .)
+    $end            reduce using rule 3 (innerblock -> .)
+    RBRACE          reduce using rule 3 (innerblock -> .)
+
+    innerblock                     shift and go to state 77
+
+state 75
 
     (18) funcdef -> ID LPAREN argslist RPAREN EQUALS FUNCTION . innerblock
     (2) innerblock -> . LBRACE stmtlist RBRACE
-    (3) innerblock -> . LBRACE RBRACE
+    (3) innerblock -> .
 
     LBRACE          shift and go to state 54
-
-    innerblock                     shift and go to state 79
-
-state 77
+    ID              reduce using rule 3 (innerblock -> .)
+    WHILE           reduce using rule 3 (innerblock -> .)
+    FOREACH         reduce using rule 3 (innerblock -> .)
+    IF              reduce using rule 3 (innerblock -> .)
+    DEF             reduce using rule 3 (innerblock -> .)
+    LPAREN          reduce using rule 3 (innerblock -> .)
+    STRING          reduce using rule 3 (innerblock -> .)
+    NUMBER          reduce using rule 3 (innerblock -> .)
+    PLUS            reduce using rule 3 (innerblock -> .)
+    MINUS           reduce using rule 3 (innerblock -> .)
+    TIMES           reduce using rule 3 (innerblock -> .)
+    DIVIDE          reduce using rule 3 (innerblock -> .)
+    EQ              reduce using rule 3 (innerblock -> .)
+    NE              reduce using rule 3 (innerblock -> .)
+    GT              reduce using rule 3 (innerblock -> .)
+    LT              reduce using rule 3 (innerblock -> .)
+    GE              reduce using rule 3 (innerblock -> .)
+    LE              reduce using rule 3 (innerblock -> .)
+    $end            reduce using rule 3 (innerblock -> .)
+    RBRACE          reduce using rule 3 (innerblock -> .)
+
+    innerblock                     shift and go to state 78
+
+state 76
 
     (16) ifelsestmt -> IF LPAREN qexpr RPAREN innerblock ELSE . innerblock
     (2) innerblock -> . LBRACE stmtlist RBRACE
-    (3) innerblock -> . LBRACE RBRACE
+    (3) innerblock -> .
 
     LBRACE          shift and go to state 54
-
-    innerblock                     shift and go to state 80
-
-state 78
+    ID              reduce using rule 3 (innerblock -> .)
+    WHILE           reduce using rule 3 (innerblock -> .)
+    FOREACH         reduce using rule 3 (innerblock -> .)
+    IF              reduce using rule 3 (innerblock -> .)
+    DEF             reduce using rule 3 (innerblock -> .)
+    LPAREN          reduce using rule 3 (innerblock -> .)
+    STRING          reduce using rule 3 (innerblock -> .)
+    NUMBER          reduce using rule 3 (innerblock -> .)
+    PLUS            reduce using rule 3 (innerblock -> .)
+    MINUS           reduce using rule 3 (innerblock -> .)
+    TIMES           reduce using rule 3 (innerblock -> .)
+    DIVIDE          reduce using rule 3 (innerblock -> .)
+    EQ              reduce using rule 3 (innerblock -> .)
+    NE              reduce using rule 3 (innerblock -> .)
+    GT              reduce using rule 3 (innerblock -> .)
+    LT              reduce using rule 3 (innerblock -> .)
+    GE              reduce using rule 3 (innerblock -> .)
+    LE              reduce using rule 3 (innerblock -> .)
+    $end            reduce using rule 3 (innerblock -> .)
+    RBRACE          reduce using rule 3 (innerblock -> .)
+
+    innerblock                     shift and go to state 79
+
+state 77
 
     (15) foreachstmt -> FOREACH LPAREN qexpr COLON qexpr RPAREN innerblock .
 
     RBRACE          reduce using rule 15 (foreachstmt -> FOREACH LPAREN qexpr COLON qexpr RPAREN innerblock .)
 
 
-state 79
+state 78
 
     (18) funcdef -> ID LPAREN argslist RPAREN EQUALS FUNCTION innerblock .
 
     RBRACE          reduce using rule 18 (funcdef -> ID LPAREN argslist RPAREN EQUALS FUNCTION innerblock .)
 
 
-state 80
+state 79
 
     (16) ifelsestmt -> IF LPAREN qexpr RPAREN innerblock ELSE innerblock .
 
 WARNING: shift/reduce conflict for LT in state 48 resolved as shift
 WARNING: shift/reduce conflict for GE in state 48 resolved as shift
 WARNING: shift/reduce conflict for LE in state 48 resolved as shift
-WARNING: shift/reduce conflict for RBRACE in state 54 resolved as shift
-WARNING: shift/reduce conflict for RBRACE in state 54 resolved as shift
 WARNING: shift/reduce conflict for ID in state 54 resolved as shift
 WARNING: shift/reduce conflict for WHILE in state 54 resolved as shift
 WARNING: shift/reduce conflict for FOREACH in state 54 resolved as shift
 WARNING: shift/reduce conflict for IF in state 54 resolved as shift
 WARNING: shift/reduce conflict for DEF in state 54 resolved as shift
 WARNING: shift/reduce conflict for LPAREN in state 54 resolved as shift
-WARNING: shift/reduce conflict for RBRACE in state 54 resolved as shift
 WARNING: shift/reduce conflict for STRING in state 54 resolved as shift
 WARNING: shift/reduce conflict for NUMBER in state 54 resolved as shift
 WARNING: shift/reduce conflict for PLUS in state 58 resolved as shift
 WARNING: rejected rule (qexpr -> <empty>) in state 13
 WARNING: reduce/reduce conflict in state 35 resolved using rule (argslist -> <empty>)
 WARNING: rejected rule (qexpr -> <empty>) in state 35
+WARNING: reduce/reduce conflict in state 35 resolved using rule (innerblock -> <empty>)
+WARNING: rejected rule (qexpr -> <empty>) in state 35
+WARNING: reduce/reduce conflict in state 35 resolved using rule (innerblock -> <empty>)
+WARNING: rejected rule (argslist -> <empty>) in state 35
 WARNING: reduce/reduce conflict in state 51 resolved using rule (argslist -> <empty>)
 WARNING: rejected rule (qexpr -> <empty>) in state 51
+WARNING: reduce/reduce conflict in state 51 resolved using rule (innerblock -> <empty>)
+WARNING: rejected rule (qexpr -> <empty>) in state 51
+WARNING: reduce/reduce conflict in state 51 resolved using rule (innerblock -> <empty>)
+WARNING: rejected rule (argslist -> <empty>) in state 51
+WARNING: reduce/reduce conflict in state 54 resolved using rule (stmtlist -> <empty>)
+WARNING: rejected rule (stmt -> <empty>) in state 54
 WARNING: reduce/reduce conflict in state 54 resolved using rule (stmt -> <empty>)
 WARNING: rejected rule (qexpr -> <empty>) in state 54
+WARNING: reduce/reduce conflict in state 54 resolved using rule (stmtlist -> <empty>)
+WARNING: rejected rule (qexpr -> <empty>) in state 54
 WARNING: reduce/reduce conflict in state 61 resolved using rule (argslist -> <empty>)
 WARNING: rejected rule (qexpr -> <empty>) in state 61
-WARNING: reduce/reduce conflict in state 65 resolved using rule (argslist -> <empty>)
-WARNING: rejected rule (qexpr -> <empty>) in state 65
+WARNING: reduce/reduce conflict in state 61 resolved using rule (innerblock -> <empty>)
+WARNING: rejected rule (qexpr -> <empty>) in state 61
+WARNING: reduce/reduce conflict in state 61 resolved using rule (innerblock -> <empty>)
+WARNING: rejected rule (argslist -> <empty>) in state 61
+WARNING: reduce/reduce conflict in state 64 resolved using rule (argslist -> <empty>)
+WARNING: rejected rule (qexpr -> <empty>) in state 64
+WARNING: reduce/reduce conflict in state 64 resolved using rule (innerblock -> <empty>)
+WARNING: rejected rule (qexpr -> <empty>) in state 64
+WARNING: reduce/reduce conflict in state 64 resolved using rule (innerblock -> <empty>)
+WARNING: rejected rule (argslist -> <empty>) in state 64
+WARNING: Rule (argslist -> <empty>) is never reduced

File pykid/parser.py

     print(1+2)
     def x=3
     def y=4
-    callme(3)
+	def xs='hello,world'
     sum(x,y)=function{ return(x+y) }
     foreach(x : xs){
         print('x', x)
     }
+    def j=sum(3,6)
+    print('j', j)
     
     if('name'=='ahmed'){
         print('welcome ahmed')

File pykid/parsetab.py

 
 _lr_method = 'LALR'
 
-_lr_signature = "\xbf\x97\xee\xf2\xdf~\xb5\x06\x99\xa5a:/\x81'\xf6"
+_lr_signature = "\xee)l\xcb\xcb\xc1\xdd\xd6\xd7sW'\xccS\x00X"
     
-_lr_action_items = {'DIVIDE':([0,1,2,3,4,7,9,10,12,13,15,16,17,19,21,22,23,24,25,26,27,28,29,30,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,54,55,56,58,59,61,62,64,65,67,68,69,72,74,78,79,80,],[-13,-9,-8,-40,-7,-10,-39,-11,23,-13,-37,-6,-38,-37,-37,-37,-37,-37,-37,-37,-37,-37,-37,-37,-37,23,-38,-37,-37,23,-37,23,23,-29,-28,23,23,23,23,23,23,23,-36,-37,-13,23,23,23,-37,-37,-20,-3,-37,-14,23,-20,-2,-17,-15,-18,-16,]),'NUMBER':([0,1,2,3,4,7,9,10,12,13,15,16,17,19,21,22,23,24,25,26,27,28,29,30,32,34,35,36,38,39,40,41,42,43,44,45,46,47,48,50,51,54,58,59,61,62,64,65,67,69,72,74,78,79,80,],[3,-9,-8,-40,-7,-10,-39,-11,-12,3,3,-6,-38,3,3,3,3,3,3,3,3,3,3,3,3,-38,3,3,3,-32,-34,-29,-28,-33,-35,-26,-30,-27,-31,-36,3,3,-19,3,3,-20,-3,3,-14,-20,-2,-17,-15,-18,-16,]),'WHILE':([0,1,2,3,4,7,9,10,12,13,16,17,21,22,23,24,25,26,27,28,29,30,34,38,39,40,41,42,43,44,45,46,47,48,50,54,58,62,64,67,69,72,74,78,79,80,],[5,-9,-8,-40,-7,-10,-39,-11,-12,5,-6,-38,-37,-37,-37,-37,-37,-37,-37,-37,-37,-37,-38,-37,-32,-34,-29,-28,-33,-35,-26,-30,-27,-31,-36,5,-19,-20,-3,-14,-20,-2,-17,-15,-18,-16,]),'MINUS':([0,1,2,3,4,7,9,10,12,13,15,16,17,19,21,22,23,24,25,26,27,28,29,30,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,54,55,56,58,59,61,62,64,65,67,68,69,72,74,78,79,80,],[-13,-9,-8,-40,-7,-10,-39,-11,29,-13,-37,-6,-38,-37,-37,-37,-37,-37,-37,-37,-37,-37,-37,-37,-37,29,-38,-37,-37,29,-37,29,29,-29,-28,29,29,-26,29,-27,29,29,-36,-37,-13,29,29,29,-37,-37,-20,-3,-37,-14,29,-20,-2,-17,-15,-18,-16,]),'DEF':([0,1,2,3,4,7,9,10,12,13,16,17,21,22,23,24,25,26,27,28,29,30,34,38,39,40,41,42,43,44,45,46,47,48,50,54,58,62,64,67,69,72,74,78,79,80,],[8,-9,-8,-40,-7,-10,-39,-11,-12,8,-6,-38,-37,-37,-37,-37,-37,-37,-37,-37,-37,-37,-38,-37,-32,-34,-29,-28,-33,-35,-26,-30,-27,-31,-36,8,-19,-20,-3,-14,-20,-2,-17,-15,-18,-16,]),'RBRACE':([1,2,3,4,7,9,10,12,13,16,17,21,22,23,24,25,26,27,28,29,30,31,34,38,39,40,41,42,43,44,45,46,47,48,50,54,58,62,63,64,67,69,72,74,78,79,80,],[-9,-8,-40,-7,-10,-39,-11,-12,-5,-6,-38,-37,-37,-37,-37,-37,-37,-37,-37,-37,-37,-4,-38,-37,-32,-34,-29,-28,-33,-35,-26,-30,-27,-31,-36,64,-19,-20,72,-3,-14,-20,-2,-17,-15,-18,-16,]),'LE':([0,1,2,3,4,7,9,10,12,13,15,16,17,19,21,22,23,24,25,26,27,28,29,30,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,54,55,56,58,59,61,62,64,65,67,68,69,72,74,78,79,80,],[-13,-9,-8,-40,-7,-10,-39,-11,26,-13,-37,-6,-38,-37,-37,-37,-37,-37,-37,-37,-37,-37,-37,-37,-37,26,-38,-37,-37,26,-37,26,26,-29,-28,26,26,-26,26,-27,26,26,-36,-37,-13,26,26,26,-37,-37,-20,-3,-37,-14,26,-20,-2,-17,-15,-18,-16,]),'RPAREN':([3,9,15,19,21,22,23,24,25,26,27,28,29,30,33,34,35,36,37,39,40,41,42,43,44,45,46,47,48,50,51,52,53,55,56,59,60,61,64,65,68,69,70,72,73,],[-40,-39,-37,-37,-37,-37,-37,-37,-37,-37,-37,-37,-37,-37,50,-38,-25,-37,57,-32,-34,-29,-28,-33,-35,-26,-30,-27,-31,-36,-25,-24,62,-23,66,-37,69,-25,-3,-25,75,-20,-22,-2,-21,]),'NE':([0,1,2,3,4,7,9,10,12,13,15,16,17,19,21,22,23,24,25,26,27,28,29,30,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,54,55,56,58,59,61,62,64,65,67,68,69,72,74,78,79,80,],[-13,-9,-8,-40,-7,-10,-39,-11,30,-13,-37,-6,-38,-37,-37,-37,-37,-37,-37,-37,-37,-37,-37,-37,-37,30,-38,-37,-37,30,-37,30,30,-29,-28,30,30,-26,30,-27,30,30,-36,-37,-13,30,30,30,-37,-37,-20,-3,-37,-14,30,-20,-2,-17,-15,-18,-16,]),'LT':([0,1,2,3,4,7,9,10,12,13,15,16,17,19,21,22,23,24,25,26,27,28,29,30,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,54,55,56,58,59,61,62,64,65,67,68,69,72,74,78,79,80,],[-13,-9,-8,-40,-7,-10,-39,-11,25,-13,-37,-6,-38,-37,-37,-37,-37,-37,-37,-37,-37,-37,-37,-37,-37,25,-38,-37,-37,25,-37,25,25,-29,-28,25,25,-26,25,-27,25,25,-36,-37,-13,25,25,25,-37,-37,-20,-3,-37,-14,25,-20,-2,-17,-15,-18,-16,]),'PLUS':([0,1,2,3,4,7,9,10,12,13,15,16,17,19,21,22,23,24,25,26,27,28,29,30,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,54,55,56,58,59,61,62,64,65,67,68,69,72,74,78,79,80,],[-13,-9,-8,-40,-7,-10,-39,-11,27,-13,-37,-6,-38,-37,-37,-37,-37,-37,-37,-37,-37,-37,-37,-37,-37,27,-38,-37,-37,27,-37,27,27,-29,-28,27,27,-26,27,-27,27,27,-36,-37,-13,27,27,27,-37,-37,-20,-3,-37,-14,27,-20,-2,-17,-15,-18,-16,]),'COLON':([3,9,21,22,23,24,25,26,27,28,29,30,32,34,39,40,41,42,43,44,45,46,47,48,49,50,69,],[-40,-39,-37,-37,-37,-37,-37,-37,-37,-37,-37,-37,-37,-38,-32,-34,-29,-28,-33,-35,-26,-30,-27,-31,59,-36,-20,]),'$end':([0,1,2,3,4,6,7,9,10,11,12,13,16,17,21,22,23,24,25,26,27,28,29,30,31,34,38,39,40,41,42,43,44,45,46,47,48,50,58,62,64,67,69,72,74,78,79,80,],[-5,-9,-8,-40,-7,-1,-10,-39,-11,0,-12,-5,-6,-38,-37,-37,-37,-37,-37,-37,-37,-37,-37,-37,-4,-38,-37,-32,-34,-29,-28,-33,-35,-26,-30,-27,-31,-36,-19,-20,-3,-14,-20,-2,-17,-15,-18,-16,]),'FUNCTION':([71,],[76,]),'GT':([0,1,2,3,4,7,9,10,12,13,15,16,17,19,21,22,23,24,25,26,27,28,29,30,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,54,55,56,58,59,61,62,64,65,67,68,69,72,74,78,79,80,],[-13,-9,-8,-40,-7,-10,-39,-11,21,-13,-37,-6,-38,-37,-37,-37,-37,-37,-37,-37,-37,-37,-37,-37,-37,21,-38,-37,-37,21,-37,21,21,-29,-28,21,21,-26,21,-27,21,21,-36,-37,-13,21,21,21,-37,-37,-20,-3,-37,-14,21,-20,-2,-17,-15,-18,-16,]),'STRING':([0,1,2,3,4,7,9,10,12,13,15,16,17,19,21,22,23,24,25,26,27,28,29,30,32,34,35,36,38,39,40,41,42,43,44,45,46,47,48,50,51,54,58,59,61,62,64,65,67,69,72,74,78,79,80,],[9,-9,-8,-40,-7,-10,-39,-11,-12,9,9,-6,-38,9,9,9,9,9,9,9,9,9,9,9,9,-38,9,9,9,-32,-34,-29,-28,-33,-35,-26,-30,-27,-31,-36,9,9,-19,9,9,-20,-3,9,-14,-20,-2,-17,-15,-18,-16,]),'EQUALS':([20,62,],[38,71,]),'TIMES':([0,1,2,3,4,7,9,10,12,13,15,16,17,19,21,22,23,24,25,26,27,28,29,30,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,54,55,56,58,59,61,62,64,65,67,68,69,72,74,78,79,80,],[-13,-9,-8,-40,-7,-10,-39,-11,24,-13,-37,-6,-38,-37,-37,-37,-37,-37,-37,-37,-37,-37,-37,-37,-37,24,-38,-37,-37,24,-37,24,24,-29,-28,24,24,24,24,24,24,24,-36,-37,-13,24,24,24,-37,-37,-20,-3,-37,-14,24,-20,-2,-17,-15,-18,-16,]),'GE':([0,1,2,3,4,7,9,10,12,13,15,16,17,19,21,22,23,24,25,26,27,28,29,30,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,54,55,56,58,59,61,62,64,65,67,68,69,72,74,78,79,80,],[-13,-9,-8,-40,-7,-10,-39,-11,22,-13,-37,-6,-38,-37,-37,-37,-37,-37,-37,-37,-37,-37,-37,-37,-37,22,-38,-37,-37,22,-37,22,22,-29,-28,22,22,-26,22,-27,22,22,-36,-37,-13,22,22,22,-37,-37,-20,-3,-37,-14,22,-20,-2,-17,-15,-18,-16,]),'FOREACH':([0,1,2,3,4,7,9,10,12,13,16,17,21,22,23,24,25,26,27,28,29,30,34,38,39,40,41,42,43,44,45,46,47,48,50,54,58,62,64,67,69,72,74,78,79,80,],[14,-9,-8,-40,-7,-10,-39,-11,-12,14,-6,-38,-37,-37,-37,-37,-37,-37,-37,-37,-37,-37,-38,-37,-32,-34,-29,-28,-33,-35,-26,-30,-27,-31,-36,14,-19,-20,-3,-14,-20,-2,-17,-15,-18,-16,]),'LPAREN':([0,1,2,3,4,5,7,9,10,12,13,14,15,16,17,18,19,21,22,23,24,25,26,27,28,29,30,32,34,35,36,38,39,40,41,42,43,44,45,46,47,48,50,51,54,58,59,61,62,64,65,67,69,72,74,78,79,80,],[15,-9,-8,-40,-7,19,-10,-39,-11,-12,15,32,15,-6,35,36,15,15,15,15,15,15,15,15,15,15,15,15,51,15,15,15,-32,-34,-29,-28,-33,-35,-26,-30,-27,-31,-36,15,15,-19,15,15,-20,-3,15,-14,-20,-2,-17,-15,-18,-16,]),'ELSE':([64,72,74,],[-3,-2,77,]),'EQ':([0,1,2,3,4,7,9,10,12,13,15,16,17,19,21,22,23,24,25,26,27,28,29,30,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,54,55,56,58,59,61,62,64,65,67,68,69,72,74,78,79,80,],[-13,-9,-8,-40,-7,-10,-39,-11,28,-13,-37,-6,-38,-37,-37,-37,-37,-37,-37,-37,-37,-37,-37,-37,-37,28,-38,-37,-37,28,-37,28,28,-29,-28,28,28,-26,28,-27,28,28,-36,-37,-13,28,28,28,-37,-37,-20,-3,-37,-14,28,-20,-2,-17,-15,-18,-16,]),'ID':([0,1,2,3,4,7,8,9,10,12,13,15,16,17,19,21,22,23,24,25,26,27,28,29,30,32,34,35,36,38,39,40,41,42,43,44,45,46,47,48,50,51,54,58,59,61,62,64,65,67,69,72,74,78,79,80,],[17,-9,-8,-40,-7,-10,20,-39,-11,-12,17,34,-6,-38,34,34,34,34,34,34,34,34,34,34,34,34,-38,34,34,34,-32,-34,-29,-28,-33,-35,-26,-30,-27,-31,-36,34,17,-19,34,34,-20,-3,34,-14,-20,-2,-17,-15,-18,-16,]),'IF':([0,1,2,3,4,7,9,10,12,13,16,17,21,22,23,24,25,26,27,28,29,30,34,38,39,40,41,42,43,44,45,46,47,48,50,54,58,62,64,67,69,72,74,78,79,80,],[18,-9,-8,-40,-7,-10,-39,-11,-12,18,-6,-38,-37,-37,-37,-37,-37,-37,-37,-37,-37,-37,-38,-37,-32,-34,-29,-28,-33,-35,-26,-30,-27,-31,-36,18,-19,-20,-3,-14,-20,-2,-17,-15,-18,-16,]),'LBRACE':([35,51,57,61,65,66,75,76,77,],[54,54,54,54,54,54,54,54,54,]),'COMMA':([3,9,21,22,23,24,25,26,27,28,29,30,34,35,39,40,41,42,43,44,45,46,47,48,50,51,52,55,61,64,65,69,72,],[-40,-39,-37,-37,-37,-37,-37,-37,-37,-37,-37,-37,-38,-37,-32,-34,-29,-28,-33,-35,-26,-30,-27,-31,-36,-37,61,65,-37,-3,-37,-20,-2,]),}
+_lr_action_items = {'DIVIDE':([0,1,2,3,4,7,9,10,12,13,15,16,17,19,21,22,23,24,25,26,27,28,29,30,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,54,55,56,57,58,59,61,62,64,65,66,67,68,71,73,74,75,76,77,78,79,],[-13,-9,-8,-40,-7,-10,-39,-11,23,-13,-37,-6,-38,-37,-37,-37,-37,-37,-37,-37,-37,-37,-37,-37,-37,23,-38,-37,-37,23,-37,23,23,-29,-28,23,23,23,23,23,23,23,-36,-37,-13,23,23,-3,23,-37,-37,-20,-37,-3,-14,23,-20,-2,-17,-3,-3,-3,-15,-18,-16,]),'NUMBER':([0,1,2,3,4,7,9,10,12,13,15,16,17,19,21,22,23,24,25,26,27,28,29,30,32,34,35,36,38,39,40,41,42,43,44,45,46,47,48,50,51,54,57,58,59,61,62,64,65,66,68,71,73,74,75,76,77,78,79,],[3,-9,-8,-40,-7,-10,-39,-11,-12,3,3,-6,-38,3,3,3,3,3,3,3,3,3,3,3,3,-38,3,3,3,-32,-34,-29,-28,-33,-35,-26,-30,-27,-31,-36,3,3,-3,-19,3,3,-20,3,-3,-14,-20,-2,-17,-3,-3,-3,-15,-18,-16,]),'WHILE':([0,1,2,3,4,7,9,10,12,13,16,17,21,22,23,24,25,26,27,28,29,30,34,38,39,40,41,42,43,44,45,46,47,48,50,54,57,58,62,65,66,68,71,73,74,75,76,77,78,79,],[5,-9,-8,-40,-7,-10,-39,-11,-12,5,-6,-38,-37,-37,-37,-37,-37,-37,-37,-37,-37,-37,-38,-37,-32,-34,-29,-28,-33,-35,-26,-30,-27,-31,-36,5,-3,-19,-20,-3,-14,-20,-2,-17,-3,-3,-3,-15,-18,-16,]),'MINUS':([0,1,2,3,4,7,9,10,12,13,15,16,17,19,21,22,23,24,25,26,27,28,29,30,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,54,55,56,57,58,59,61,62,64,65,66,67,68,71,73,74,75,76,77,78,79,],[-13,-9,-8,-40,-7,-10,-39,-11,29,-13,-37,-6,-38,-37,-37,-37,-37,-37,-37,-37,-37,-37,-37,-37,-37,29,-38,-37,-37,29,-37,29,29,-29,-28,29,29,-26,29,-27,29,29,-36,-37,-13,29,29,-3,29,-37,-37,-20,-37,-3,-14,29,-20,-2,-17,-3,-3,-3,-15,-18,-16,]),'DEF':([0,1,2,3,4,7,9,10,12,13,16,17,21,22,23,24,25,26,27,28,29,30,34,38,39,40,41,42,43,44,45,46,47,48,50,54,57,58,62,65,66,68,71,73,74,75,76,77,78,79,],[8,-9,-8,-40,-7,-10,-39,-11,-12,8,-6,-38,-37,-37,-37,-37,-37,-37,-37,-37,-37,-37,-38,-37,-32,-34,-29,-28,-33,-35,-26,-30,-27,-31,-36,8,-3,-19,-20,-3,-14,-20,-2,-17,-3,-3,-3,-15,-18,-16,]),'RBRACE':([1,2,3,4,7,9,10,12,13,16,17,21,22,23,24,25,26,27,28,29,30,31,34,38,39,40,41,42,43,44,45,46,47,48,50,54,57,58,62,63,65,66,68,71,73,74,75,76,77,78,79,],[-9,-8,-40,-7,-10,-39,-11,-12,-5,-6,-38,-37,-37,-37,-37,-37,-37,-37,-37,-37,-37,-4,-38,-37,-32,-34,-29,-28,-33,-35,-26,-30,-27,-31,-36,-5,-3,-19,-20,71,-3,-14,-20,-2,-17,-3,-3,-3,-15,-18,-16,]),'LE':([0,1,2,3,4,7,9,10,12,13,15,16,17,19,21,22,23,24,25,26,27,28,29,30,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,54,55,56,57,58,59,61,62,64,65,66,67,68,71,73,74,75,76,77,78,79,],[-13,-9,-8,-40,-7,-10,-39,-11,26,-13,-37,-6,-38,-37,-37,-37,-37,-37,-37,-37,-37,-37,-37,-37,-37,26,-38,-37,-37,26,-37,26,26,-29,-28,26,26,-26,26,-27,26,26,-36,-37,-13,26,26,-3,26,-37,-37,-20,-37,-3,-14,26,-20,-2,-17,-3,-3,-3,-15,-18,-16,]),'RPAREN':([3,9,15,19,21,22,23,24,25,26,27,28,29,30,33,34,35,36,37,39,40,41,42,43,44,45,46,47,48,50,51,52,53,55,56,59,60,61,64,67,68,69,71,72,],[-40,-39,-37,-37,-37,-37,-37,-37,-37,-37,-37,-37,-37,-37,50,-38,-3,-37,57,-32,-34,-29,-28,-33,-35,-26,-30,-27,-31,-36,-3,-24,62,-23,65,-37,68,-3,-3,74,-20,-22,-2,-21,]),'NE':([0,1,2,3,4,7,9,10,12,13,15,16,17,19,21,22,23,24,25,26,27,28,29,30,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,54,55,56,57,58,59,61,62,64,65,66,67,68,71,73,74,75,76,77,78,79,],[-13,-9,-8,-40,-7,-10,-39,-11,30,-13,-37,-6,-38,-37,-37,-37,-37,-37,-37,-37,-37,-37,-37,-37,-37,30,-38,-37,-37,30,-37,30,30,-29,-28,30,30,-26,30,-27,30,30,-36,-37,-13,30,30,-3,30,-37,-37,-20,-37,-3,-14,30,-20,-2,-17,-3,-3,-3,-15,-18,-16,]),'LT':([0,1,2,3,4,7,9,10,12,13,15,16,17,19,21,22,23,24,25,26,27,28,29,30,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,54,55,56,57,58,59,61,62,64,65,66,67,68,71,73,74,75,76,77,78,79,],[-13,-9,-8,-40,-7,-10,-39,-11,25,-13,-37,-6,-38,-37,-37,-37,-37,-37,-37,-37,-37,-37,-37,-37,-37,25,-38,-37,-37,25,-37,25,25,-29,-28,25,25,-26,25,-27,25,25,-36,-37,-13,25,25,-3,25,-37,-37,-20,-37,-3,-14,25,-20,-2,-17,-3,-3,-3,-15,-18,-16,]),'PLUS':([0,1,2,3,4,7,9,10,12,13,15,16,17,19,21,22,23,24,25,26,27,28,29,30,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,54,55,56,57,58,59,61,62,64,65,66,67,68,71,73,74,75,76,77,78,79,],[-13,-9,-8,-40,-7,-10,-39,-11,27,-13,-37,-6,-38,-37,-37,-37,-37,-37,-37,-37,-37,-37,-37,-37,-37,27,-38,-37,-37,27,-37,27,27,-29,-28,27,27,-26,27,-27,27,27,-36,-37,-13,27,27,-3,27,-37,-37,-20,-37,-3,-14,27,-20,-2,-17,-3,-3,-3,-15,-18,-16,]),'COLON':([3,9,21,22,23,24,25,26,27,28,29,30,32,34,39,40,41,42,43,44,45,46,47,48,49,50,68,],[-40,-39,-37,-37,-37,-37,-37,-37,-37,-37,-37,-37,-37,-38,-32,-34,-29,-28,-33,-35,-26,-30,-27,-31,59,-36,-20,]),'$end':([0,1,2,3,4,6,7,9,10,11,12,13,16,17,21,22,23,24,25,26,27,28,29,30,31,34,38,39,40,41,42,43,44,45,46,47,48,50,57,58,62,65,66,68,71,73,74,75,76,77,78,79,],[-5,-9,-8,-40,-7,-1,-10,-39,-11,0,-12,-5,-6,-38,-37,-37,-37,-37,-37,-37,-37,-37,-37,-37,-4,-38,-37,-32,-34,-29,-28,-33,-35,-26,-30,-27,-31,-36,-3,-19,-20,-3,-14,-20,-2,-17,-3,-3,-3,-15,-18,-16,]),'FUNCTION':([70,],[75,]),'GT':([0,1,2,3,4,7,9,10,12,13,15,16,17,19,21,22,23,24,25,26,27,28,29,30,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,54,55,56,57,58,59,61,62,64,65,66,67,68,71,73,74,75,76,77,78,79,],[-13,-9,-8,-40,-7,-10,-39,-11,21,-13,-37,-6,-38,-37,-37,-37,-37,-37,-37,-37,-37,-37,-37,-37,-37,21,-38,-37,-37,21,-37,21,21,-29,-28,21,21,-26,21,-27,21,21,-36,-37,-13,21,21,-3,21,-37,-37,-20,-37,-3,-14,21,-20,-2,-17,-3,-3,-3,-15,-18,-16,]),'STRING':([0,1,2,3,4,7,9,10,12,13,15,16,17,19,21,22,23,24,25,26,27,28,29,30,32,34,35,36,38,39,40,41,42,43,44,45,46,47,48,50,51,54,57,58,59,61,62,64,65,66,68,71,73,74,75,76,77,78,79,],[9,-9,-8,-40,-7,-10,-39,-11,-12,9,9,-6,-38,9,9,9,9,9,9,9,9,9,9,9,9,-38,9,9,9,-32,-34,-29,-28,-33,-35,-26,-30,-27,-31,-36,9,9,-3,-19,9,9,-20,9,-3,-14,-20,-2,-17,-3,-3,-3,-15,-18,-16,]),'EQUALS':([20,62,],[38,70,]),'TIMES':([0,1,2,3,4,7,9,10,12,13,15,16,17,19,21,22,23,24,25,26,27,28,29,30,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,54,55,56,57,58,59,61,62,64,65,66,67,68,71,73,74,75,76,77,78,79,],[-13,-9,-8,-40,-7,-10,-39,-11,24,-13,-37,-6,-38,-37,-37,-37,-37,-37,-37,-37,-37,-37,-37,-37,-37,24,-38,-37,-37,24,-37,24,24,-29,-28,24,24,24,24,24,24,24,-36,-37,-13,24,24,-3,24,-37,-37,-20,-37,-3,-14,24,-20,-2,-17,-3,-3,-3,-15,-18,-16,]),'GE':([0,1,2,3,4,7,9,10,12,13,15,16,17,19,21,22,23,24,25,26,27,28,29,30,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,54,55,56,57,58,59,61,62,64,65,66,67,68,71,73,74,75,76,77,78,79,],[-13,-9,-8,-40,-7,-10,-39,-11,22,-13,-37,-6,-38,-37,-37,-37,-37,-37,-37,-37,-37,-37,-37,-37,-37,22,-38,-37,-37,22,-37,22,22,-29,-28,22,22,-26,22,-27,22,22,-36,-37,-13,22,22,-3,22,-37,-37,-20,-37,-3,-14,22,-20,-2,-17,-3,-3,-3,-15,-18,-16,]),'FOREACH':([0,1,2,3,4,7,9,10,12,13,16,17,21,22,23,24,25,26,27,28,29,30,34,38,39,40,41,42,43,44,45,46,47,48,50,54,57,58,62,65,66,68,71,73,74,75,76,77,78,79,],[14,-9,-8,-40,-7,-10,-39,-11,-12,14,-6,-38,-37,-37,-37,-37,-37,-37,-37,-37,-37,-37,-38,-37,-32,-34,-29,-28,-33,-35,-26,-30,-27,-31,-36,14,-3,-19,-20,-3,-14,-20,-2,-17,-3,-3,-3,-15,-18,-16,]),'LPAREN':([0,1,2,3,4,5,7,9,10,12,13,14,15,16,17,18,19,21,22,23,24,25,26,27,28,29,30,32,34,35,36,38,39,40,41,42,43,44,45,46,47,48,50,51,54,57,58,59,61,62,64,65,66,68,71,73,74,75,76,77,78,79,],[15,-9,-8,-40,-7,19,-10,-39,-11,-12,15,32,15,-6,35,36,15,15,15,15,15,15,15,15,15,15,15,15,51,15,15,15,-32,-34,-29,-28,-33,-35,-26,-30,-27,-31,-36,15,15,-3,-19,15,15,-20,15,-3,-14,-20,-2,-17,-3,-3,-3,-15,-18,-16,]),'ELSE':([65,71,73,],[-3,-2,76,]),'EQ':([0,1,2,3,4,7,9,10,12,13,15,16,17,19,21,22,23,24,25,26,27,28,29,30,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,54,55,56,57,58,59,61,62,64,65,66,67,68,71,73,74,75,76,77,78,79,],[-13,-9,-8,-40,-7,-10,-39,-11,28,-13,-37,-6,-38,-37,-37,-37,-37,-37,-37,-37,-37,-37,-37,-37,-37,28,-38,-37,-37,28,-37,28,28,-29,-28,28,28,-26,28,-27,28,28,-36,-37,-13,28,28,-3,28,-37,-37,-20,-37,-3,-14,28,-20,-2,-17,-3,-3,-3,-15,-18,-16,]),'ID':([0,1,2,3,4,7,8,9,10,12,13,15,16,17,19,21,22,23,24,25,26,27,28,29,30,32,34,35,36,38,39,40,41,42,43,44,45,46,47,48,50,51,54,57,58,59,61,62,64,65,66,68,71,73,74,75,76,77,78,79,],[17,-9,-8,-40,-7,-10,20,-39,-11,-12,17,34,-6,-38,34,34,34,34,34,34,34,34,34,34,34,34,-38,34,34,34,-32,-34,-29,-28,-33,-35,-26,-30,-27,-31,-36,34,17,-3,-19,34,34,-20,34,-3,-14,-20,-2,-17,-3,-3,-3,-15,-18,-16,]),'IF':([0,1,2,3,4,7,9,10,12,13,16,17,21,22,23,24,25,26,27,28,29,30,34,38,39,40,41,42,43,44,45,46,47,48,50,54,57,58,62,65,66,68,71,73,74,75,76,77,78,79,],[18,-9,-8,-40,-7,-10,-39,-11,-12,18,-6,-38,-37,-37,-37,-37,-37,-37,-37,-37,-37,-37,-38,-37,-32,-34,-29,-28,-33,-35,-26,-30,-27,-31,-36,18,-3,-19,-20,-3,-14,-20,-2,-17,-3,-3,-3,-15,-18,-16,]),'LBRACE':([35,51,57,61,64,65,74,75,76,],[54,54,54,54,54,54,54,54,54,]),'COMMA':([3,9,21,22,23,24,25,26,27,28,29,30,34,35,39,40,41,42,43,44,45,46,47,48,50,51,52,55,61,64,68,71,],[-40,-39,-37,-37,-37,-37,-37,-37,-37,-37,-37,-37,-38,-3,-32,-34,-29,-28,-33,-35,-26,-30,-27,-31,-36,-3,61,64,-3,-3,-20,-2,]),}
 
 _lr_action = { }
 for _k, _v in _lr_action_items.items():
       _lr_action[_x][_k] = _y
 del _lr_action_items
 
-_lr_goto_items = {'innerblock':([35,51,57,61,65,66,75,76,77,],[52,52,67,52,52,74,78,79,80,]),'ifelsestmt':([0,13,54,],[1,1,1,]),'foreachstmt':([0,13,54,],[2,2,2,]),'qexpr':([0,13,15,19,21,22,23,24,25,26,27,28,29,30,32,35,36,38,51,54,59,61,65,],[12,12,33,37,39,40,41,42,43,44,45,46,47,48,49,55,56,58,55,12,68,55,55,]),'stmt':([0,13,54,],[13,13,13,]),'whilestmt':([0,13,54,],[4,4,4,]),'program':([0,],[11,]),'vardef':([0,13,54,],[10,10,10,]),'stmtlist':([0,13,54,],[6,31,63,]),'funcdef':([0,13,54,],[16,16,16,]),'argslist':([35,51,61,65,],[53,60,70,73,]),'ifstmt':([0,13,54,],[7,7,7,]),}
+_lr_goto_items = {'innerblock':([35,51,57,61,64,65,74,75,76,],[52,52,66,52,52,73,77,78,79,]),'ifelsestmt':([0,13,54,],[1,1,1,]),'foreachstmt':([0,13,54,],[2,2,2,]),'qexpr':([0,13,15,19,21,22,23,24,25,26,27,28,29,30,32,35,36,38,51,54,59,61,64,],[12,12,33,37,39,40,41,42,43,44,45,46,47,48,49,55,56,58,55,12,67,55,55,]),'stmt':([0,13,54,],[13,13,13,]),'whilestmt':([0,13,54,],[4,4,4,]),'program':([0,],[11,]),'vardef':([0,13,54,],[10,10,10,]),'stmtlist':([0,13,54,],[6,31,63,]),'funcdef':([0,13,54,],[16,16,16,]),'argslist':([35,51,61,64,],[53,60,69,72,]),'ifstmt':([0,13,54,],[7,7,7,]),}
 
 _lr_goto = { }
 for _k, _v in _lr_goto_items.items():
 del _lr_goto_items
 _lr_productions = [
   ("S' -> program","S'",1,None,None,None),
-  ('program -> stmtlist','program',1,'p_program','parser5.py',30),
-  ('innerblock -> LBRACE stmtlist RBRACE','innerblock',3,'p_innerblock','parser5.py',36),
-  ('innerblock -> LBRACE RBRACE','innerblock',2,'p_innerblock','parser5.py',37),
-  ('stmtlist -> stmt stmtlist','stmtlist',2,'p_stmtlist','parser5.py',42),
-  ('stmtlist -> <empty>','stmtlist',0,'p_stmtlist','parser5.py',43),
-  ('stmt -> funcdef','stmt',1,'p_stmt','parser5.py',65),
-  ('stmt -> whilestmt','stmt',1,'p_stmt','parser5.py',66),
-  ('stmt -> foreachstmt','stmt',1,'p_stmt','parser5.py',67),
-  ('stmt -> ifelsestmt','stmt',1,'p_stmt','parser5.py',68),
-  ('stmt -> ifstmt','stmt',1,'p_stmt','parser5.py',69),
-  ('stmt -> vardef','stmt',1,'p_stmt','parser5.py',70),
-  ('stmt -> qexpr','stmt',1,'p_stmt','parser5.py',71),
-  ('stmt -> <empty>','stmt',0,'p_stmt','parser5.py',72),
-  ('whilestmt -> WHILE LPAREN qexpr RPAREN innerblock','whilestmt',5,'p_while','parser5.py',81),
-  ('foreachstmt -> FOREACH LPAREN qexpr COLON qexpr RPAREN innerblock','foreachstmt',7,'p_foreach','parser5.py',88),
-  ('ifelsestmt -> IF LPAREN qexpr RPAREN innerblock ELSE innerblock','ifelsestmt',7,'p_ifelse','parser5.py',93),
-  ('ifstmt -> IF LPAREN qexpr RPAREN innerblock','ifstmt',5,'p_if','parser5.py',100),
-  ('funcdef -> ID LPAREN argslist RPAREN EQUALS FUNCTION innerblock','funcdef',7,'p_funcdef','parser5.py',106),
-  ('vardef -> DEF ID EQUALS qexpr','vardef',4,'p_vardef','parser5.py',115),
-  ('qexpr -> ID LPAREN argslist RPAREN','qexpr',4,'p_stmt_funccall','parser5.py',121),
-  ('argslist -> qexpr COMMA argslist','argslist',3,'p_argslist','parser5.py',130),
-  ('argslist -> innerblock COMMA argslist','argslist',3,'p_argslist','parser5.py',131),
-  ('argslist -> qexpr','argslist',1,'p_argslist','parser5.py',132),
-  ('argslist -> innerblock','argslist',1,'p_argslist','parser5.py',133),
-  ('argslist -> <empty>','argslist',0,'p_argslist','parser5.py',134),
-  ('qexpr -> qexpr PLUS qexpr','qexpr',3,'p_qexpr','parser5.py',155),
-  ('qexpr -> qexpr MINUS qexpr','qexpr',3,'p_qexpr','parser5.py',156),
-  ('qexpr -> qexpr TIMES qexpr','qexpr',3,'p_qexpr','parser5.py',157),
-  ('qexpr -> qexpr DIVIDE qexpr','qexpr',3,'p_qexpr','parser5.py',158),
-  ('qexpr -> qexpr EQ qexpr','qexpr',3,'p_qexpr','parser5.py',159),
-  ('qexpr -> qexpr NE qexpr','qexpr',3,'p_qexpr','parser5.py',160),
-  ('qexpr -> qexpr GT qexpr','qexpr',3,'p_qexpr','parser5.py',161),
-  ('qexpr -> qexpr LT qexpr','qexpr',3,'p_qexpr','parser5.py',162),
-  ('qexpr -> qexpr GE qexpr','qexpr',3,'p_qexpr','parser5.py',163),
-  ('qexpr -> qexpr LE qexpr','qexpr',3,'p_qexpr','parser5.py',164),
-  ('qexpr -> LPAREN qexpr RPAREN','qexpr',3,'p_qexpr_paren','parser5.py',172),
-  ('qexpr -> <empty>','qexpr',0,'p_qexpr_paren','parser5.py',173),
-  ('qexpr -> ID','qexpr',1,'p_qexpr_id','parser5.py',178),
-  ('qexpr -> STRING','qexpr',1,'p_qexpr_val','parser5.py',182),
-  ('qexpr -> NUMBER','qexpr',1,'p_qexpr_num','parser5.py',187),
+  ('program -> stmtlist','program',1,'p_program','parser.py',18),
+  ('innerblock -> LBRACE stmtlist RBRACE','innerblock',3,'p_innerblock','parser.py',24),
+  ('innerblock -> <empty>','innerblock',0,'p_innerblock','parser.py',25),
+  ('stmtlist -> stmt stmtlist','stmtlist',2,'p_stmtlist','parser.py',30),
+  ('stmtlist -> <empty>','stmtlist',0,'p_stmtlist','parser.py',31),
+  ('stmt -> funcdef','stmt',1,'p_stmt','parser.py',53),
+  ('stmt -> whilestmt','stmt',1,'p_stmt','parser.py',54),
+  ('stmt -> foreachstmt','stmt',1,'p_stmt','parser.py',55),
+  ('stmt -> ifelsestmt','stmt',1,'p_stmt','parser.py',56),
+  ('stmt -> ifstmt','stmt',1,'p_stmt','parser.py',57),
+  ('stmt -> vardef','stmt',1,'p_stmt','parser.py',58),
+  ('stmt -> qexpr','stmt',1,'p_stmt','parser.py',59),
+  ('stmt -> <empty>','stmt',0,'p_stmt','parser.py',60),
+  ('whilestmt -> WHILE LPAREN qexpr RPAREN innerblock','whilestmt',5,'p_while','parser.py',69),
+  ('foreachstmt -> FOREACH LPAREN qexpr COLON qexpr RPAREN innerblock','foreachstmt',7,'p_foreach','parser.py',76),
+  ('ifelsestmt -> IF LPAREN qexpr RPAREN innerblock ELSE innerblock','ifelsestmt',7,'p_ifelse','parser.py',81),
+  ('ifstmt -> IF LPAREN qexpr RPAREN innerblock','ifstmt',5,'p_if','parser.py',88),
+  ('funcdef -> ID LPAREN argslist RPAREN EQUALS FUNCTION innerblock','funcdef',7,'p_funcdef','parser.py',94),
+  ('vardef -> DEF ID EQUALS qexpr','vardef',4,'p_vardef','parser.py',103),
+  ('qexpr -> ID LPAREN argslist RPAREN','qexpr',4,'p_expr_funccall','parser.py',109),
+  ('argslist -> qexpr COMMA argslist','argslist',3,'p_argslist','parser.py',118),
+  ('argslist -> innerblock COMMA argslist','argslist',3,'p_argslist','parser.py',119),
+  ('argslist -> qexpr','argslist',1,'p_argslist','parser.py',120),
+  ('argslist -> innerblock','argslist',1,'p_argslist','parser.py',121),
+  ('argslist -> <empty>','argslist',0,'p_argslist','parser.py',122),
+  ('qexpr -> qexpr PLUS qexpr','qexpr',3,'p_qexpr','parser.py',143),
+  ('qexpr -> qexpr MINUS qexpr','qexpr',3,'p_qexpr','parser.py',144),
+  ('qexpr -> qexpr TIMES qexpr','qexpr',3,'p_qexpr','parser.py',145),
+  ('qexpr -> qexpr DIVIDE qexpr','qexpr',3,'p_qexpr','parser.py',146),
+  ('qexpr -> qexpr EQ qexpr','qexpr',3,'p_qexpr','parser.py',147),
+  ('qexpr -> qexpr NE qexpr','qexpr',3,'p_qexpr','parser.py',148),
+  ('qexpr -> qexpr GT qexpr','qexpr',3,'p_qexpr','parser.py',149),
+  ('qexpr -> qexpr LT qexpr','qexpr',3,'p_qexpr','parser.py',150),
+  ('qexpr -> qexpr GE qexpr','qexpr',3,'p_qexpr','parser.py',151),
+  ('qexpr -> qexpr LE qexpr','qexpr',3,'p_qexpr','parser.py',152),
+  ('qexpr -> LPAREN qexpr RPAREN','qexpr',3,'p_qexpr_paren','parser.py',160),
+  ('qexpr -> <empty>','qexpr',0,'p_qexpr_paren','parser.py',161),
+  ('qexpr -> ID','qexpr',1,'p_qexpr_id','parser.py',166),
+  ('qexpr -> STRING','qexpr',1,'p_qexpr_val','parser.py',170),
+  ('qexpr -> NUMBER','qexpr',1,'p_qexpr_num','parser.py',175),
 ]

File pykid/pythoncodegen.py

         args = node.args.args #argslist.args
         fblock = self.visitInnerblock(node.body)
         code=""
-        code +="\n"+" "*lvl +"def "+funcname+"(" + ",".join(args) + ")"+ ":\n"
+        code +="\n"+" "*lvl +"def "+funcname+"(" + ",".join(self.visitExpression(x) for x in args) + ")"+ ":\n"
         code +=fblock
         
         return code