add bool literal

This commit is contained in:
2020-01-20 15:26:55 +01:00
parent 1095d9dd83
commit 1186bb4550
12 changed files with 88 additions and 4 deletions

View File

@@ -209,6 +209,13 @@ public class ContextAnalysis extends KlangBaseVisitor<Node> {
return n;
}
@Override
public Node visitBoolAtom(KlangParser.BoolAtomContext ctx) {
Node n = new BooleanExpression(ctx.getText().equals("true") ? true : false);
n.type = Type.getBooleanType();
return n;
}
@Override
public Node visitFunctionDef(KlangParser.FunctionDefContext ctx) {
String name = ctx.funcName.getText();