JsDocInfoParser(JsDocTokenStream stream, String comment, int commentPosition, Node templateNode, Config config, ErrorReporter errorReporter) { this.stream = stream; boolean parseDocumentation = config.jsDocParsingMode().shouldParseDescriptions(); this.jsdocBuilder = new JSDocInfoBuilder(parseDocumentation); if (comment != null) { this.jsdocBuilder.recordOriginalCommentString(comment); this.jsdocBuilder.recordOriginalCommentPosition(commentPosition); } this.annotations = config.annotations(); this.suppressionNames = config.suppressionNames(); this.preserveWhitespace = config.jsDocParsingMode().shouldPreserveWhitespace(); this.errorReporter = errorReporter; this.templateNode = templateNode == null ? IR.script() : templateNode; }
private IRFactory(String sourceString, StaticSourceFile sourceFile, Config config, ErrorReporter errorReporter, ImmutableList<Comment> comments) { this.sourceString = sourceString; this.nextCommentIter = comments.iterator(); this.currentComment = skipNonJsDoc(nextCommentIter); this.sourceFile = sourceFile; // The template node properties are applied to all nodes in this transform. this.templateNode = createTemplateNode(); this.fileLevelJsDocBuilder = new JSDocInfoBuilder(config.jsDocParsingMode().shouldParseDescriptions()); // Sometimes this will be null in tests. this.sourceName = sourceFile == null ? null : sourceFile.getName(); this.config = config; this.errorReporter = errorReporter; this.transformDispatcher = new TransformDispatcher(); if (config.strictMode().isStrict()) { reservedKeywords = ES5_STRICT_RESERVED_KEYWORDS; } else if (config.languageMode() == LanguageMode.ECMASCRIPT3) { reservedKeywords = null; // use TokenStream.isKeyword instead } else { reservedKeywords = ES5_RESERVED_KEYWORDS; } }
@Override public boolean equals(Object o) { if (o == this) { return true; } if (o instanceof Config) { Config that = (Config) o; return (this.languageMode.equals(that.languageMode())) && (this.strictMode.equals(that.strictMode())) && (this.jsDocParsingMode.equals(that.jsDocParsingMode())) && (this.runMode.equals(that.runMode())) && (this.annotations.equals(that.annotations())) && (this.suppressionNames.equals(that.suppressionNames())) && (this.parseInlineSourceMaps == that.parseInlineSourceMaps()); } return false; }
root.putProp(Node.FEATURE_SET, features); if (config.jsDocParsingMode().shouldParseDescriptions()) { comments = p.getComments();