Added new test case for if-statement parsing to test lone else's and else if's

This commit is contained in:
Tristan B. Velloza Kildaire 2021-03-20 18:43:22 +02:00
parent eaf359ec2d
commit a911141da9
2 changed files with 156 additions and 1 deletions

View File

@ -0,0 +1,155 @@
int x;
ubyte y;
ubyte k = 1;
class clazz1
{
print("Hello world");
}
class clazz_2_1
{
class clazz_2_2
{
class clazz_2_2_1
{
}
}
class clazz_2_3
{
class clazz_2_3_1
{
if(1)
{
print("Hello");
}
else if(1)
{
print("Bruh");
}
else
{
print("Bhjkfd");
}
if(1)
{
print("Hello");
}
else if(1)
{
print("Bruh");
}
else
{
print("Bhjkfd");
}
if(1)
{
print("Hello");
}
else
{
print("Bruh");
}
else if(1)
{
print("Bhjkfd");
}
}
print("Hello");
}
}
void main(int hello, byte d)
{
ubyte thing = "Hello";
print("Hello world");
print(1+1);
print(1+1);
ubyte eish = 1+1;
ubyte poes = ((1+1));
if(1+1)
{
if(1)
{
if((1))
{
print("Hello");
}
print("Hello");
}
}
if(((2)))
{
print(1+1);
}
if(2+222222/2)
{
while(1)
{
while(2+2)
{
}
}
}
}
void k(int j, int k)
{
ubyte thing = "Hello";
print("Hello world");
print(1+1);
print(1+1);
ubyte eish = 1+1;
ubyte poes = ((1+1));
if(1+1)
{
if(1)
{
if((1))
{
print("Hello");
}
print("Hello");
}
}
if(((2)))
{
print(1+1);
}
if(2+222222/2)
{
while(1)
{
while(2+2)
{
}
}
}
}

View File

@ -57,7 +57,7 @@ class clazz_2_1
print("Bruh");
}
else if(1)
else
{
print("Bhjkfd");
}