Examples of InputId


Examples of com.google.javascript.rhino.InputId

      violation("Missing 'source name' annotation.", n);
    }
  }

  private void validateHasInputId(Node n) {
    InputId inputId = n.getInputId();
    if (inputId == null) {
      violation("Missing 'input id' annotation.", n);
    }
  }
View Full Code Here

Examples of com.google.javascript.rhino.InputId

    if (refMap == null || root.getType() != Token.SCRIPT) {
      resetGlobalVarReferences(refMapPatch);
      return;
    }

    InputId inputId = root.getInputId();
    Preconditions.checkNotNull(inputId);
    // Note there are two assumptions here (i) the order of compiler inputs
    // has not changed and (ii) all references are in the order they appear
    // in AST (this is enforced in ReferenceCollectionCallback).
    removeScriptReferences(inputId);
View Full Code Here

Examples of com.google.javascript.rhino.InputId

  private final SourceFile sourceFile;
  private final InputId inputId;

  public JsonMLAst(JsonML jsonml) {
    this.jsonml = jsonml;
    this.inputId = new InputId(getSourceName());
    this.sourceFile = new SourceFile(getSourceName());
  }
View Full Code Here

Examples of com.google.javascript.rhino.InputId

    options.setCodingConvention(new GoogleCodingConvention());
    compiler.initOptions(options);
    src = "function _FUNCTION(param1, param2){" + src + "}";
    Node n = compiler.parseTestCode(src).removeFirstChild();
    Node script = new Node(Token.SCRIPT, n);
    script.setInputId(new InputId("test"));
    assertEquals(0, compiler.getErrorCount());
    Scope scope = new SyntacticScopeCreator(compiler).createScope(
        n, new Scope(script, compiler));
    ControlFlowAnalysis cfa = new ControlFlowAnalysis(compiler, false, true);
    cfa.process(null, n);
View Full Code Here

Examples of com.google.javascript.rhino.InputId

  private final SourceFile sourceFile;

  private Node root;

  SyntheticAst(String sourceName) {
    this.inputId = new InputId(sourceName);
    this.sourceFile = new SourceFile(sourceName);
    clearAst();
  }
View Full Code Here

Examples of com.google.javascript.rhino.InputId

  public CompilerInput(SourceAst ast, boolean isExtern) {
    this(ast, ast.getInputId(), isExtern);
  }

  public CompilerInput(SourceAst ast, String inputId, boolean isExtern) {
    this(ast, new InputId(inputId), isExtern);
  }
View Full Code Here

Examples of com.google.javascript.rhino.InputId

    Config config = new Config(extraAnnotations, extraSuppressions,
        parseDocumentation, LanguageMode.ECMASCRIPT3, false);
    StaticSourceFile file = new SimpleSourceFile("testcode", false);
    Node associatedNode = new Node(Token.SCRIPT);
    associatedNode.setInputId(new InputId(file.getName()));
    associatedNode.setStaticSourceFile(file);
    JsDocInfoParser jsdocParser = new JsDocInfoParser(
        stream(comment),
        new Comment(0, 0, CommentType.JSDOC, comment),
        associatedNode,
View Full Code Here

Examples of com.google.javascript.rhino.InputId

    if (checkTypes) {
      DefaultPassConfig passConfig = new DefaultPassConfig(null);
      CompilerPass typeResolver = passConfig.resolveTypes.create(compiler);
      Node externs = new Node(Token.SCRIPT);
      externs.setInputId(new InputId("externs"));
      externs.setIsSyntheticBlock(true);
      Node externAndJsRoot = new Node(Token.BLOCK, externs, n);
      externAndJsRoot.setIsSyntheticBlock(true);
      typeResolver.process(externs, n);
      CompilerPass inferTypes = passConfig.inferTypes.create(compiler);
View Full Code Here

Examples of com.google.javascript.rhino.InputId

   * Type checks a NAME node and retrieve its type.
   */
  private JSType testNameNode(String name) {
    Node node = Node.newString(Token.NAME, name);
    Node parent = new Node(Token.SCRIPT, node);
    parent.setInputId(new InputId("code"));

    Node externs = new Node(Token.SCRIPT);
    externs.setInputId(new InputId("externs"));

    Node externAndJsRoot = new Node(Token.BLOCK, externs, parent);
    externAndJsRoot.setIsSyntheticBlock(true);

    makeTypeCheck().processForTesting(null, parent);
View Full Code Here

Examples of com.google.javascript.rhino.InputId

    compiler.init(
        Lists.newArrayList(JSSourceFile.fromCode("[externs]", externs)),
        Lists.newArrayList(JSSourceFile.fromCode("[testcode]", js)),
        compiler.getOptions());

    Node n = compiler.getInput(new InputId("[testcode]")).getAstRoot(compiler);
    Node externsNode = compiler.getInput(new InputId("[externs]"))
        .getAstRoot(compiler);
    Node externAndJsRoot = new Node(Token.BLOCK, externsNode, n);
    externAndJsRoot.setIsSyntheticBlock(true);

    assertEquals("parsing error: " +
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.