Search in sources :

Example 1 with IdeExpr

use of net.jangaroo.jooc.ast.IdeExpr in project jangaroo-tools by CoreMedia.

the class JsCodeGenerator method visitApplyExpr.

@Override
public void visitApplyExpr(ApplyExpr applyExpr) throws IOException {
    generateFunJsCode(applyExpr);
    if (applyExpr.getArgs() != null) {
        boolean isAssert = applyExpr.getFun() instanceof IdeExpr && SyntacticKeywords.ASSERT.equals(applyExpr.getFun().getSymbol().getText());
        if (isAssert) {
            JooSymbol symKeyword = applyExpr.getFun().getSymbol();
            out.writeSymbol(applyExpr.getArgs().getLParen());
            applyExpr.getArgs().getExpr().visit(this);
            out.writeToken(", ");
            out.writeString(new File(symKeyword.getFileName()).getName());
            out.writeToken(", ");
            out.writeInt(symKeyword.getLine());
            out.write(", ");
            out.writeInt(symKeyword.getColumn());
            out.writeSymbol(applyExpr.getArgs().getRParen());
        } else {
            applyExpr.getArgs().visit(this);
        }
    }
}
Also used : IdeExpr(net.jangaroo.jooc.ast.IdeExpr) File(java.io.File) JooSymbol(net.jangaroo.jooc.JooSymbol)

Aggregations

File (java.io.File)1 JooSymbol (net.jangaroo.jooc.JooSymbol)1 IdeExpr (net.jangaroo.jooc.ast.IdeExpr)1