Examples of JsStringLiteral


Examples of com.google.gwt.dev.js.ast.JsStringLiteral

        } else if (type instanceof JInterfaceType) {
          string = "interface " + type.getName();
        } else {
          string = type.getName();
        }
        JsStringLiteral stringLiteral = jsProgram.getStringLiteral(string);
        JsVar var = new JsVar(jsName);
        var.setInitExpr(stringLiteral);
        vars.add(var);
      }
    }
View Full Code Here

Examples of com.google.gwt.dev.js.ast.JsStringLiteral

    JsNode unknown = map(nameRefNode);
    // This is weird, but for "a.b", the rhino AST calls "b" a string literal.
    // However, since we know it's for a PROPGET, we can unstringliteralize it.
    //
    if (unknown instanceof JsStringLiteral) {
      JsStringLiteral lit = (JsStringLiteral) unknown;
      String litName = lit.getValue();
      return new JsNameRef(litName);
    } else {
      throw createParserException("Expecting a name reference", nameRefNode);
    }
  }
View Full Code Here

Examples of com.google.gwt.dev.js.ast.JsStringLiteral

      Multimap<String, Integer> instrumentableLines) {
    JsObjectLiteral baseline = new JsObjectLiteral(info);
    List<JsPropertyInitializer> properties = baseline.getPropertyInitializers();
    for (String filename : instrumentableLines.keySet()) {
      JsPropertyInitializer pair = new JsPropertyInitializer(info);
      pair.setLabelExpr(new JsStringLiteral(info, filename));
      JsObjectLiteral lines = new JsObjectLiteral(info);
      List<JsPropertyInitializer> coverage = lines.getPropertyInitializers();
      for (int line : instrumentableLines.get(filename)) {
        coverage.add(new JsPropertyInitializer(info,
            new JsNumberLiteral(info, line), new JsNumberLiteral(info, 0)));
View Full Code Here

Examples of com.google.gwt.dev.js.ast.JsStringLiteral

        return;
      }
      JsInvocation update = new JsInvocation(info);
      update.setQualifier(jsProgram.getIndexedFunction("CoverageUtil.cover")
          .getName().makeRef(info));
      update.getArguments().add(new JsStringLiteral(info, info.getFileName()));
      update.getArguments().add(new JsNumberLiteral(info, info.getStartLine()));
      ctx.replaceMe(new JsBinaryOperation(info, JsBinaryOperator.COMMA, update, x));
    }
View Full Code Here

Examples of com.google.gwt.dev.js.ast.JsStringLiteral

      // If filenames are on:
      //   $locations[stackIndex] = "{fileName}:" + "{lineNumber}";
      // Otherwise:
      //   $locations[stackIndex] = "{lineNumber}";

      JsExpression location = new JsStringLiteral(info, String.valueOf(info.getStartLine()));
      if (recordFileNames) {
        // 'fileName:' + lineNumber
        JsStringLiteral stringLit = new JsStringLiteral(info, baseName(info.getFileName()) + ":");
        location = new JsBinaryOperation(info, JsBinaryOperator.ADD, stringLit, location);
      }

      JsArrayAccess access = new JsArrayAccess(info, lineNumbers.makeRef(info),
          stackIndexRef(info));
View Full Code Here

Examples of com.google.gwt.dev.js.ast.JsStringLiteral

        return mapConditional(node);

      case TokenStream.STRING: {
        SourceInfo info = makeSourceInfoDistinct(node);
        info.addCorrelation(info.getCorrelator().by(Literal.STRING));
        return new JsStringLiteral(info, node.getString());
      }

      case TokenStream.NUMBER:
        return mapNumber(node);
View Full Code Here

Examples of com.google.gwt.dev.js.ast.JsStringLiteral

    JsNode unknown = map(nameRefNode);
    // This is weird, but for "a.b", the rhino AST calls "b" a string literal.
    // However, since we know it's for a PROPGET, we can unstringliteralize it.
    //
    if (unknown instanceof JsStringLiteral) {
      JsStringLiteral lit = (JsStringLiteral) unknown;
      String litName = lit.getValue();
      return new JsNameRef(makeSourceInfo(nameRefNode), litName);
    } else {
      throw createParserException("Expecting a name reference", nameRefNode);
    }
  }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.