public static IRFactory transformTree(ProgramTree tree, StaticSourceFile sourceFile, String sourceString, Config config, ErrorReporter errorReporter) { IRFactory irFactory = new IRFactory(sourceString, sourceFile, config, errorReporter, tree.sourceComments); // don't call transform as we don't want standard jsdoc handling. Node n = irFactory.transformDispatcher.process(tree); irFactory.setSourceInfo(n, tree); if (tree.sourceComments != null) { for (Comment comment : tree.sourceComments) { if ((comment.type == Comment.Type.JSDOC || comment.type == Comment.Type.IMPORTANT) && !irFactory.parsedComments.contains(comment)) { irFactory.handlePossibleFileOverviewJsDoc(comment); } } } irFactory.setFileOverviewJsDoc(n); irFactory.validateAll(n); irFactory.resultNode = n; return irFactory; }
public static IRFactory transformTree(ProgramTree tree, StaticSourceFile sourceFile, String sourceString, Config config, ErrorReporter errorReporter) { IRFactory irFactory = new IRFactory(sourceString, sourceFile, config, errorReporter, tree.sourceComments); // don't call transform as we don't want standard jsdoc handling. Node n = irFactory.transformDispatcher.process(tree); irFactory.setSourceInfo(n, tree); if (tree.sourceComments != null) { for (Comment comment : tree.sourceComments) { if (comment.type == Comment.Type.JSDOC && !irFactory.parsedComments.contains(comment)) { irFactory.handlePossibleFileOverviewJsDoc(comment); } else if (comment.type == Comment.Type.BLOCK) { irFactory.handleBlockComment(comment); } } } irFactory.setFileOverviewJsDoc(n); irFactory.validateAll(n); irFactory.resultNode = n; return irFactory; }
/** * Names and destructuring patterns, in parameters or variable declarations are special, * because they can have inline type docs attached. * * <pre>function f(/** string */ x) {}</pre> annotates 'x' as a string. * * @see <a href="http://code.google.com/p/jsdoc-toolkit/wiki/InlineDocs"> * Using Inline Doc Comments</a> */ Node transformNodeWithInlineJsDoc(ParseTree node) { JSDocInfo info = handleInlineJsDoc(node); Node irNode = transformDispatcher.process(node); if (info != null) { irNode.setJSDocInfo(info); } setSourceInfo(irNode, node); return irNode; }
/** * Names and destructuring patterns, in parameters or variable declarations are special, * because they can have inline type docs attached. * * <pre>function f(/** string */ x) {}</pre> annotates 'x' as a string. * * @see <a href="http://code.google.com/p/jsdoc-toolkit/wiki/InlineDocs"> * Using Inline Doc Comments</a> */ Node transformNodeWithInlineJsDoc(ParseTree node) { JSDocInfo info = handleInlineJsDoc(node); Node irNode = transformDispatcher.process(node); if (info != null) { irNode.setJSDocInfo(info); } setSourceInfo(irNode, node); return irNode; }
Node processVariableStatement(VariableStatementTree stmt) { // TODO(moz): Figure out why we still need the special handling return transformDispatcher.process(stmt.declarations); }
Node processVariableStatement(VariableStatementTree stmt) { // TODO(moz): Figure out why we still need the special handling return transformDispatcher.process(stmt.declarations); }
Node transform(ParseTree tree) { JSDocInfo info = handleJsDoc(tree); Node node = transformDispatcher.process(tree); if (info != null) { node = maybeInjectCastNode(tree, info, node); node.setJSDocInfo(info); } setSourceInfo(node, tree); return node; }
Node transform(ParseTree tree) { JSDocInfo info = handleJsDoc(tree); Node node = transformDispatcher.process(tree); if (info != null) { node = maybeInjectCastNode(tree, info, node); node.setJSDocInfo(info); } setSourceInfo(node, tree); return node; }
static FeatureSet detectFeatures( ProgramTree tree, StaticSourceFile sourceFile, String sourceString) { IRFactory irFactory = new IRFactory(sourceString, sourceFile, NULL_CONFIG, NULL_REPORTER, tree.sourceComments); Node n = irFactory.transformDispatcher.process(tree); irFactory.validateAll(n); return irFactory.features; }