Example:
canvas (100, 100)circle (10, 10) radius 5square (10, 10), (40,40)
But I'm having problems with the "square" syntax. I'm not sure how to write a macro that could grok ", (40,40)".
I've tried using the following macro:
#define square(x, y, w, h) Square* sqr = new Square(x,y,w,h);
but it just gets the first pair values and doesn't know how to get to the other pair values.
Is there a way I can manipulate the code written so I could transform it from
square (10, 10), (40,40)
to
square (10, 10, 40, 40)
before compiling it? Even if I could just insert code between the two pair value, that would be great! Is it possible, though?
Note that I cannot change the syntax of the simple language, as that would break the spec.
Thanks!