//this is a test for comment

//expressions statments, everything needs to end with a semi ;

//constants
1;
1.5;
true;
false;

//identifiers
x;
x1;
x1x;
x1x_;

//function calls
x(void);
x(x, x);
x(x, y);
x(x, void, y);
drawcircle(a, b);

//operative expressions
1*2;
x*2;
x*x*2;
1%2;
x%2;
x%x%2;
1/2;
x/2;
x/x/2;
1+2;
x+2;
x+x+2;
1-2;
x-2;
x-x-2;
x<1;
x<y;
x=1;
x=y;
x>1;
x>y;
x>=1;
x>=y;
x<=1;
x<=y;
x!=1;
x!=y;
x||true;
x||y;
x&&false;
x&&y;

//assignment expressions
x<-1;
x<-true;
x<-y;
x<-5%8;
x<-y(void);
x<-y(x,y);

//keyword statements
fw 10;
forward 10;
fw x;
forward x;
bw 10;
backward 10;
bw x;
backward x;
rt 10;
right 10;
rt x;
right x;
lf 10;
left 10;
lf x;
left x;
penup;
pu;
pendown;
pd;
clear;
cl;
return x;
return 10;
return 10+x;
echo x;
echo 10;
echo 10+x;
break;
continue;
status;

//variable declaration statement
var decimal x;
var decimal x<-0+10;
var boolean y;
var boolean y<-false;

//function declaration statement
//mainly test param list declaration since we take body as a block
funct x(void) {
	fw 10;
}

funct drawcircle(decimal x, boolean y) {
	for ( var decimal x <- 0; x <= 36; x <- x+1) {
		forward 1;
		left x;
	}
}


//Control flow statments
for ( var decimal x <- 0; x <= 36; x <- x+1) {
	forward x+10;
	left x;
}

for (void; x<=36; void) { //condition can't be void
	forward x+10;
	left x;
}

while(x < 4) {
	forward 100;
	right 90;
	x<-x+1;
}

if(x=2) break;

if(x<100) {} else { left 90; }

if(true) {
	forward 1;
}


//tail recursion

funct drawSpiral(decimal step_size) {
	if(step_size = 100) {
		return; //base case
	}
	fw step_size;
	rt 1;
        drawSpiral(step_size+1);		
}

