I would like to be able to parse the source code, and when it finds a call like 'rect(10,20,30,40)' it would subtract an entered value from the first argument (the x position) and the second argument (the y position) and leave the third and fourth (width and height) untouched. Other calls, like triangles contain 3 x/y pairs so the program would need to process all three pairs.
Also, optionally it would be nice to add a variable into the call like 'rect(10+xPos,20+yPos,30,40)'
I'm looking for hints on how to accomplish these tasks since Python isn't a native language for me.
P.s., here's a quick sample of what I usually need to process. fill() is untouched, rect() has x,y as the first two arguments, quad() is 4 x,y pairs.
fill(125, 47, 11);
rect(85, 220, 50, 50);
rect(135, 240, 12, 60);
rect(135, 290, 25, 10);
quad(160, 190, 110, 190, 85, 220, 135, 220);
quad(160, 190, 135, 220, 135, 270, 160, 240);
rect(105, 270, 13, 40);
rect(105, 300, 25, 10);