@GwtIncompatible(value="java.util.regex") public final class JsFileRegexParser extends JsFileLineParser
PARSE_ERROR
Constructor and Description |
---|
JsFileRegexParser(ErrorManager errorManager)
Constructor
|
Modifier and Type | Method and Description |
---|---|
static boolean |
isSupported() |
DependencyInfo |
parseFile(java.lang.String filePath,
java.lang.String closureRelativePath,
java.lang.String fileContents)
Parses the given file and returns the dependency information that it
contained.
|
protected boolean |
parseJsDocCommentLine(java.lang.String line)
Called for each JSDoc line of the file being parsed.
|
protected boolean |
parseLine(java.lang.String line)
Parses a line of JavaScript, extracting goog.provide and goog.require information.
|
JsFileRegexParser |
setIncludeGoogBase(boolean include)
Sets whether we should create implicit provides and requires of the root namespace.
|
JsFileRegexParser |
setModuleLoader(ModuleLoader loader)
Sets a list of "module root" URIs, which allow relativizing filenames for modules.
|
didParseSucceed, setShortcutMode
public JsFileRegexParser(ErrorManager errorManager)
errorManager
- Handles parse errors.public JsFileRegexParser setIncludeGoogBase(boolean include)
When generating deps files, you do not want this behavior. Deps files need base.js to run anyway, so they don't need information about it.
When generating abstract build graphs, you probably do want this behavior. It will create an implicit dependency of all files with provides/requires on base.js.
public JsFileRegexParser setModuleLoader(ModuleLoader loader)
public DependencyInfo parseFile(java.lang.String filePath, java.lang.String closureRelativePath, java.lang.String fileContents)
filePath
- Path to the file to parse.closureRelativePath
- Path of the file relative to closure.fileContents
- The contents to parse.protected boolean parseJsDocCommentLine(java.lang.String line)
JsFileLineParser
line
- The JSDoc comment line to parse.protected boolean parseLine(java.lang.String line) throws com.google.javascript.jscomp.deps.JsFileLineParser.ParseException
line
- The line to parse.com.google.javascript.jscomp.deps.JsFileLineParser.ParseException
public static boolean isSupported()
Copyright © 2009-2020 Google. All Rights Reserved.