Exemplo n.º 1
0
 @Override
 public void visit(Tree.AttributeArgument that) {
   if (that.getDeclarationModel() == declaration) {
     declare();
     specify();
   }
   super.visit(that);
 }
Exemplo n.º 2
0
  static void attributeArgument(final Tree.AttributeArgument that, final GenerateJsVisitor gen) {
    gen.out("(function()");
    gen.beginBlock();
    if (gen.opts.isVerbose() && that.getParameter() != null) {
      gen.out("//AttributeArgument ", that.getParameter().getName());
      gen.location(that);
      gen.endLine();
    }

    Tree.Block block = that.getBlock();
    Tree.SpecifierExpression specExpr = that.getSpecifierExpression();
    if (specExpr != null) {
      gen.out("return ");
      if (!gen.isNaturalLiteral(specExpr.getExpression().getTerm())) {
        gen.visitSingleExpression(specExpr.getExpression());
      }
    } else if (block != null) {
      gen.visitStatements(block.getStatements());
    }

    gen.endBlock();
    gen.out("())");
  }