Cleaned up
parent
1121f2d84e
commit
2873a6ab4e
|
@ -166,25 +166,15 @@ public final class Parser
|
||||||
/* Check for opening curly (just an "else" statement) */
|
/* Check for opening curly (just an "else" statement) */
|
||||||
else if (getSymbolType(getCurrentToken()) == SymbolType.OCURLY)
|
else if (getSymbolType(getCurrentToken()) == SymbolType.OCURLY)
|
||||||
{
|
{
|
||||||
/* TODO: Implement me */
|
/* Parse the if' statement's body (starting with `{` AND expect a closing curly */
|
||||||
|
|
||||||
import std.stdio;
|
|
||||||
writeln("EYO ELSE");
|
|
||||||
|
|
||||||
/* Opening { */
|
|
||||||
writeln("Bruh"~to!(string)(getCurrentToken()));
|
|
||||||
// nextToken();
|
|
||||||
|
|
||||||
/* Parse the if' statement's body AND expect a closing curly */
|
|
||||||
parseBody();
|
parseBody();
|
||||||
expect(SymbolType.CCURLY, getCurrentToken());
|
expect(SymbolType.CCURLY, getCurrentToken());
|
||||||
nextToken();
|
nextToken();
|
||||||
|
|
||||||
writeln("EYO ELSE (END):");
|
|
||||||
writeln("Bruh"~to!(string)(getCurrentToken()));
|
|
||||||
|
|
||||||
/* Don't allow anything to follow after this */
|
/* Don't allow anything to follow after this */
|
||||||
reachedElse = true;
|
reachedElse = true;
|
||||||
|
|
||||||
|
//break;
|
||||||
}
|
}
|
||||||
/* Error out for unexpected symbol or invalid reachedElse */
|
/* Error out for unexpected symbol or invalid reachedElse */
|
||||||
else
|
else
|
||||||
|
|
|
@ -27,7 +27,15 @@ class clazz_2_1
|
||||||
print("Hello");
|
print("Hello");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
else
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
else
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
if(1)
|
if(1)
|
||||||
{
|
{
|
||||||
|
@ -46,7 +54,7 @@ class clazz_2_1
|
||||||
{
|
{
|
||||||
if(1)
|
if(1)
|
||||||
{
|
{
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
|
Loading…
Reference in New Issue