def p_fdef(p): '''fdef : DEF IDENTIFIER tuple block ''' p[0] = Node('FuncDef') p[0].name = p[2].value p[0].args = Node('Arguments') p[0].args.args = p[3].elems p[0].body = p[4].body
def p_struct_start(p): """struct_start : STRUCT NAME LCURLY""" p[0] = Node("struct") p[0].name = p[2].value p[0].elems = []