@ParseTuple_1@ position p1; expression args; expression fmt; type t1; t1 e1; @@ PyArg_ParseTuple(args, fmt@p1, e1) @initialize:python@ import sys sys.path.append('.') from validate import validate_types @script:python@ args << ParseTuple_1.args; fmt << ParseTuple_1.fmt; t1 << ParseTuple_1.t1; p1 << ParseTuple_1.p1; @@ """ Analyze format strings, compare to vararg types actually passed FIXME: generalize this to varargs """ #print "args: %s" % args #print "fmt: %s" % fmt #print "var1: %s" % t1 #print get_types(fmt.expr) # For some reason, locations are coming as a 1-tuple containing a Location (from # coccilibs.elems), rather than the location itself # Hence we use p1[0], not p1 validate_types(p1[0], fmt.expr, [t1])