id int32 0 165k | repo stringlengths 7 58 | path stringlengths 12 218 | func_name stringlengths 3 140 | original_string stringlengths 73 34.1k | language stringclasses 1
value | code stringlengths 73 34.1k | code_tokens list | docstring stringlengths 3 16k | docstring_tokens list | sha stringlengths 40 40 | url stringlengths 105 339 |
|---|---|---|---|---|---|---|---|---|---|---|---|
24,800 | google/closure-compiler | src/com/google/javascript/jscomp/JSModuleGraph.java | JSModuleGraph.getModulesByName | Map<String, JSModule> getModulesByName() {
Map<String, JSModule> result = new HashMap<>();
for (JSModule m : modules) {
result.put(m.getName(), m);
}
return result;
} | java | Map<String, JSModule> getModulesByName() {
Map<String, JSModule> result = new HashMap<>();
for (JSModule m : modules) {
result.put(m.getName(), m);
}
return result;
} | [
"Map",
"<",
"String",
",",
"JSModule",
">",
"getModulesByName",
"(",
")",
"{",
"Map",
"<",
"String",
",",
"JSModule",
">",
"result",
"=",
"new",
"HashMap",
"<>",
"(",
")",
";",
"for",
"(",
"JSModule",
"m",
":",
"modules",
")",
"{",
"result",
".",
"... | Gets all modules indexed by name. | [
"Gets",
"all",
"modules",
"indexed",
"by",
"name",
"."
] | d81e36740f6a9e8ac31a825ee8758182e1dc5aae | https://github.com/google/closure-compiler/blob/d81e36740f6a9e8ac31a825ee8758182e1dc5aae/src/com/google/javascript/jscomp/JSModuleGraph.java#L277-L283 |
24,801 | google/closure-compiler | src/com/google/javascript/jscomp/JSModuleGraph.java | JSModuleGraph.dependsOn | public boolean dependsOn(JSModule src, JSModule m) {
return src != m && selfPlusTransitiveDeps[src.getIndex()].get(m.getIndex());
} | java | public boolean dependsOn(JSModule src, JSModule m) {
return src != m && selfPlusTransitiveDeps[src.getIndex()].get(m.getIndex());
} | [
"public",
"boolean",
"dependsOn",
"(",
"JSModule",
"src",
",",
"JSModule",
"m",
")",
"{",
"return",
"src",
"!=",
"m",
"&&",
"selfPlusTransitiveDeps",
"[",
"src",
".",
"getIndex",
"(",
")",
"]",
".",
"get",
"(",
"m",
".",
"getIndex",
"(",
")",
")",
";... | Determines whether this module depends on a given module. Note that a
module never depends on itself, as that dependency would be cyclic. | [
"Determines",
"whether",
"this",
"module",
"depends",
"on",
"a",
"given",
"module",
".",
"Note",
"that",
"a",
"module",
"never",
"depends",
"on",
"itself",
"as",
"that",
"dependency",
"would",
"be",
"cyclic",
"."
] | d81e36740f6a9e8ac31a825ee8758182e1dc5aae | https://github.com/google/closure-compiler/blob/d81e36740f6a9e8ac31a825ee8758182e1dc5aae/src/com/google/javascript/jscomp/JSModuleGraph.java#L339-L341 |
24,802 | google/closure-compiler | src/com/google/javascript/jscomp/JSModuleGraph.java | JSModuleGraph.getSmallestCoveringSubtree | public JSModule getSmallestCoveringSubtree(JSModule parentTree, BitSet dependentModules) {
checkState(!dependentModules.isEmpty());
// Candidate modules are those that all of the given dependent modules depend on, including
// themselves. The dependent module with the smallest index might be our answer, if... | java | public JSModule getSmallestCoveringSubtree(JSModule parentTree, BitSet dependentModules) {
checkState(!dependentModules.isEmpty());
// Candidate modules are those that all of the given dependent modules depend on, including
// themselves. The dependent module with the smallest index might be our answer, if... | [
"public",
"JSModule",
"getSmallestCoveringSubtree",
"(",
"JSModule",
"parentTree",
",",
"BitSet",
"dependentModules",
")",
"{",
"checkState",
"(",
"!",
"dependentModules",
".",
"isEmpty",
"(",
")",
")",
";",
"// Candidate modules are those that all of the given dependent mo... | Finds the module with the fewest transitive dependents on which all of the given modules depend
and that is a subtree of the given parent module tree.
<p>If no such subtree can be found, the parent module is returned.
<p>If multiple candidates have the same number of dependents, the module farthest down in the
total ... | [
"Finds",
"the",
"module",
"with",
"the",
"fewest",
"transitive",
"dependents",
"on",
"which",
"all",
"of",
"the",
"given",
"modules",
"depend",
"and",
"that",
"is",
"a",
"subtree",
"of",
"the",
"given",
"parent",
"module",
"tree",
"."
] | d81e36740f6a9e8ac31a825ee8758182e1dc5aae | https://github.com/google/closure-compiler/blob/d81e36740f6a9e8ac31a825ee8758182e1dc5aae/src/com/google/javascript/jscomp/JSModuleGraph.java#L356-L395 |
24,803 | google/closure-compiler | src/com/google/javascript/jscomp/JSModuleGraph.java | JSModuleGraph.getDeepestCommonDependency | JSModule getDeepestCommonDependency(JSModule m1, JSModule m2) {
int m1Depth = m1.getDepth();
int m2Depth = m2.getDepth();
// According our definition of depth, the result must have a strictly
// smaller depth than either m1 or m2.
for (int depth = Math.min(m1Depth, m2Depth) - 1; depth >= 0; depth--)... | java | JSModule getDeepestCommonDependency(JSModule m1, JSModule m2) {
int m1Depth = m1.getDepth();
int m2Depth = m2.getDepth();
// According our definition of depth, the result must have a strictly
// smaller depth than either m1 or m2.
for (int depth = Math.min(m1Depth, m2Depth) - 1; depth >= 0; depth--)... | [
"JSModule",
"getDeepestCommonDependency",
"(",
"JSModule",
"m1",
",",
"JSModule",
"m2",
")",
"{",
"int",
"m1Depth",
"=",
"m1",
".",
"getDepth",
"(",
")",
";",
"int",
"m2Depth",
"=",
"m2",
".",
"getDepth",
"(",
")",
";",
"// According our definition of depth, t... | Finds the deepest common dependency of two modules, not including the two
modules themselves.
@param m1 A module in this graph
@param m2 A module in this graph
@return The deepest common dep of {@code m1} and {@code m2}, or null if
they have no common dependencies | [
"Finds",
"the",
"deepest",
"common",
"dependency",
"of",
"two",
"modules",
"not",
"including",
"the",
"two",
"modules",
"themselves",
"."
] | d81e36740f6a9e8ac31a825ee8758182e1dc5aae | https://github.com/google/closure-compiler/blob/d81e36740f6a9e8ac31a825ee8758182e1dc5aae/src/com/google/javascript/jscomp/JSModuleGraph.java#L406-L423 |
24,804 | google/closure-compiler | src/com/google/javascript/jscomp/JSModuleGraph.java | JSModuleGraph.getDeepestCommonDependencyInclusive | public JSModule getDeepestCommonDependencyInclusive(
JSModule m1, JSModule m2) {
if (m2 == m1 || dependsOn(m2, m1)) {
return m1;
} else if (dependsOn(m1, m2)) {
return m2;
}
return getDeepestCommonDependency(m1, m2);
} | java | public JSModule getDeepestCommonDependencyInclusive(
JSModule m1, JSModule m2) {
if (m2 == m1 || dependsOn(m2, m1)) {
return m1;
} else if (dependsOn(m1, m2)) {
return m2;
}
return getDeepestCommonDependency(m1, m2);
} | [
"public",
"JSModule",
"getDeepestCommonDependencyInclusive",
"(",
"JSModule",
"m1",
",",
"JSModule",
"m2",
")",
"{",
"if",
"(",
"m2",
"==",
"m1",
"||",
"dependsOn",
"(",
"m2",
",",
"m1",
")",
")",
"{",
"return",
"m1",
";",
"}",
"else",
"if",
"(",
"depe... | Finds the deepest common dependency of two modules, including the
modules themselves.
@param m1 A module in this graph
@param m2 A module in this graph
@return The deepest common dep of {@code m1} and {@code m2}, or null if
they have no common dependencies | [
"Finds",
"the",
"deepest",
"common",
"dependency",
"of",
"two",
"modules",
"including",
"the",
"modules",
"themselves",
"."
] | d81e36740f6a9e8ac31a825ee8758182e1dc5aae | https://github.com/google/closure-compiler/blob/d81e36740f6a9e8ac31a825ee8758182e1dc5aae/src/com/google/javascript/jscomp/JSModuleGraph.java#L434-L443 |
24,805 | google/closure-compiler | src/com/google/javascript/jscomp/JSModuleGraph.java | JSModuleGraph.getDeepestCommonDependencyInclusive | public JSModule getDeepestCommonDependencyInclusive(
Collection<JSModule> modules) {
Iterator<JSModule> iter = modules.iterator();
JSModule dep = iter.next();
while (iter.hasNext()) {
dep = getDeepestCommonDependencyInclusive(dep, iter.next());
}
return dep;
} | java | public JSModule getDeepestCommonDependencyInclusive(
Collection<JSModule> modules) {
Iterator<JSModule> iter = modules.iterator();
JSModule dep = iter.next();
while (iter.hasNext()) {
dep = getDeepestCommonDependencyInclusive(dep, iter.next());
}
return dep;
} | [
"public",
"JSModule",
"getDeepestCommonDependencyInclusive",
"(",
"Collection",
"<",
"JSModule",
">",
"modules",
")",
"{",
"Iterator",
"<",
"JSModule",
">",
"iter",
"=",
"modules",
".",
"iterator",
"(",
")",
";",
"JSModule",
"dep",
"=",
"iter",
".",
"next",
... | Returns the deepest common dependency of the given modules. | [
"Returns",
"the",
"deepest",
"common",
"dependency",
"of",
"the",
"given",
"modules",
"."
] | d81e36740f6a9e8ac31a825ee8758182e1dc5aae | https://github.com/google/closure-compiler/blob/d81e36740f6a9e8ac31a825ee8758182e1dc5aae/src/com/google/javascript/jscomp/JSModuleGraph.java#L446-L454 |
24,806 | google/closure-compiler | src/com/google/javascript/jscomp/JSModuleGraph.java | JSModuleGraph.getTransitiveDeps | private Set<JSModule> getTransitiveDeps(JSModule m) {
Set<JSModule> deps = dependencyMap.computeIfAbsent(m, JSModule::getAllDependencies);
return deps;
} | java | private Set<JSModule> getTransitiveDeps(JSModule m) {
Set<JSModule> deps = dependencyMap.computeIfAbsent(m, JSModule::getAllDependencies);
return deps;
} | [
"private",
"Set",
"<",
"JSModule",
">",
"getTransitiveDeps",
"(",
"JSModule",
"m",
")",
"{",
"Set",
"<",
"JSModule",
">",
"deps",
"=",
"dependencyMap",
".",
"computeIfAbsent",
"(",
"m",
",",
"JSModule",
"::",
"getAllDependencies",
")",
";",
"return",
"deps",... | Returns the transitive dependencies of the module. | [
"Returns",
"the",
"transitive",
"dependencies",
"of",
"the",
"module",
"."
] | d81e36740f6a9e8ac31a825ee8758182e1dc5aae | https://github.com/google/closure-compiler/blob/d81e36740f6a9e8ac31a825ee8758182e1dc5aae/src/com/google/javascript/jscomp/JSModuleGraph.java#L470-L473 |
24,807 | google/closure-compiler | src/com/google/javascript/jscomp/JSModuleGraph.java | JSModuleGraph.getDepthFirstDependenciesOf | private List<CompilerInput> getDepthFirstDependenciesOf(
CompilerInput rootInput,
Set<CompilerInput> unreachedInputs,
Map<String, CompilerInput> inputsByProvide) {
List<CompilerInput> orderedInputs = new ArrayList<>();
if (!unreachedInputs.remove(rootInput)) {
return orderedInputs;
}... | java | private List<CompilerInput> getDepthFirstDependenciesOf(
CompilerInput rootInput,
Set<CompilerInput> unreachedInputs,
Map<String, CompilerInput> inputsByProvide) {
List<CompilerInput> orderedInputs = new ArrayList<>();
if (!unreachedInputs.remove(rootInput)) {
return orderedInputs;
}... | [
"private",
"List",
"<",
"CompilerInput",
">",
"getDepthFirstDependenciesOf",
"(",
"CompilerInput",
"rootInput",
",",
"Set",
"<",
"CompilerInput",
">",
"unreachedInputs",
",",
"Map",
"<",
"String",
",",
"CompilerInput",
">",
"inputsByProvide",
")",
"{",
"List",
"<"... | Given an input and set of unprocessed inputs, return the input and it's strong dependencies by
performing a recursive, depth-first traversal. | [
"Given",
"an",
"input",
"and",
"set",
"of",
"unprocessed",
"inputs",
"return",
"the",
"input",
"and",
"it",
"s",
"strong",
"dependencies",
"by",
"performing",
"a",
"recursive",
"depth",
"-",
"first",
"traversal",
"."
] | d81e36740f6a9e8ac31a825ee8758182e1dc5aae | https://github.com/google/closure-compiler/blob/d81e36740f6a9e8ac31a825ee8758182e1dc5aae/src/com/google/javascript/jscomp/JSModuleGraph.java#L644-L668 |
24,808 | google/closure-compiler | src/com/google/javascript/jscomp/MustBeReachingVariableDef.java | MustBeReachingVariableDef.computeDependence | private void computeDependence(final Definition def, Node rValue) {
NodeTraversal.traverse(
compiler,
rValue,
new AbstractCfgNodeTraversalCallback() {
@Override
public void visit(NodeTraversal t, Node n, Node parent) {
if (n.isName()) {
Var dep =... | java | private void computeDependence(final Definition def, Node rValue) {
NodeTraversal.traverse(
compiler,
rValue,
new AbstractCfgNodeTraversalCallback() {
@Override
public void visit(NodeTraversal t, Node n, Node parent) {
if (n.isName()) {
Var dep =... | [
"private",
"void",
"computeDependence",
"(",
"final",
"Definition",
"def",
",",
"Node",
"rValue",
")",
"{",
"NodeTraversal",
".",
"traverse",
"(",
"compiler",
",",
"rValue",
",",
"new",
"AbstractCfgNodeTraversalCallback",
"(",
")",
"{",
"@",
"Override",
"public"... | Computes all the local variables that rValue reads from and store that
in the def's depends set. | [
"Computes",
"all",
"the",
"local",
"variables",
"that",
"rValue",
"reads",
"from",
"and",
"store",
"that",
"in",
"the",
"def",
"s",
"depends",
"set",
"."
] | d81e36740f6a9e8ac31a825ee8758182e1dc5aae | https://github.com/google/closure-compiler/blob/d81e36740f6a9e8ac31a825ee8758182e1dc5aae/src/com/google/javascript/jscomp/MustBeReachingVariableDef.java#L442-L459 |
24,809 | google/closure-compiler | src/com/google/javascript/jscomp/MustBeReachingVariableDef.java | MustBeReachingVariableDef.getDef | Definition getDef(String name, Node useNode) {
checkArgument(getCfg().hasNode(useNode));
GraphNode<Node, Branch> n = getCfg().getNode(useNode);
FlowState<MustDef> state = n.getAnnotation();
return state.getIn().reachingDef.get(allVarsInFn.get(name));
} | java | Definition getDef(String name, Node useNode) {
checkArgument(getCfg().hasNode(useNode));
GraphNode<Node, Branch> n = getCfg().getNode(useNode);
FlowState<MustDef> state = n.getAnnotation();
return state.getIn().reachingDef.get(allVarsInFn.get(name));
} | [
"Definition",
"getDef",
"(",
"String",
"name",
",",
"Node",
"useNode",
")",
"{",
"checkArgument",
"(",
"getCfg",
"(",
")",
".",
"hasNode",
"(",
"useNode",
")",
")",
";",
"GraphNode",
"<",
"Node",
",",
"Branch",
">",
"n",
"=",
"getCfg",
"(",
")",
".",... | Gets the must reaching definition of a given node.
@param name name of the variable. It can only be names of local variable
that are not function parameters, escaped variables or variables
declared in catch.
@param useNode the location of the use where the definition reaches. | [
"Gets",
"the",
"must",
"reaching",
"definition",
"of",
"a",
"given",
"node",
"."
] | d81e36740f6a9e8ac31a825ee8758182e1dc5aae | https://github.com/google/closure-compiler/blob/d81e36740f6a9e8ac31a825ee8758182e1dc5aae/src/com/google/javascript/jscomp/MustBeReachingVariableDef.java#L469-L474 |
24,810 | google/closure-compiler | src/com/google/javascript/jscomp/deps/ClosureBundler.java | ClosureBundler.appendTo | public void appendTo(
Appendable out,
DependencyInfo info,
File content, Charset contentCharset) throws IOException {
appendTo(out, info, Files.asCharSource(content, contentCharset));
} | java | public void appendTo(
Appendable out,
DependencyInfo info,
File content, Charset contentCharset) throws IOException {
appendTo(out, info, Files.asCharSource(content, contentCharset));
} | [
"public",
"void",
"appendTo",
"(",
"Appendable",
"out",
",",
"DependencyInfo",
"info",
",",
"File",
"content",
",",
"Charset",
"contentCharset",
")",
"throws",
"IOException",
"{",
"appendTo",
"(",
"out",
",",
"info",
",",
"Files",
".",
"asCharSource",
"(",
"... | Append the contents of the file to the supplied appendable. | [
"Append",
"the",
"contents",
"of",
"the",
"file",
"to",
"the",
"supplied",
"appendable",
"."
] | d81e36740f6a9e8ac31a825ee8758182e1dc5aae | https://github.com/google/closure-compiler/blob/d81e36740f6a9e8ac31a825ee8758182e1dc5aae/src/com/google/javascript/jscomp/deps/ClosureBundler.java#L129-L134 |
24,811 | google/closure-compiler | src/com/google/javascript/jscomp/deps/ClosureBundler.java | ClosureBundler.appendTo | public void appendTo(
Appendable out,
DependencyInfo info,
CharSource content) throws IOException {
if (info.isModule()) {
mode.appendGoogModule(transpile(content.read()), out, sourceUrl);
} else if ("es6".equals(info.getLoadFlags().get("module")) && transpiler == Transpiler.NULL) {
... | java | public void appendTo(
Appendable out,
DependencyInfo info,
CharSource content) throws IOException {
if (info.isModule()) {
mode.appendGoogModule(transpile(content.read()), out, sourceUrl);
} else if ("es6".equals(info.getLoadFlags().get("module")) && transpiler == Transpiler.NULL) {
... | [
"public",
"void",
"appendTo",
"(",
"Appendable",
"out",
",",
"DependencyInfo",
"info",
",",
"CharSource",
"content",
")",
"throws",
"IOException",
"{",
"if",
"(",
"info",
".",
"isModule",
"(",
")",
")",
"{",
"mode",
".",
"appendGoogModule",
"(",
"transpile",... | Append the contents of the CharSource to the supplied appendable. | [
"Append",
"the",
"contents",
"of",
"the",
"CharSource",
"to",
"the",
"supplied",
"appendable",
"."
] | d81e36740f6a9e8ac31a825ee8758182e1dc5aae | https://github.com/google/closure-compiler/blob/d81e36740f6a9e8ac31a825ee8758182e1dc5aae/src/com/google/javascript/jscomp/deps/ClosureBundler.java#L137-L151 |
24,812 | google/closure-compiler | src/com/google/javascript/jscomp/PolymerBehaviorExtractor.java | PolymerBehaviorExtractor.resolveBehaviorName | @Nullable
private ResolveBehaviorNameResult resolveBehaviorName(Node nameNode) {
String name = getQualifiedNameThroughCast(nameNode);
if (name == null) {
return null;
}
Name globalName = globalNames.getSlot(name);
if (globalName == null) {
return null;
}
boolean isGlobalDeclar... | java | @Nullable
private ResolveBehaviorNameResult resolveBehaviorName(Node nameNode) {
String name = getQualifiedNameThroughCast(nameNode);
if (name == null) {
return null;
}
Name globalName = globalNames.getSlot(name);
if (globalName == null) {
return null;
}
boolean isGlobalDeclar... | [
"@",
"Nullable",
"private",
"ResolveBehaviorNameResult",
"resolveBehaviorName",
"(",
"Node",
"nameNode",
")",
"{",
"String",
"name",
"=",
"getQualifiedNameThroughCast",
"(",
"nameNode",
")",
";",
"if",
"(",
"name",
"==",
"null",
")",
"{",
"return",
"null",
";",
... | Resolve an identifier, which is presumed to refer to a Polymer Behavior declaration, using the
global namespace. Recurses to resolve assignment chains of any length.
@param nameNode The NAME, GETPROP, or CAST node containing the identifier.
@return The behavior declaration node, or null if it couldn't be resolved. | [
"Resolve",
"an",
"identifier",
"which",
"is",
"presumed",
"to",
"refer",
"to",
"a",
"Polymer",
"Behavior",
"declaration",
"using",
"the",
"global",
"namespace",
".",
"Recurses",
"to",
"resolve",
"assignment",
"chains",
"of",
"any",
"length",
"."
] | d81e36740f6a9e8ac31a825ee8758182e1dc5aae | https://github.com/google/closure-compiler/blob/d81e36740f6a9e8ac31a825ee8758182e1dc5aae/src/com/google/javascript/jscomp/PolymerBehaviorExtractor.java#L143-L192 |
24,813 | google/closure-compiler | src/com/google/javascript/jscomp/CheckConformance.java | CheckConformance.initRules | private static ImmutableList<Rule> initRules(
AbstractCompiler compiler, ImmutableList<ConformanceConfig> configs) {
ImmutableList.Builder<Rule> builder = ImmutableList.builder();
List<Requirement> requirements = mergeRequirements(compiler, configs);
for (Requirement requirement : requirements) {
... | java | private static ImmutableList<Rule> initRules(
AbstractCompiler compiler, ImmutableList<ConformanceConfig> configs) {
ImmutableList.Builder<Rule> builder = ImmutableList.builder();
List<Requirement> requirements = mergeRequirements(compiler, configs);
for (Requirement requirement : requirements) {
... | [
"private",
"static",
"ImmutableList",
"<",
"Rule",
">",
"initRules",
"(",
"AbstractCompiler",
"compiler",
",",
"ImmutableList",
"<",
"ConformanceConfig",
">",
"configs",
")",
"{",
"ImmutableList",
".",
"Builder",
"<",
"Rule",
">",
"builder",
"=",
"ImmutableList",
... | Build the data structures need by this pass from the provided
configurations. | [
"Build",
"the",
"data",
"structures",
"need",
"by",
"this",
"pass",
"from",
"the",
"provided",
"configurations",
"."
] | d81e36740f6a9e8ac31a825ee8758182e1dc5aae | https://github.com/google/closure-compiler/blob/d81e36740f6a9e8ac31a825ee8758182e1dc5aae/src/com/google/javascript/jscomp/CheckConformance.java#L106-L117 |
24,814 | google/closure-compiler | src/com/google/javascript/jscomp/CheckConformance.java | CheckConformance.mergeRequirements | static List<Requirement> mergeRequirements(AbstractCompiler compiler,
List<ConformanceConfig> configs) {
List<Requirement.Builder> builders = new ArrayList<>();
Map<String, Requirement.Builder> extendable = new HashMap<>();
for (ConformanceConfig config : configs) {
for (Requirement requirement ... | java | static List<Requirement> mergeRequirements(AbstractCompiler compiler,
List<ConformanceConfig> configs) {
List<Requirement.Builder> builders = new ArrayList<>();
Map<String, Requirement.Builder> extendable = new HashMap<>();
for (ConformanceConfig config : configs) {
for (Requirement requirement ... | [
"static",
"List",
"<",
"Requirement",
">",
"mergeRequirements",
"(",
"AbstractCompiler",
"compiler",
",",
"List",
"<",
"ConformanceConfig",
">",
"configs",
")",
"{",
"List",
"<",
"Requirement",
".",
"Builder",
">",
"builders",
"=",
"new",
"ArrayList",
"<>",
"(... | Gets requirements from all configs. Merges whitelists of requirements with 'extends' equal to
'rule_id' of other rule. | [
"Gets",
"requirements",
"from",
"all",
"configs",
".",
"Merges",
"whitelists",
"of",
"requirements",
"with",
"extends",
"equal",
"to",
"rule_id",
"of",
"other",
"rule",
"."
] | d81e36740f6a9e8ac31a825ee8758182e1dc5aae | https://github.com/google/closure-compiler/blob/d81e36740f6a9e8ac31a825ee8758182e1dc5aae/src/com/google/javascript/jscomp/CheckConformance.java#L127-L182 |
24,815 | google/closure-compiler | src/com/google/javascript/jscomp/deps/JsFileParser.java | JsFileParser.parseFile | public DependencyInfo parseFile(String filePath, String closureRelativePath,
String fileContents) {
return parseReader(filePath, closureRelativePath, new StringReader(fileContents));
} | java | public DependencyInfo parseFile(String filePath, String closureRelativePath,
String fileContents) {
return parseReader(filePath, closureRelativePath, new StringReader(fileContents));
} | [
"public",
"DependencyInfo",
"parseFile",
"(",
"String",
"filePath",
",",
"String",
"closureRelativePath",
",",
"String",
"fileContents",
")",
"{",
"return",
"parseReader",
"(",
"filePath",
",",
"closureRelativePath",
",",
"new",
"StringReader",
"(",
"fileContents",
... | Parses the given file and returns the dependency information that it
contained.
@param filePath Path to the file to parse.
@param closureRelativePath Path of the file relative to closure.
@param fileContents The contents to parse.
@return A DependencyInfo containing all provides/requires found in the
file. | [
"Parses",
"the",
"given",
"file",
"and",
"returns",
"the",
"dependency",
"information",
"that",
"it",
"contained",
"."
] | d81e36740f6a9e8ac31a825ee8758182e1dc5aae | https://github.com/google/closure-compiler/blob/d81e36740f6a9e8ac31a825ee8758182e1dc5aae/src/com/google/javascript/jscomp/deps/JsFileParser.java#L180-L183 |
24,816 | google/closure-compiler | src/com/google/javascript/jscomp/deps/JsFileParser.java | JsFileParser.parseLine | @Override
protected boolean parseLine(String line) throws ParseException {
boolean lineHasProvidesOrRequires = false;
if (line.startsWith(BUNDLED_GOOG_MODULE_START)) {
seenLoadModule = true;
}
// Quick check that will catch most cases. This is a performance win for teams with a lot of JS.
... | java | @Override
protected boolean parseLine(String line) throws ParseException {
boolean lineHasProvidesOrRequires = false;
if (line.startsWith(BUNDLED_GOOG_MODULE_START)) {
seenLoadModule = true;
}
// Quick check that will catch most cases. This is a performance win for teams with a lot of JS.
... | [
"@",
"Override",
"protected",
"boolean",
"parseLine",
"(",
"String",
"line",
")",
"throws",
"ParseException",
"{",
"boolean",
"lineHasProvidesOrRequires",
"=",
"false",
";",
"if",
"(",
"line",
".",
"startsWith",
"(",
"BUNDLED_GOOG_MODULE_START",
")",
")",
"{",
"... | Parses a line of JavaScript, extracting goog.provide and goog.require information. | [
"Parses",
"a",
"line",
"of",
"JavaScript",
"extracting",
"goog",
".",
"provide",
"and",
"goog",
".",
"require",
"information",
"."
] | d81e36740f6a9e8ac31a825ee8758182e1dc5aae | https://github.com/google/closure-compiler/blob/d81e36740f6a9e8ac31a825ee8758182e1dc5aae/src/com/google/javascript/jscomp/deps/JsFileParser.java#L283-L376 |
24,817 | google/closure-compiler | src/com/google/javascript/jscomp/RuntimeTypeCheck.java | RuntimeTypeCheck.paramNamesOf | private static ImmutableList<Node> paramNamesOf(Node paramList) {
checkArgument(paramList.isParamList(), paramList);
ImmutableList.Builder<Node> builder = ImmutableList.builder();
paramNamesOf(paramList, builder);
return builder.build();
} | java | private static ImmutableList<Node> paramNamesOf(Node paramList) {
checkArgument(paramList.isParamList(), paramList);
ImmutableList.Builder<Node> builder = ImmutableList.builder();
paramNamesOf(paramList, builder);
return builder.build();
} | [
"private",
"static",
"ImmutableList",
"<",
"Node",
">",
"paramNamesOf",
"(",
"Node",
"paramList",
")",
"{",
"checkArgument",
"(",
"paramList",
".",
"isParamList",
"(",
")",
",",
"paramList",
")",
";",
"ImmutableList",
".",
"Builder",
"<",
"Node",
">",
"build... | Returns the NAME parameter nodes of a FUNCTION.
<p>This lookup abstracts over the other legal node types in a PARAM_LIST. It includes only
those nodes that declare bindings within the function body. | [
"Returns",
"the",
"NAME",
"parameter",
"nodes",
"of",
"a",
"FUNCTION",
"."
] | d81e36740f6a9e8ac31a825ee8758182e1dc5aae | https://github.com/google/closure-compiler/blob/d81e36740f6a9e8ac31a825ee8758182e1dc5aae/src/com/google/javascript/jscomp/RuntimeTypeCheck.java#L429-L435 |
24,818 | google/closure-compiler | src/com/google/javascript/jscomp/RuntimeTypeCheck.java | RuntimeTypeCheck.paramNamesOf | private static void paramNamesOf(Node node, ImmutableList.Builder<Node> names) {
switch (node.getToken()) {
case NAME:
names.add(node);
break;
case REST:
case DEFAULT_VALUE:
paramNamesOf(node.getFirstChild(), names);
break;
case PARAM_LIST:
case ARRAY_... | java | private static void paramNamesOf(Node node, ImmutableList.Builder<Node> names) {
switch (node.getToken()) {
case NAME:
names.add(node);
break;
case REST:
case DEFAULT_VALUE:
paramNamesOf(node.getFirstChild(), names);
break;
case PARAM_LIST:
case ARRAY_... | [
"private",
"static",
"void",
"paramNamesOf",
"(",
"Node",
"node",
",",
"ImmutableList",
".",
"Builder",
"<",
"Node",
">",
"names",
")",
"{",
"switch",
"(",
"node",
".",
"getToken",
"(",
")",
")",
"{",
"case",
"NAME",
":",
"names",
".",
"add",
"(",
"n... | Recursively collects the NAME parameter nodes of a FUNCTION.
<p>This lookup abstracts over the other legal node types in a PARAM_LIST. It includes only
those nodes that declare bindings within the function body. | [
"Recursively",
"collects",
"the",
"NAME",
"parameter",
"nodes",
"of",
"a",
"FUNCTION",
"."
] | d81e36740f6a9e8ac31a825ee8758182e1dc5aae | https://github.com/google/closure-compiler/blob/d81e36740f6a9e8ac31a825ee8758182e1dc5aae/src/com/google/javascript/jscomp/RuntimeTypeCheck.java#L443-L472 |
24,819 | google/closure-compiler | src/com/google/javascript/jscomp/CompilerOptions.java | CompilerOptions.setIdGenerators | public void setIdGenerators(Set<String> idGenerators) {
RenamingMap gen = new UniqueRenamingToken();
ImmutableMap.Builder<String, RenamingMap> builder = ImmutableMap.builder();
for (String name : idGenerators) {
builder.put(name, gen);
}
this.idGenerators = builder.build();
} | java | public void setIdGenerators(Set<String> idGenerators) {
RenamingMap gen = new UniqueRenamingToken();
ImmutableMap.Builder<String, RenamingMap> builder = ImmutableMap.builder();
for (String name : idGenerators) {
builder.put(name, gen);
}
this.idGenerators = builder.build();
} | [
"public",
"void",
"setIdGenerators",
"(",
"Set",
"<",
"String",
">",
"idGenerators",
")",
"{",
"RenamingMap",
"gen",
"=",
"new",
"UniqueRenamingToken",
"(",
")",
";",
"ImmutableMap",
".",
"Builder",
"<",
"String",
",",
"RenamingMap",
">",
"builder",
"=",
"Im... | Sets the id generators to replace. | [
"Sets",
"the",
"id",
"generators",
"to",
"replace",
"."
] | d81e36740f6a9e8ac31a825ee8758182e1dc5aae | https://github.com/google/closure-compiler/blob/d81e36740f6a9e8ac31a825ee8758182e1dc5aae/src/com/google/javascript/jscomp/CompilerOptions.java#L1549-L1556 |
24,820 | google/closure-compiler | src/com/google/javascript/jscomp/CompilerOptions.java | CompilerOptions.setInlineVariables | public void setInlineVariables(Reach reach) {
switch (reach) {
case ALL:
this.inlineVariables = true;
this.inlineLocalVariables = true;
break;
case LOCAL_ONLY:
this.inlineVariables = false;
this.inlineLocalVariables = true;
break;
case NONE:
... | java | public void setInlineVariables(Reach reach) {
switch (reach) {
case ALL:
this.inlineVariables = true;
this.inlineLocalVariables = true;
break;
case LOCAL_ONLY:
this.inlineVariables = false;
this.inlineLocalVariables = true;
break;
case NONE:
... | [
"public",
"void",
"setInlineVariables",
"(",
"Reach",
"reach",
")",
"{",
"switch",
"(",
"reach",
")",
"{",
"case",
"ALL",
":",
"this",
".",
"inlineVariables",
"=",
"true",
";",
"this",
".",
"inlineLocalVariables",
"=",
"true",
";",
"break",
";",
"case",
... | Set the variable inlining policy for the compiler. | [
"Set",
"the",
"variable",
"inlining",
"policy",
"for",
"the",
"compiler",
"."
] | d81e36740f6a9e8ac31a825ee8758182e1dc5aae | https://github.com/google/closure-compiler/blob/d81e36740f6a9e8ac31a825ee8758182e1dc5aae/src/com/google/javascript/jscomp/CompilerOptions.java#L1615-L1632 |
24,821 | google/closure-compiler | src/com/google/javascript/jscomp/CompilerOptions.java | CompilerOptions.setRemoveUnusedVariables | public void setRemoveUnusedVariables(Reach reach) {
switch (reach) {
case ALL:
this.removeUnusedVars = true;
this.removeUnusedLocalVars = true;
break;
case LOCAL_ONLY:
this.removeUnusedVars = false;
this.removeUnusedLocalVars = true;
break;
case NONE... | java | public void setRemoveUnusedVariables(Reach reach) {
switch (reach) {
case ALL:
this.removeUnusedVars = true;
this.removeUnusedLocalVars = true;
break;
case LOCAL_ONLY:
this.removeUnusedVars = false;
this.removeUnusedLocalVars = true;
break;
case NONE... | [
"public",
"void",
"setRemoveUnusedVariables",
"(",
"Reach",
"reach",
")",
"{",
"switch",
"(",
"reach",
")",
"{",
"case",
"ALL",
":",
"this",
".",
"removeUnusedVars",
"=",
"true",
";",
"this",
".",
"removeUnusedLocalVars",
"=",
"true",
";",
"break",
";",
"c... | Set the variable removal policy for the compiler. | [
"Set",
"the",
"variable",
"removal",
"policy",
"for",
"the",
"compiler",
"."
] | d81e36740f6a9e8ac31a825ee8758182e1dc5aae | https://github.com/google/closure-compiler/blob/d81e36740f6a9e8ac31a825ee8758182e1dc5aae/src/com/google/javascript/jscomp/CompilerOptions.java#L1648-L1665 |
24,822 | google/closure-compiler | src/com/google/javascript/jscomp/CompilerOptions.java | CompilerOptions.setReplaceStringsConfiguration | public void setReplaceStringsConfiguration(
String placeholderToken, List<String> functionDescriptors) {
this.replaceStringsPlaceholderToken = placeholderToken;
this.replaceStringsFunctionDescriptions =
new ArrayList<>(functionDescriptors);
} | java | public void setReplaceStringsConfiguration(
String placeholderToken, List<String> functionDescriptors) {
this.replaceStringsPlaceholderToken = placeholderToken;
this.replaceStringsFunctionDescriptions =
new ArrayList<>(functionDescriptors);
} | [
"public",
"void",
"setReplaceStringsConfiguration",
"(",
"String",
"placeholderToken",
",",
"List",
"<",
"String",
">",
"functionDescriptors",
")",
"{",
"this",
".",
"replaceStringsPlaceholderToken",
"=",
"placeholderToken",
";",
"this",
".",
"replaceStringsFunctionDescri... | Sets the functions whose debug strings to replace. | [
"Sets",
"the",
"functions",
"whose",
"debug",
"strings",
"to",
"replace",
"."
] | d81e36740f6a9e8ac31a825ee8758182e1dc5aae | https://github.com/google/closure-compiler/blob/d81e36740f6a9e8ac31a825ee8758182e1dc5aae/src/com/google/javascript/jscomp/CompilerOptions.java#L1670-L1675 |
24,823 | google/closure-compiler | src/com/google/javascript/jscomp/CompilerOptions.java | CompilerOptions.setLanguage | public void setLanguage(LanguageMode language) {
checkState(language != LanguageMode.NO_TRANSPILE);
checkState(language != LanguageMode.UNSUPPORTED);
this.setLanguageIn(language);
this.setLanguageOut(language);
} | java | public void setLanguage(LanguageMode language) {
checkState(language != LanguageMode.NO_TRANSPILE);
checkState(language != LanguageMode.UNSUPPORTED);
this.setLanguageIn(language);
this.setLanguageOut(language);
} | [
"public",
"void",
"setLanguage",
"(",
"LanguageMode",
"language",
")",
"{",
"checkState",
"(",
"language",
"!=",
"LanguageMode",
".",
"NO_TRANSPILE",
")",
";",
"checkState",
"(",
"language",
"!=",
"LanguageMode",
".",
"UNSUPPORTED",
")",
";",
"this",
".",
"set... | Sets ECMAScript version to use. | [
"Sets",
"ECMAScript",
"version",
"to",
"use",
"."
] | d81e36740f6a9e8ac31a825ee8758182e1dc5aae | https://github.com/google/closure-compiler/blob/d81e36740f6a9e8ac31a825ee8758182e1dc5aae/src/com/google/javascript/jscomp/CompilerOptions.java#L1822-L1827 |
24,824 | google/closure-compiler | src/com/google/javascript/jscomp/CompilerOptions.java | CompilerOptions.setLanguageOut | public void setLanguageOut(LanguageMode languageOut) {
checkState(languageOut != LanguageMode.UNSUPPORTED);
if (languageOut == LanguageMode.NO_TRANSPILE) {
languageOutIsDefaultStrict = Optional.absent();
outputFeatureSet = Optional.absent();
} else {
languageOut = languageOut == LanguageMo... | java | public void setLanguageOut(LanguageMode languageOut) {
checkState(languageOut != LanguageMode.UNSUPPORTED);
if (languageOut == LanguageMode.NO_TRANSPILE) {
languageOutIsDefaultStrict = Optional.absent();
outputFeatureSet = Optional.absent();
} else {
languageOut = languageOut == LanguageMo... | [
"public",
"void",
"setLanguageOut",
"(",
"LanguageMode",
"languageOut",
")",
"{",
"checkState",
"(",
"languageOut",
"!=",
"LanguageMode",
".",
"UNSUPPORTED",
")",
";",
"if",
"(",
"languageOut",
"==",
"LanguageMode",
".",
"NO_TRANSPILE",
")",
"{",
"languageOutIsDef... | Sets ECMAScript version to use for the output.
<p>If you are not transpiling from one version to another, use #setLanguage instead.
<p>If you you need something more fine grained (e.g. "ES2017 without modules") use
#setOutputFeatureSet. | [
"Sets",
"ECMAScript",
"version",
"to",
"use",
"for",
"the",
"output",
"."
] | d81e36740f6a9e8ac31a825ee8758182e1dc5aae | https://github.com/google/closure-compiler/blob/d81e36740f6a9e8ac31a825ee8758182e1dc5aae/src/com/google/javascript/jscomp/CompilerOptions.java#L1862-L1872 |
24,825 | google/closure-compiler | src/com/google/javascript/jscomp/CompilerOptions.java | CompilerOptions.setConformanceConfigs | @GwtIncompatible("Conformance")
public void setConformanceConfigs(List<ConformanceConfig> configs) {
this.conformanceConfigs =
ImmutableList.<ConformanceConfig>builder()
.add(ResourceLoader.loadGlobalConformance(CompilerOptions.class))
.addAll(configs)
.build();
} | java | @GwtIncompatible("Conformance")
public void setConformanceConfigs(List<ConformanceConfig> configs) {
this.conformanceConfigs =
ImmutableList.<ConformanceConfig>builder()
.add(ResourceLoader.loadGlobalConformance(CompilerOptions.class))
.addAll(configs)
.build();
} | [
"@",
"GwtIncompatible",
"(",
"\"Conformance\"",
")",
"public",
"void",
"setConformanceConfigs",
"(",
"List",
"<",
"ConformanceConfig",
">",
"configs",
")",
"{",
"this",
".",
"conformanceConfigs",
"=",
"ImmutableList",
".",
"<",
"ConformanceConfig",
">",
"builder",
... | Both enable and configure conformance checks, if non-null. | [
"Both",
"enable",
"and",
"configure",
"conformance",
"checks",
"if",
"non",
"-",
"null",
"."
] | d81e36740f6a9e8ac31a825ee8758182e1dc5aae | https://github.com/google/closure-compiler/blob/d81e36740f6a9e8ac31a825ee8758182e1dc5aae/src/com/google/javascript/jscomp/CompilerOptions.java#L2749-L2756 |
24,826 | google/closure-compiler | src/com/google/javascript/jscomp/CompilerOptions.java | CompilerOptions.serialize | @GwtIncompatible("ObjectOutputStream")
public void serialize(OutputStream objectOutputStream) throws IOException {
new java.io.ObjectOutputStream(objectOutputStream).writeObject(this);
} | java | @GwtIncompatible("ObjectOutputStream")
public void serialize(OutputStream objectOutputStream) throws IOException {
new java.io.ObjectOutputStream(objectOutputStream).writeObject(this);
} | [
"@",
"GwtIncompatible",
"(",
"\"ObjectOutputStream\"",
")",
"public",
"void",
"serialize",
"(",
"OutputStream",
"objectOutputStream",
")",
"throws",
"IOException",
"{",
"new",
"java",
".",
"io",
".",
"ObjectOutputStream",
"(",
"objectOutputStream",
")",
".",
"writeO... | Serializes compiler options to a stream. | [
"Serializes",
"compiler",
"options",
"to",
"a",
"stream",
"."
] | d81e36740f6a9e8ac31a825ee8758182e1dc5aae | https://github.com/google/closure-compiler/blob/d81e36740f6a9e8ac31a825ee8758182e1dc5aae/src/com/google/javascript/jscomp/CompilerOptions.java#L2818-L2821 |
24,827 | google/closure-compiler | src/com/google/javascript/jscomp/CompilerOptions.java | CompilerOptions.deserialize | @GwtIncompatible("ObjectInputStream")
public static CompilerOptions deserialize(InputStream objectInputStream)
throws IOException, ClassNotFoundException {
return (CompilerOptions) new java.io.ObjectInputStream(objectInputStream).readObject();
} | java | @GwtIncompatible("ObjectInputStream")
public static CompilerOptions deserialize(InputStream objectInputStream)
throws IOException, ClassNotFoundException {
return (CompilerOptions) new java.io.ObjectInputStream(objectInputStream).readObject();
} | [
"@",
"GwtIncompatible",
"(",
"\"ObjectInputStream\"",
")",
"public",
"static",
"CompilerOptions",
"deserialize",
"(",
"InputStream",
"objectInputStream",
")",
"throws",
"IOException",
",",
"ClassNotFoundException",
"{",
"return",
"(",
"CompilerOptions",
")",
"new",
"jav... | Deserializes compiler options from a stream. | [
"Deserializes",
"compiler",
"options",
"from",
"a",
"stream",
"."
] | d81e36740f6a9e8ac31a825ee8758182e1dc5aae | https://github.com/google/closure-compiler/blob/d81e36740f6a9e8ac31a825ee8758182e1dc5aae/src/com/google/javascript/jscomp/CompilerOptions.java#L2824-L2828 |
24,828 | google/closure-compiler | src/com/google/javascript/jscomp/J2clConstantHoisterPass.java | J2clConstantHoisterPass.isHoistableFunction | private static boolean isHoistableFunction(NodeTraversal t, Node node) {
// TODO(michaelthomas): This could be improved slightly by not assuming that any variable in the
// outer scope is used in the function.
return node.isFunction() && t.getScope().getVarCount() == 0;
} | java | private static boolean isHoistableFunction(NodeTraversal t, Node node) {
// TODO(michaelthomas): This could be improved slightly by not assuming that any variable in the
// outer scope is used in the function.
return node.isFunction() && t.getScope().getVarCount() == 0;
} | [
"private",
"static",
"boolean",
"isHoistableFunction",
"(",
"NodeTraversal",
"t",
",",
"Node",
"node",
")",
"{",
"// TODO(michaelthomas): This could be improved slightly by not assuming that any variable in the",
"// outer scope is used in the function.",
"return",
"node",
".",
"is... | Returns whether the specified rValue is a function which does not receive any variables from
its containing scope, and is thus 'hoistable'. | [
"Returns",
"whether",
"the",
"specified",
"rValue",
"is",
"a",
"function",
"which",
"does",
"not",
"receive",
"any",
"variables",
"from",
"its",
"containing",
"scope",
"and",
"is",
"thus",
"hoistable",
"."
] | d81e36740f6a9e8ac31a825ee8758182e1dc5aae | https://github.com/google/closure-compiler/blob/d81e36740f6a9e8ac31a825ee8758182e1dc5aae/src/com/google/javascript/jscomp/J2clConstantHoisterPass.java#L73-L77 |
24,829 | google/closure-compiler | src/com/google/javascript/jscomp/CreateSyntheticBlocks.java | CreateSyntheticBlocks.moveSiblingExclusive | private void moveSiblingExclusive(Node dest, Node start, Node end) {
checkNotNull(start);
checkNotNull(end);
while (start.getNext() != end) {
Node child = start.getNext().detach();
dest.addChildToBack(child);
}
} | java | private void moveSiblingExclusive(Node dest, Node start, Node end) {
checkNotNull(start);
checkNotNull(end);
while (start.getNext() != end) {
Node child = start.getNext().detach();
dest.addChildToBack(child);
}
} | [
"private",
"void",
"moveSiblingExclusive",
"(",
"Node",
"dest",
",",
"Node",
"start",
",",
"Node",
"end",
")",
"{",
"checkNotNull",
"(",
"start",
")",
";",
"checkNotNull",
"(",
"end",
")",
";",
"while",
"(",
"start",
".",
"getNext",
"(",
")",
"!=",
"en... | Move the Nodes between start and end from the source block to the
destination block. If start is null, move the first child of the block.
If end is null, move the last child of the block. | [
"Move",
"the",
"Nodes",
"between",
"start",
"and",
"end",
"from",
"the",
"source",
"block",
"to",
"the",
"destination",
"block",
".",
"If",
"start",
"is",
"null",
"move",
"the",
"first",
"child",
"of",
"the",
"block",
".",
"If",
"end",
"is",
"null",
"m... | d81e36740f6a9e8ac31a825ee8758182e1dc5aae | https://github.com/google/closure-compiler/blob/d81e36740f6a9e8ac31a825ee8758182e1dc5aae/src/com/google/javascript/jscomp/CreateSyntheticBlocks.java#L133-L140 |
24,830 | google/closure-compiler | src/com/google/javascript/jscomp/Es6RewriteModules.java | Es6RewriteModules.isEs6ModuleRoot | public static boolean isEs6ModuleRoot(Node scriptNode) {
checkArgument(scriptNode.isScript(), scriptNode);
if (scriptNode.getBooleanProp(Node.GOOG_MODULE)) {
return false;
}
return scriptNode.hasChildren() && scriptNode.getFirstChild().isModuleBody();
} | java | public static boolean isEs6ModuleRoot(Node scriptNode) {
checkArgument(scriptNode.isScript(), scriptNode);
if (scriptNode.getBooleanProp(Node.GOOG_MODULE)) {
return false;
}
return scriptNode.hasChildren() && scriptNode.getFirstChild().isModuleBody();
} | [
"public",
"static",
"boolean",
"isEs6ModuleRoot",
"(",
"Node",
"scriptNode",
")",
"{",
"checkArgument",
"(",
"scriptNode",
".",
"isScript",
"(",
")",
",",
"scriptNode",
")",
";",
"if",
"(",
"scriptNode",
".",
"getBooleanProp",
"(",
"Node",
".",
"GOOG_MODULE",
... | Return whether or not the given script node represents an ES6 module file. | [
"Return",
"whether",
"or",
"not",
"the",
"given",
"script",
"node",
"represents",
"an",
"ES6",
"module",
"file",
"."
] | d81e36740f6a9e8ac31a825ee8758182e1dc5aae | https://github.com/google/closure-compiler/blob/d81e36740f6a9e8ac31a825ee8758182e1dc5aae/src/com/google/javascript/jscomp/Es6RewriteModules.java#L150-L156 |
24,831 | google/closure-compiler | src/com/google/javascript/jscomp/Es6RewriteModules.java | Es6RewriteModules.processFile | private void processFile(Node root) {
checkArgument(isEs6ModuleRoot(root), root);
clearState();
root.putBooleanProp(Node.TRANSPILED, true);
NodeTraversal.traverse(compiler, root, this);
} | java | private void processFile(Node root) {
checkArgument(isEs6ModuleRoot(root), root);
clearState();
root.putBooleanProp(Node.TRANSPILED, true);
NodeTraversal.traverse(compiler, root, this);
} | [
"private",
"void",
"processFile",
"(",
"Node",
"root",
")",
"{",
"checkArgument",
"(",
"isEs6ModuleRoot",
"(",
"root",
")",
",",
"root",
")",
";",
"clearState",
"(",
")",
";",
"root",
".",
"putBooleanProp",
"(",
"Node",
".",
"TRANSPILED",
",",
"true",
")... | Rewrite a single ES6 module file to a global script version. | [
"Rewrite",
"a",
"single",
"ES6",
"module",
"file",
"to",
"a",
"global",
"script",
"version",
"."
] | d81e36740f6a9e8ac31a825ee8758182e1dc5aae | https://github.com/google/closure-compiler/blob/d81e36740f6a9e8ac31a825ee8758182e1dc5aae/src/com/google/javascript/jscomp/Es6RewriteModules.java#L182-L187 |
24,832 | google/closure-compiler | src/com/google/javascript/jscomp/Es6RewriteModules.java | Es6RewriteModules.getFallbackMetadataForNamespace | private ModuleMetadata getFallbackMetadataForNamespace(String namespace) {
// Assume a provide'd file to be consistent with goog.module rewriting.
ModuleMetadata.Builder builder =
ModuleMetadata.builder()
.moduleType(ModuleMetadataMap.ModuleType.GOOG_PROVIDE)
.usesClosure(true)
... | java | private ModuleMetadata getFallbackMetadataForNamespace(String namespace) {
// Assume a provide'd file to be consistent with goog.module rewriting.
ModuleMetadata.Builder builder =
ModuleMetadata.builder()
.moduleType(ModuleMetadataMap.ModuleType.GOOG_PROVIDE)
.usesClosure(true)
... | [
"private",
"ModuleMetadata",
"getFallbackMetadataForNamespace",
"(",
"String",
"namespace",
")",
"{",
"// Assume a provide'd file to be consistent with goog.module rewriting.",
"ModuleMetadata",
".",
"Builder",
"builder",
"=",
"ModuleMetadata",
".",
"builder",
"(",
")",
".",
... | Gets some made-up metadata for the given Closure namespace.
<p>This is used when the namespace is not part of the input so that this pass can be fault
tolerant and still rewrite to something. Some tools don't care about rewriting correctly and
just want the type information of this module (e.g. clutz). | [
"Gets",
"some",
"made",
"-",
"up",
"metadata",
"for",
"the",
"given",
"Closure",
"namespace",
"."
] | d81e36740f6a9e8ac31a825ee8758182e1dc5aae | https://github.com/google/closure-compiler/blob/d81e36740f6a9e8ac31a825ee8758182e1dc5aae/src/com/google/javascript/jscomp/Es6RewriteModules.java#L746-L755 |
24,833 | google/closure-compiler | src/com/google/javascript/jscomp/DotFormatter.java | DotFormatter.toDot | static String toDot(Node n, ControlFlowGraph<Node> inCFG)
throws IOException {
StringBuilder builder = new StringBuilder();
new DotFormatter(n, inCFG, builder, false);
return builder.toString();
} | java | static String toDot(Node n, ControlFlowGraph<Node> inCFG)
throws IOException {
StringBuilder builder = new StringBuilder();
new DotFormatter(n, inCFG, builder, false);
return builder.toString();
} | [
"static",
"String",
"toDot",
"(",
"Node",
"n",
",",
"ControlFlowGraph",
"<",
"Node",
">",
"inCFG",
")",
"throws",
"IOException",
"{",
"StringBuilder",
"builder",
"=",
"new",
"StringBuilder",
"(",
")",
";",
"new",
"DotFormatter",
"(",
"n",
",",
"inCFG",
","... | Converts an AST to dot representation.
@param n the root of the AST described in the dot formatted string
@param inCFG Control Flow Graph.
@return the dot representation of the AST | [
"Converts",
"an",
"AST",
"to",
"dot",
"representation",
"."
] | d81e36740f6a9e8ac31a825ee8758182e1dc5aae | https://github.com/google/closure-compiler/blob/d81e36740f6a9e8ac31a825ee8758182e1dc5aae/src/com/google/javascript/jscomp/DotFormatter.java#L93-L98 |
24,834 | google/closure-compiler | src/com/google/javascript/jscomp/DotFormatter.java | DotFormatter.toDot | public static String toDot(GraphvizGraph graph) {
StringBuilder builder = new StringBuilder();
builder.append(graph.isDirected() ? "digraph" : "graph");
builder.append(INDENT);
builder.append(graph.getName());
builder.append(" {\n");
builder.append(INDENT);
builder.append("node [color=lightb... | java | public static String toDot(GraphvizGraph graph) {
StringBuilder builder = new StringBuilder();
builder.append(graph.isDirected() ? "digraph" : "graph");
builder.append(INDENT);
builder.append(graph.getName());
builder.append(" {\n");
builder.append(INDENT);
builder.append("node [color=lightb... | [
"public",
"static",
"String",
"toDot",
"(",
"GraphvizGraph",
"graph",
")",
"{",
"StringBuilder",
"builder",
"=",
"new",
"StringBuilder",
"(",
")",
";",
"builder",
".",
"append",
"(",
"graph",
".",
"isDirected",
"(",
")",
"?",
"\"digraph\"",
":",
"\"graph\"",... | Outputs a string in DOT format that presents the graph.
@param graph Input graph.
@return A string in Dot format that presents the graph. | [
"Outputs",
"a",
"string",
"in",
"DOT",
"format",
"that",
"presents",
"the",
"graph",
"."
] | d81e36740f6a9e8ac31a825ee8758182e1dc5aae | https://github.com/google/closure-compiler/blob/d81e36740f6a9e8ac31a825ee8758182e1dc5aae/src/com/google/javascript/jscomp/DotFormatter.java#L106-L162 |
24,835 | google/closure-compiler | src/com/google/javascript/jscomp/DotFormatter.java | DotFormatter.appendDot | static void appendDot(Node n, ControlFlowGraph<Node> inCFG,
Appendable builder) throws IOException {
new DotFormatter(n, inCFG, builder, false);
} | java | static void appendDot(Node n, ControlFlowGraph<Node> inCFG,
Appendable builder) throws IOException {
new DotFormatter(n, inCFG, builder, false);
} | [
"static",
"void",
"appendDot",
"(",
"Node",
"n",
",",
"ControlFlowGraph",
"<",
"Node",
">",
"inCFG",
",",
"Appendable",
"builder",
")",
"throws",
"IOException",
"{",
"new",
"DotFormatter",
"(",
"n",
",",
"inCFG",
",",
"builder",
",",
"false",
")",
";",
"... | Converts an AST to dot representation and appends it to the given buffer.
@param n the root of the AST described in the dot formatted string
@param inCFG Control Flow Graph.
@param builder A place to dump the graph. | [
"Converts",
"an",
"AST",
"to",
"dot",
"representation",
"and",
"appends",
"it",
"to",
"the",
"given",
"buffer",
"."
] | d81e36740f6a9e8ac31a825ee8758182e1dc5aae | https://github.com/google/closure-compiler/blob/d81e36740f6a9e8ac31a825ee8758182e1dc5aae/src/com/google/javascript/jscomp/DotFormatter.java#L170-L173 |
24,836 | google/closure-compiler | src/com/google/javascript/jscomp/parsing/parser/Parser.java | Parser.parseFunctionDeclaration | private ParseTree parseFunctionDeclaration() {
SourcePosition start = getTreeStartLocation();
eat(Keywords.FUNCTION.type);
boolean isGenerator = eatOpt(TokenType.STAR) != null;
FunctionDeclarationTree.Builder builder =
FunctionDeclarationTree.builder(FunctionDeclarationTree.Kind.DECLARATION).se... | java | private ParseTree parseFunctionDeclaration() {
SourcePosition start = getTreeStartLocation();
eat(Keywords.FUNCTION.type);
boolean isGenerator = eatOpt(TokenType.STAR) != null;
FunctionDeclarationTree.Builder builder =
FunctionDeclarationTree.builder(FunctionDeclarationTree.Kind.DECLARATION).se... | [
"private",
"ParseTree",
"parseFunctionDeclaration",
"(",
")",
"{",
"SourcePosition",
"start",
"=",
"getTreeStartLocation",
"(",
")",
";",
"eat",
"(",
"Keywords",
".",
"FUNCTION",
".",
"type",
")",
";",
"boolean",
"isGenerator",
"=",
"eatOpt",
"(",
"TokenType",
... | 13 Function Definition | [
"13",
"Function",
"Definition"
] | d81e36740f6a9e8ac31a825ee8758182e1dc5aae | https://github.com/google/closure-compiler/blob/d81e36740f6a9e8ac31a825ee8758182e1dc5aae/src/com/google/javascript/jscomp/parsing/parser/Parser.java#L1256-L1265 |
24,837 | google/closure-compiler | src/com/google/javascript/jscomp/parsing/parser/Parser.java | Parser.parseVariableStatement | private VariableStatementTree parseVariableStatement() {
SourcePosition start = getTreeStartLocation();
VariableDeclarationListTree declarations = parseVariableDeclarationList();
eatPossibleImplicitSemiColon();
return new VariableStatementTree(getTreeLocation(start), declarations);
} | java | private VariableStatementTree parseVariableStatement() {
SourcePosition start = getTreeStartLocation();
VariableDeclarationListTree declarations = parseVariableDeclarationList();
eatPossibleImplicitSemiColon();
return new VariableStatementTree(getTreeLocation(start), declarations);
} | [
"private",
"VariableStatementTree",
"parseVariableStatement",
"(",
")",
"{",
"SourcePosition",
"start",
"=",
"getTreeStartLocation",
"(",
")",
";",
"VariableDeclarationListTree",
"declarations",
"=",
"parseVariableDeclarationList",
"(",
")",
";",
"eatPossibleImplicitSemiColon... | 12.2 Variable Statement | [
"12",
".",
"2",
"Variable",
"Statement"
] | d81e36740f6a9e8ac31a825ee8758182e1dc5aae | https://github.com/google/closure-compiler/blob/d81e36740f6a9e8ac31a825ee8758182e1dc5aae/src/com/google/javascript/jscomp/parsing/parser/Parser.java#L1764-L1769 |
24,838 | google/closure-compiler | src/com/google/javascript/jscomp/parsing/parser/Parser.java | Parser.parseEmptyStatement | private EmptyStatementTree parseEmptyStatement() {
SourcePosition start = getTreeStartLocation();
eat(TokenType.SEMI_COLON);
return new EmptyStatementTree(getTreeLocation(start));
} | java | private EmptyStatementTree parseEmptyStatement() {
SourcePosition start = getTreeStartLocation();
eat(TokenType.SEMI_COLON);
return new EmptyStatementTree(getTreeLocation(start));
} | [
"private",
"EmptyStatementTree",
"parseEmptyStatement",
"(",
")",
"{",
"SourcePosition",
"start",
"=",
"getTreeStartLocation",
"(",
")",
";",
"eat",
"(",
"TokenType",
".",
"SEMI_COLON",
")",
";",
"return",
"new",
"EmptyStatementTree",
"(",
"getTreeLocation",
"(",
... | 12.3 Empty Statement | [
"12",
".",
"3",
"Empty",
"Statement"
] | d81e36740f6a9e8ac31a825ee8758182e1dc5aae | https://github.com/google/closure-compiler/blob/d81e36740f6a9e8ac31a825ee8758182e1dc5aae/src/com/google/javascript/jscomp/parsing/parser/Parser.java#L1851-L1855 |
24,839 | google/closure-compiler | src/com/google/javascript/jscomp/parsing/parser/Parser.java | Parser.parseExpressionStatement | private ExpressionStatementTree parseExpressionStatement() {
SourcePosition start = getTreeStartLocation();
ParseTree expression = parseExpression();
eatPossibleImplicitSemiColon();
return new ExpressionStatementTree(getTreeLocation(start), expression);
} | java | private ExpressionStatementTree parseExpressionStatement() {
SourcePosition start = getTreeStartLocation();
ParseTree expression = parseExpression();
eatPossibleImplicitSemiColon();
return new ExpressionStatementTree(getTreeLocation(start), expression);
} | [
"private",
"ExpressionStatementTree",
"parseExpressionStatement",
"(",
")",
"{",
"SourcePosition",
"start",
"=",
"getTreeStartLocation",
"(",
")",
";",
"ParseTree",
"expression",
"=",
"parseExpression",
"(",
")",
";",
"eatPossibleImplicitSemiColon",
"(",
")",
";",
"re... | 12.4 Expression Statement | [
"12",
".",
"4",
"Expression",
"Statement"
] | d81e36740f6a9e8ac31a825ee8758182e1dc5aae | https://github.com/google/closure-compiler/blob/d81e36740f6a9e8ac31a825ee8758182e1dc5aae/src/com/google/javascript/jscomp/parsing/parser/Parser.java#L1858-L1863 |
24,840 | google/closure-compiler | src/com/google/javascript/jscomp/parsing/parser/Parser.java | Parser.parseIfStatement | private IfStatementTree parseIfStatement() {
SourcePosition start = getTreeStartLocation();
eat(TokenType.IF);
eat(TokenType.OPEN_PAREN);
ParseTree condition = parseExpression();
eat(TokenType.CLOSE_PAREN);
ParseTree ifClause = parseStatement();
ParseTree elseClause = null;
if (peek(Toke... | java | private IfStatementTree parseIfStatement() {
SourcePosition start = getTreeStartLocation();
eat(TokenType.IF);
eat(TokenType.OPEN_PAREN);
ParseTree condition = parseExpression();
eat(TokenType.CLOSE_PAREN);
ParseTree ifClause = parseStatement();
ParseTree elseClause = null;
if (peek(Toke... | [
"private",
"IfStatementTree",
"parseIfStatement",
"(",
")",
"{",
"SourcePosition",
"start",
"=",
"getTreeStartLocation",
"(",
")",
";",
"eat",
"(",
"TokenType",
".",
"IF",
")",
";",
"eat",
"(",
"TokenType",
".",
"OPEN_PAREN",
")",
";",
"ParseTree",
"condition"... | 12.5 If Statement | [
"12",
".",
"5",
"If",
"Statement"
] | d81e36740f6a9e8ac31a825ee8758182e1dc5aae | https://github.com/google/closure-compiler/blob/d81e36740f6a9e8ac31a825ee8758182e1dc5aae/src/com/google/javascript/jscomp/parsing/parser/Parser.java#L1866-L1879 |
24,841 | google/closure-compiler | src/com/google/javascript/jscomp/parsing/parser/Parser.java | Parser.parseDoWhileStatement | private ParseTree parseDoWhileStatement() {
SourcePosition start = getTreeStartLocation();
eat(TokenType.DO);
ParseTree body = parseStatement();
eat(TokenType.WHILE);
eat(TokenType.OPEN_PAREN);
ParseTree condition = parseExpression();
eat(TokenType.CLOSE_PAREN);
// The semicolon after th... | java | private ParseTree parseDoWhileStatement() {
SourcePosition start = getTreeStartLocation();
eat(TokenType.DO);
ParseTree body = parseStatement();
eat(TokenType.WHILE);
eat(TokenType.OPEN_PAREN);
ParseTree condition = parseExpression();
eat(TokenType.CLOSE_PAREN);
// The semicolon after th... | [
"private",
"ParseTree",
"parseDoWhileStatement",
"(",
")",
"{",
"SourcePosition",
"start",
"=",
"getTreeStartLocation",
"(",
")",
";",
"eat",
"(",
"TokenType",
".",
"DO",
")",
";",
"ParseTree",
"body",
"=",
"parseStatement",
"(",
")",
";",
"eat",
"(",
"Token... | 12.6.1 The do-while Statement | [
"12",
".",
"6",
".",
"1",
"The",
"do",
"-",
"while",
"Statement"
] | d81e36740f6a9e8ac31a825ee8758182e1dc5aae | https://github.com/google/closure-compiler/blob/d81e36740f6a9e8ac31a825ee8758182e1dc5aae/src/com/google/javascript/jscomp/parsing/parser/Parser.java#L1884-L1897 |
24,842 | google/closure-compiler | src/com/google/javascript/jscomp/parsing/parser/Parser.java | Parser.parseWhileStatement | private ParseTree parseWhileStatement() {
SourcePosition start = getTreeStartLocation();
eat(TokenType.WHILE);
eat(TokenType.OPEN_PAREN);
ParseTree condition = parseExpression();
eat(TokenType.CLOSE_PAREN);
ParseTree body = parseStatement();
return new WhileStatementTree(getTreeLocation(star... | java | private ParseTree parseWhileStatement() {
SourcePosition start = getTreeStartLocation();
eat(TokenType.WHILE);
eat(TokenType.OPEN_PAREN);
ParseTree condition = parseExpression();
eat(TokenType.CLOSE_PAREN);
ParseTree body = parseStatement();
return new WhileStatementTree(getTreeLocation(star... | [
"private",
"ParseTree",
"parseWhileStatement",
"(",
")",
"{",
"SourcePosition",
"start",
"=",
"getTreeStartLocation",
"(",
")",
";",
"eat",
"(",
"TokenType",
".",
"WHILE",
")",
";",
"eat",
"(",
"TokenType",
".",
"OPEN_PAREN",
")",
";",
"ParseTree",
"condition"... | 12.6.2 The while Statement | [
"12",
".",
"6",
".",
"2",
"The",
"while",
"Statement"
] | d81e36740f6a9e8ac31a825ee8758182e1dc5aae | https://github.com/google/closure-compiler/blob/d81e36740f6a9e8ac31a825ee8758182e1dc5aae/src/com/google/javascript/jscomp/parsing/parser/Parser.java#L1900-L1908 |
24,843 | google/closure-compiler | src/com/google/javascript/jscomp/parsing/parser/Parser.java | Parser.parseForStatement | private ParseTree parseForStatement() {
SourcePosition start = getTreeStartLocation();
eat(TokenType.FOR);
boolean awaited = peekPredefinedString(AWAIT);
if (awaited) {
eatPredefinedString(AWAIT);
}
eat(TokenType.OPEN_PAREN);
if (peekVariableDeclarationList()) {
VariableDeclarati... | java | private ParseTree parseForStatement() {
SourcePosition start = getTreeStartLocation();
eat(TokenType.FOR);
boolean awaited = peekPredefinedString(AWAIT);
if (awaited) {
eatPredefinedString(AWAIT);
}
eat(TokenType.OPEN_PAREN);
if (peekVariableDeclarationList()) {
VariableDeclarati... | [
"private",
"ParseTree",
"parseForStatement",
"(",
")",
"{",
"SourcePosition",
"start",
"=",
"getTreeStartLocation",
"(",
")",
";",
"eat",
"(",
"TokenType",
".",
"FOR",
")",
";",
"boolean",
"awaited",
"=",
"peekPredefinedString",
"(",
"AWAIT",
")",
";",
"if",
... | The for-await-of Statement | [
"The",
"for",
"-",
"await",
"-",
"of",
"Statement"
] | d81e36740f6a9e8ac31a825ee8758182e1dc5aae | https://github.com/google/closure-compiler/blob/d81e36740f6a9e8ac31a825ee8758182e1dc5aae/src/com/google/javascript/jscomp/parsing/parser/Parser.java#L1914-L2006 |
24,844 | google/closure-compiler | src/com/google/javascript/jscomp/parsing/parser/Parser.java | Parser.checkVanillaForInitializers | private void checkVanillaForInitializers(VariableDeclarationListTree variables) {
for (VariableDeclarationTree declaration : variables.declarations) {
if (declaration.initializer == null) {
maybeReportNoInitializer(variables.declarationType, declaration.lvalue);
}
}
} | java | private void checkVanillaForInitializers(VariableDeclarationListTree variables) {
for (VariableDeclarationTree declaration : variables.declarations) {
if (declaration.initializer == null) {
maybeReportNoInitializer(variables.declarationType, declaration.lvalue);
}
}
} | [
"private",
"void",
"checkVanillaForInitializers",
"(",
"VariableDeclarationListTree",
"variables",
")",
"{",
"for",
"(",
"VariableDeclarationTree",
"declaration",
":",
"variables",
".",
"declarations",
")",
"{",
"if",
"(",
"declaration",
".",
"initializer",
"==",
"nul... | Checks variable declarations in for statements. | [
"Checks",
"variable",
"declarations",
"in",
"for",
"statements",
"."
] | d81e36740f6a9e8ac31a825ee8758182e1dc5aae | https://github.com/google/closure-compiler/blob/d81e36740f6a9e8ac31a825ee8758182e1dc5aae/src/com/google/javascript/jscomp/parsing/parser/Parser.java#L2029-L2035 |
24,845 | google/closure-compiler | src/com/google/javascript/jscomp/parsing/parser/Parser.java | Parser.maybeReportNoInitializer | private void maybeReportNoInitializer(TokenType token, ParseTree lvalue) {
if (token == TokenType.CONST) {
reportError("const variables must have an initializer");
} else if (lvalue.isPattern()) {
reportError("destructuring must have an initializer");
}
} | java | private void maybeReportNoInitializer(TokenType token, ParseTree lvalue) {
if (token == TokenType.CONST) {
reportError("const variables must have an initializer");
} else if (lvalue.isPattern()) {
reportError("destructuring must have an initializer");
}
} | [
"private",
"void",
"maybeReportNoInitializer",
"(",
"TokenType",
"token",
",",
"ParseTree",
"lvalue",
")",
"{",
"if",
"(",
"token",
"==",
"TokenType",
".",
"CONST",
")",
"{",
"reportError",
"(",
"\"const variables must have an initializer\"",
")",
";",
"}",
"else"... | Reports if declaration requires an initializer, assuming initializer is absent. | [
"Reports",
"if",
"declaration",
"requires",
"an",
"initializer",
"assuming",
"initializer",
"is",
"absent",
"."
] | d81e36740f6a9e8ac31a825ee8758182e1dc5aae | https://github.com/google/closure-compiler/blob/d81e36740f6a9e8ac31a825ee8758182e1dc5aae/src/com/google/javascript/jscomp/parsing/parser/Parser.java#L2038-L2044 |
24,846 | google/closure-compiler | src/com/google/javascript/jscomp/parsing/parser/Parser.java | Parser.parseForStatement | private ParseTree parseForStatement(SourcePosition start, ParseTree initializer) {
if (initializer == null) {
initializer = new NullTree(getTreeLocation(getTreeStartLocation()));
}
eat(TokenType.SEMI_COLON);
ParseTree condition;
if (!peek(TokenType.SEMI_COLON)) {
condition = parseExpres... | java | private ParseTree parseForStatement(SourcePosition start, ParseTree initializer) {
if (initializer == null) {
initializer = new NullTree(getTreeLocation(getTreeStartLocation()));
}
eat(TokenType.SEMI_COLON);
ParseTree condition;
if (!peek(TokenType.SEMI_COLON)) {
condition = parseExpres... | [
"private",
"ParseTree",
"parseForStatement",
"(",
"SourcePosition",
"start",
",",
"ParseTree",
"initializer",
")",
"{",
"if",
"(",
"initializer",
"==",
"null",
")",
"{",
"initializer",
"=",
"new",
"NullTree",
"(",
"getTreeLocation",
"(",
"getTreeStartLocation",
"(... | 12.6.3 The for Statement | [
"12",
".",
"6",
".",
"3",
"The",
"for",
"Statement"
] | d81e36740f6a9e8ac31a825ee8758182e1dc5aae | https://github.com/google/closure-compiler/blob/d81e36740f6a9e8ac31a825ee8758182e1dc5aae/src/com/google/javascript/jscomp/parsing/parser/Parser.java#L2058-L2081 |
24,847 | google/closure-compiler | src/com/google/javascript/jscomp/parsing/parser/Parser.java | Parser.parseForInStatement | private ParseTree parseForInStatement(SourcePosition start, ParseTree initializer) {
eat(TokenType.IN);
ParseTree collection = parseExpression();
eat(TokenType.CLOSE_PAREN);
ParseTree body = parseStatement();
return new ForInStatementTree(getTreeLocation(start), initializer, collection, body);
} | java | private ParseTree parseForInStatement(SourcePosition start, ParseTree initializer) {
eat(TokenType.IN);
ParseTree collection = parseExpression();
eat(TokenType.CLOSE_PAREN);
ParseTree body = parseStatement();
return new ForInStatementTree(getTreeLocation(start), initializer, collection, body);
} | [
"private",
"ParseTree",
"parseForInStatement",
"(",
"SourcePosition",
"start",
",",
"ParseTree",
"initializer",
")",
"{",
"eat",
"(",
"TokenType",
".",
"IN",
")",
";",
"ParseTree",
"collection",
"=",
"parseExpression",
"(",
")",
";",
"eat",
"(",
"TokenType",
"... | 12.6.4 The for-in Statement | [
"12",
".",
"6",
".",
"4",
"The",
"for",
"-",
"in",
"Statement"
] | d81e36740f6a9e8ac31a825ee8758182e1dc5aae | https://github.com/google/closure-compiler/blob/d81e36740f6a9e8ac31a825ee8758182e1dc5aae/src/com/google/javascript/jscomp/parsing/parser/Parser.java#L2084-L2090 |
24,848 | google/closure-compiler | src/com/google/javascript/jscomp/parsing/parser/Parser.java | Parser.parseContinueStatement | private ParseTree parseContinueStatement() {
SourcePosition start = getTreeStartLocation();
eat(TokenType.CONTINUE);
IdentifierToken name = null;
if (!peekImplicitSemiColon()) {
name = eatIdOpt();
}
eatPossibleImplicitSemiColon();
return new ContinueStatementTree(getTreeLocation(start)... | java | private ParseTree parseContinueStatement() {
SourcePosition start = getTreeStartLocation();
eat(TokenType.CONTINUE);
IdentifierToken name = null;
if (!peekImplicitSemiColon()) {
name = eatIdOpt();
}
eatPossibleImplicitSemiColon();
return new ContinueStatementTree(getTreeLocation(start)... | [
"private",
"ParseTree",
"parseContinueStatement",
"(",
")",
"{",
"SourcePosition",
"start",
"=",
"getTreeStartLocation",
"(",
")",
";",
"eat",
"(",
"TokenType",
".",
"CONTINUE",
")",
";",
"IdentifierToken",
"name",
"=",
"null",
";",
"if",
"(",
"!",
"peekImplic... | 12.7 The continue Statement | [
"12",
".",
"7",
"The",
"continue",
"Statement"
] | d81e36740f6a9e8ac31a825ee8758182e1dc5aae | https://github.com/google/closure-compiler/blob/d81e36740f6a9e8ac31a825ee8758182e1dc5aae/src/com/google/javascript/jscomp/parsing/parser/Parser.java#L2093-L2102 |
24,849 | google/closure-compiler | src/com/google/javascript/jscomp/parsing/parser/Parser.java | Parser.parseBreakStatement | private ParseTree parseBreakStatement() {
SourcePosition start = getTreeStartLocation();
eat(TokenType.BREAK);
IdentifierToken name = null;
if (!peekImplicitSemiColon()) {
name = eatIdOpt();
}
eatPossibleImplicitSemiColon();
return new BreakStatementTree(getTreeLocation(start), name);
... | java | private ParseTree parseBreakStatement() {
SourcePosition start = getTreeStartLocation();
eat(TokenType.BREAK);
IdentifierToken name = null;
if (!peekImplicitSemiColon()) {
name = eatIdOpt();
}
eatPossibleImplicitSemiColon();
return new BreakStatementTree(getTreeLocation(start), name);
... | [
"private",
"ParseTree",
"parseBreakStatement",
"(",
")",
"{",
"SourcePosition",
"start",
"=",
"getTreeStartLocation",
"(",
")",
";",
"eat",
"(",
"TokenType",
".",
"BREAK",
")",
";",
"IdentifierToken",
"name",
"=",
"null",
";",
"if",
"(",
"!",
"peekImplicitSemi... | 12.8 The break Statement | [
"12",
".",
"8",
"The",
"break",
"Statement"
] | d81e36740f6a9e8ac31a825ee8758182e1dc5aae | https://github.com/google/closure-compiler/blob/d81e36740f6a9e8ac31a825ee8758182e1dc5aae/src/com/google/javascript/jscomp/parsing/parser/Parser.java#L2105-L2114 |
24,850 | google/closure-compiler | src/com/google/javascript/jscomp/parsing/parser/Parser.java | Parser.parseReturnStatement | private ParseTree parseReturnStatement() {
SourcePosition start = getTreeStartLocation();
eat(TokenType.RETURN);
ParseTree expression = null;
if (!peekImplicitSemiColon()) {
expression = parseExpression();
}
eatPossibleImplicitSemiColon();
return new ReturnStatementTree(getTreeLocation... | java | private ParseTree parseReturnStatement() {
SourcePosition start = getTreeStartLocation();
eat(TokenType.RETURN);
ParseTree expression = null;
if (!peekImplicitSemiColon()) {
expression = parseExpression();
}
eatPossibleImplicitSemiColon();
return new ReturnStatementTree(getTreeLocation... | [
"private",
"ParseTree",
"parseReturnStatement",
"(",
")",
"{",
"SourcePosition",
"start",
"=",
"getTreeStartLocation",
"(",
")",
";",
"eat",
"(",
"TokenType",
".",
"RETURN",
")",
";",
"ParseTree",
"expression",
"=",
"null",
";",
"if",
"(",
"!",
"peekImplicitSe... | 12.9 The return Statement | [
"12",
".",
"9",
"The",
"return",
"Statement"
] | d81e36740f6a9e8ac31a825ee8758182e1dc5aae | https://github.com/google/closure-compiler/blob/d81e36740f6a9e8ac31a825ee8758182e1dc5aae/src/com/google/javascript/jscomp/parsing/parser/Parser.java#L2117-L2126 |
24,851 | google/closure-compiler | src/com/google/javascript/jscomp/parsing/parser/Parser.java | Parser.parseWithStatement | private ParseTree parseWithStatement() {
SourcePosition start = getTreeStartLocation();
eat(TokenType.WITH);
eat(TokenType.OPEN_PAREN);
ParseTree expression = parseExpression();
eat(TokenType.CLOSE_PAREN);
ParseTree body = parseStatement();
return new WithStatementTree(getTreeLocation(start)... | java | private ParseTree parseWithStatement() {
SourcePosition start = getTreeStartLocation();
eat(TokenType.WITH);
eat(TokenType.OPEN_PAREN);
ParseTree expression = parseExpression();
eat(TokenType.CLOSE_PAREN);
ParseTree body = parseStatement();
return new WithStatementTree(getTreeLocation(start)... | [
"private",
"ParseTree",
"parseWithStatement",
"(",
")",
"{",
"SourcePosition",
"start",
"=",
"getTreeStartLocation",
"(",
")",
";",
"eat",
"(",
"TokenType",
".",
"WITH",
")",
";",
"eat",
"(",
"TokenType",
".",
"OPEN_PAREN",
")",
";",
"ParseTree",
"expression",... | 12.10 The with Statement | [
"12",
".",
"10",
"The",
"with",
"Statement"
] | d81e36740f6a9e8ac31a825ee8758182e1dc5aae | https://github.com/google/closure-compiler/blob/d81e36740f6a9e8ac31a825ee8758182e1dc5aae/src/com/google/javascript/jscomp/parsing/parser/Parser.java#L2129-L2137 |
24,852 | google/closure-compiler | src/com/google/javascript/jscomp/parsing/parser/Parser.java | Parser.parseSwitchStatement | private ParseTree parseSwitchStatement() {
SourcePosition start = getTreeStartLocation();
eat(TokenType.SWITCH);
eat(TokenType.OPEN_PAREN);
ParseTree expression = parseExpression();
eat(TokenType.CLOSE_PAREN);
eat(TokenType.OPEN_CURLY);
ImmutableList<ParseTree> caseClauses = parseCaseClauses... | java | private ParseTree parseSwitchStatement() {
SourcePosition start = getTreeStartLocation();
eat(TokenType.SWITCH);
eat(TokenType.OPEN_PAREN);
ParseTree expression = parseExpression();
eat(TokenType.CLOSE_PAREN);
eat(TokenType.OPEN_CURLY);
ImmutableList<ParseTree> caseClauses = parseCaseClauses... | [
"private",
"ParseTree",
"parseSwitchStatement",
"(",
")",
"{",
"SourcePosition",
"start",
"=",
"getTreeStartLocation",
"(",
")",
";",
"eat",
"(",
"TokenType",
".",
"SWITCH",
")",
";",
"eat",
"(",
"TokenType",
".",
"OPEN_PAREN",
")",
";",
"ParseTree",
"expressi... | 12.11 The switch Statement | [
"12",
".",
"11",
"The",
"switch",
"Statement"
] | d81e36740f6a9e8ac31a825ee8758182e1dc5aae | https://github.com/google/closure-compiler/blob/d81e36740f6a9e8ac31a825ee8758182e1dc5aae/src/com/google/javascript/jscomp/parsing/parser/Parser.java#L2140-L2150 |
24,853 | google/closure-compiler | src/com/google/javascript/jscomp/parsing/parser/Parser.java | Parser.parseLabelledStatement | private ParseTree parseLabelledStatement() {
SourcePosition start = getTreeStartLocation();
IdentifierToken name = eatId();
eat(TokenType.COLON);
return new LabelledStatementTree(getTreeLocation(start), name, parseStatement());
} | java | private ParseTree parseLabelledStatement() {
SourcePosition start = getTreeStartLocation();
IdentifierToken name = eatId();
eat(TokenType.COLON);
return new LabelledStatementTree(getTreeLocation(start), name, parseStatement());
} | [
"private",
"ParseTree",
"parseLabelledStatement",
"(",
")",
"{",
"SourcePosition",
"start",
"=",
"getTreeStartLocation",
"(",
")",
";",
"IdentifierToken",
"name",
"=",
"eatId",
"(",
")",
";",
"eat",
"(",
"TokenType",
".",
"COLON",
")",
";",
"return",
"new",
... | 12.12 Labelled Statement | [
"12",
".",
"12",
"Labelled",
"Statement"
] | d81e36740f6a9e8ac31a825ee8758182e1dc5aae | https://github.com/google/closure-compiler/blob/d81e36740f6a9e8ac31a825ee8758182e1dc5aae/src/com/google/javascript/jscomp/parsing/parser/Parser.java#L2187-L2192 |
24,854 | google/closure-compiler | src/com/google/javascript/jscomp/parsing/parser/Parser.java | Parser.parseThrowStatement | private ParseTree parseThrowStatement() {
SourcePosition start = getTreeStartLocation();
eat(TokenType.THROW);
ParseTree value = null;
if (peekImplicitSemiColon()) {
reportError("semicolon/newline not allowed after 'throw'");
} else {
value = parseExpression();
}
eatPossibleImpli... | java | private ParseTree parseThrowStatement() {
SourcePosition start = getTreeStartLocation();
eat(TokenType.THROW);
ParseTree value = null;
if (peekImplicitSemiColon()) {
reportError("semicolon/newline not allowed after 'throw'");
} else {
value = parseExpression();
}
eatPossibleImpli... | [
"private",
"ParseTree",
"parseThrowStatement",
"(",
")",
"{",
"SourcePosition",
"start",
"=",
"getTreeStartLocation",
"(",
")",
";",
"eat",
"(",
"TokenType",
".",
"THROW",
")",
";",
"ParseTree",
"value",
"=",
"null",
";",
"if",
"(",
"peekImplicitSemiColon",
"(... | 12.13 Throw Statement | [
"12",
".",
"13",
"Throw",
"Statement"
] | d81e36740f6a9e8ac31a825ee8758182e1dc5aae | https://github.com/google/closure-compiler/blob/d81e36740f6a9e8ac31a825ee8758182e1dc5aae/src/com/google/javascript/jscomp/parsing/parser/Parser.java#L2200-L2211 |
24,855 | google/closure-compiler | src/com/google/javascript/jscomp/parsing/parser/Parser.java | Parser.parseTryStatement | private ParseTree parseTryStatement() {
SourcePosition start = getTreeStartLocation();
eat(TokenType.TRY);
ParseTree body = parseBlock();
ParseTree catchBlock = null;
if (peek(TokenType.CATCH)) {
catchBlock = parseCatch();
}
ParseTree finallyBlock = null;
if (peek(TokenType.FINALLY... | java | private ParseTree parseTryStatement() {
SourcePosition start = getTreeStartLocation();
eat(TokenType.TRY);
ParseTree body = parseBlock();
ParseTree catchBlock = null;
if (peek(TokenType.CATCH)) {
catchBlock = parseCatch();
}
ParseTree finallyBlock = null;
if (peek(TokenType.FINALLY... | [
"private",
"ParseTree",
"parseTryStatement",
"(",
")",
"{",
"SourcePosition",
"start",
"=",
"getTreeStartLocation",
"(",
")",
";",
"eat",
"(",
"TokenType",
".",
"TRY",
")",
";",
"ParseTree",
"body",
"=",
"parseBlock",
"(",
")",
";",
"ParseTree",
"catchBlock",
... | 12.14 Try Statement | [
"12",
".",
"14",
"Try",
"Statement"
] | d81e36740f6a9e8ac31a825ee8758182e1dc5aae | https://github.com/google/closure-compiler/blob/d81e36740f6a9e8ac31a825ee8758182e1dc5aae/src/com/google/javascript/jscomp/parsing/parser/Parser.java#L2214-L2230 |
24,856 | google/closure-compiler | src/com/google/javascript/jscomp/parsing/parser/Parser.java | Parser.parseDebuggerStatement | private ParseTree parseDebuggerStatement() {
SourcePosition start = getTreeStartLocation();
eat(TokenType.DEBUGGER);
eatPossibleImplicitSemiColon();
return new DebuggerStatementTree(getTreeLocation(start));
} | java | private ParseTree parseDebuggerStatement() {
SourcePosition start = getTreeStartLocation();
eat(TokenType.DEBUGGER);
eatPossibleImplicitSemiColon();
return new DebuggerStatementTree(getTreeLocation(start));
} | [
"private",
"ParseTree",
"parseDebuggerStatement",
"(",
")",
"{",
"SourcePosition",
"start",
"=",
"getTreeStartLocation",
"(",
")",
";",
"eat",
"(",
"TokenType",
".",
"DEBUGGER",
")",
";",
"eatPossibleImplicitSemiColon",
"(",
")",
";",
"return",
"new",
"DebuggerSta... | 12.15 The Debugger Statement | [
"12",
".",
"15",
"The",
"Debugger",
"Statement"
] | d81e36740f6a9e8ac31a825ee8758182e1dc5aae | https://github.com/google/closure-compiler/blob/d81e36740f6a9e8ac31a825ee8758182e1dc5aae/src/com/google/javascript/jscomp/parsing/parser/Parser.java#L2264-L2270 |
24,857 | google/closure-compiler | src/com/google/javascript/jscomp/parsing/parser/Parser.java | Parser.parsePrimaryExpression | private ParseTree parsePrimaryExpression() {
switch (peekType()) {
case CLASS:
return parseClassExpression();
case SUPER:
return parseSuperExpression();
case THIS:
return parseThisExpression();
case IMPORT:
return parseDynamicImportExpression();
case IDE... | java | private ParseTree parsePrimaryExpression() {
switch (peekType()) {
case CLASS:
return parseClassExpression();
case SUPER:
return parseSuperExpression();
case THIS:
return parseThisExpression();
case IMPORT:
return parseDynamicImportExpression();
case IDE... | [
"private",
"ParseTree",
"parsePrimaryExpression",
"(",
")",
"{",
"switch",
"(",
"peekType",
"(",
")",
")",
"{",
"case",
"CLASS",
":",
"return",
"parseClassExpression",
"(",
")",
";",
"case",
"SUPER",
":",
"return",
"parseSuperExpression",
"(",
")",
";",
"cas... | 11.1 Primary Expressions | [
"11",
".",
"1",
"Primary",
"Expressions"
] | d81e36740f6a9e8ac31a825ee8758182e1dc5aae | https://github.com/google/closure-compiler/blob/d81e36740f6a9e8ac31a825ee8758182e1dc5aae/src/com/google/javascript/jscomp/parsing/parser/Parser.java#L2273-L2310 |
24,858 | google/closure-compiler | src/com/google/javascript/jscomp/parsing/parser/Parser.java | Parser.parseArrayLiteral | private ParseTree parseArrayLiteral() {
// ArrayLiteral :
// [ Elisionopt ]
// [ ElementList ]
// [ ElementList , Elisionopt ]
//
// ElementList :
// Elisionopt AssignmentOrSpreadExpression
// ElementList , Elisionopt AssignmentOrSpreadExpression
//
// Elision :
// ... | java | private ParseTree parseArrayLiteral() {
// ArrayLiteral :
// [ Elisionopt ]
// [ ElementList ]
// [ ElementList , Elisionopt ]
//
// ElementList :
// Elisionopt AssignmentOrSpreadExpression
// ElementList , Elisionopt AssignmentOrSpreadExpression
//
// Elision :
// ... | [
"private",
"ParseTree",
"parseArrayLiteral",
"(",
")",
"{",
"// ArrayLiteral :",
"// [ Elisionopt ]",
"// [ ElementList ]",
"// [ ElementList , Elisionopt ]",
"//",
"// ElementList :",
"// Elisionopt AssignmentOrSpreadExpression",
"// ElementList , Elisionopt AssignmentOrSpreadEx... | 11.1.4 Array Literal Expression | [
"11",
".",
"1",
".",
"4",
"Array",
"Literal",
"Expression"
] | d81e36740f6a9e8ac31a825ee8758182e1dc5aae | https://github.com/google/closure-compiler/blob/d81e36740f6a9e8ac31a825ee8758182e1dc5aae/src/com/google/javascript/jscomp/parsing/parser/Parser.java#L2494-L2535 |
24,859 | google/closure-compiler | src/com/google/javascript/jscomp/parsing/parser/Parser.java | Parser.parseObjectLiteral | private ParseTree parseObjectLiteral() {
SourcePosition start = getTreeStartLocation();
ImmutableList.Builder<ParseTree> result = ImmutableList.builder();
eat(TokenType.OPEN_CURLY);
Token commaToken = null;
while (peek(TokenType.SPREAD)
|| peekPropertyNameOrComputedProp(0)
|| peek(T... | java | private ParseTree parseObjectLiteral() {
SourcePosition start = getTreeStartLocation();
ImmutableList.Builder<ParseTree> result = ImmutableList.builder();
eat(TokenType.OPEN_CURLY);
Token commaToken = null;
while (peek(TokenType.SPREAD)
|| peekPropertyNameOrComputedProp(0)
|| peek(T... | [
"private",
"ParseTree",
"parseObjectLiteral",
"(",
")",
"{",
"SourcePosition",
"start",
"=",
"getTreeStartLocation",
"(",
")",
";",
"ImmutableList",
".",
"Builder",
"<",
"ParseTree",
">",
"result",
"=",
"ImmutableList",
".",
"builder",
"(",
")",
";",
"eat",
"(... | 11.1.4 Object Literal Expression | [
"11",
".",
"1",
".",
"4",
"Object",
"Literal",
"Expression"
] | d81e36740f6a9e8ac31a825ee8758182e1dc5aae | https://github.com/google/closure-compiler/blob/d81e36740f6a9e8ac31a825ee8758182e1dc5aae/src/com/google/javascript/jscomp/parsing/parser/Parser.java#L2538-L2560 |
24,860 | google/closure-compiler | src/com/google/javascript/jscomp/parsing/parser/Parser.java | Parser.transformLeftHandSideExpression | private ParseTree transformLeftHandSideExpression(ParseTree tree) {
switch (tree.type) {
case ARRAY_LITERAL_EXPRESSION:
case OBJECT_LITERAL_EXPRESSION:
resetScanner(tree);
// If we fail to parse as an LeftHandSidePattern then
// parseLeftHandSidePattern will take care reporting e... | java | private ParseTree transformLeftHandSideExpression(ParseTree tree) {
switch (tree.type) {
case ARRAY_LITERAL_EXPRESSION:
case OBJECT_LITERAL_EXPRESSION:
resetScanner(tree);
// If we fail to parse as an LeftHandSidePattern then
// parseLeftHandSidePattern will take care reporting e... | [
"private",
"ParseTree",
"transformLeftHandSideExpression",
"(",
"ParseTree",
"tree",
")",
"{",
"switch",
"(",
"tree",
".",
"type",
")",
"{",
"case",
"ARRAY_LITERAL_EXPRESSION",
":",
"case",
"OBJECT_LITERAL_EXPRESSION",
":",
"resetScanner",
"(",
"tree",
")",
";",
"... | Transforms a LeftHandSideExpression into a LeftHandSidePattern if possible.
This returns the transformed tree if it parses as a LeftHandSidePattern,
otherwise it returns the original tree. | [
"Transforms",
"a",
"LeftHandSideExpression",
"into",
"a",
"LeftHandSidePattern",
"if",
"possible",
".",
"This",
"returns",
"the",
"transformed",
"tree",
"if",
"it",
"parses",
"as",
"a",
"LeftHandSidePattern",
"otherwise",
"it",
"returns",
"the",
"original",
"tree",
... | d81e36740f6a9e8ac31a825ee8758182e1dc5aae | https://github.com/google/closure-compiler/blob/d81e36740f6a9e8ac31a825ee8758182e1dc5aae/src/com/google/javascript/jscomp/parsing/parser/Parser.java#L3143-L3154 |
24,861 | google/closure-compiler | src/com/google/javascript/jscomp/parsing/parser/Parser.java | Parser.parseConditional | private ParseTree parseConditional(Expression expressionIn) {
SourcePosition start = getTreeStartLocation();
ParseTree condition = parseLogicalOR(expressionIn);
if (peek(TokenType.QUESTION)) {
eat(TokenType.QUESTION);
ParseTree left = parseAssignment(expressionIn);
eat(TokenType.COLON);
... | java | private ParseTree parseConditional(Expression expressionIn) {
SourcePosition start = getTreeStartLocation();
ParseTree condition = parseLogicalOR(expressionIn);
if (peek(TokenType.QUESTION)) {
eat(TokenType.QUESTION);
ParseTree left = parseAssignment(expressionIn);
eat(TokenType.COLON);
... | [
"private",
"ParseTree",
"parseConditional",
"(",
"Expression",
"expressionIn",
")",
"{",
"SourcePosition",
"start",
"=",
"getTreeStartLocation",
"(",
")",
";",
"ParseTree",
"condition",
"=",
"parseLogicalOR",
"(",
"expressionIn",
")",
";",
"if",
"(",
"peek",
"(",
... | 11.12 Conditional Expression | [
"11",
".",
"12",
"Conditional",
"Expression"
] | d81e36740f6a9e8ac31a825ee8758182e1dc5aae | https://github.com/google/closure-compiler/blob/d81e36740f6a9e8ac31a825ee8758182e1dc5aae/src/com/google/javascript/jscomp/parsing/parser/Parser.java#L3221-L3233 |
24,862 | google/closure-compiler | src/com/google/javascript/jscomp/parsing/parser/Parser.java | Parser.parseLogicalOR | private ParseTree parseLogicalOR(Expression expressionIn) {
SourcePosition start = getTreeStartLocation();
ParseTree left = parseLogicalAND(expressionIn);
while (peek(TokenType.OR)) {
Token operator = eat(TokenType.OR);
ParseTree right = parseLogicalAND(expressionIn);
left = new BinaryOper... | java | private ParseTree parseLogicalOR(Expression expressionIn) {
SourcePosition start = getTreeStartLocation();
ParseTree left = parseLogicalAND(expressionIn);
while (peek(TokenType.OR)) {
Token operator = eat(TokenType.OR);
ParseTree right = parseLogicalAND(expressionIn);
left = new BinaryOper... | [
"private",
"ParseTree",
"parseLogicalOR",
"(",
"Expression",
"expressionIn",
")",
"{",
"SourcePosition",
"start",
"=",
"getTreeStartLocation",
"(",
")",
";",
"ParseTree",
"left",
"=",
"parseLogicalAND",
"(",
"expressionIn",
")",
";",
"while",
"(",
"peek",
"(",
"... | 11.11 Logical OR | [
"11",
".",
"11",
"Logical",
"OR"
] | d81e36740f6a9e8ac31a825ee8758182e1dc5aae | https://github.com/google/closure-compiler/blob/d81e36740f6a9e8ac31a825ee8758182e1dc5aae/src/com/google/javascript/jscomp/parsing/parser/Parser.java#L3236-L3245 |
24,863 | google/closure-compiler | src/com/google/javascript/jscomp/parsing/parser/Parser.java | Parser.parseEquality | private ParseTree parseEquality(Expression expressionIn) {
SourcePosition start = getTreeStartLocation();
ParseTree left = parseRelational(expressionIn);
while (peekEqualityOperator()) {
Token operator = nextToken();
ParseTree right = parseRelational(expressionIn);
left = new BinaryOperato... | java | private ParseTree parseEquality(Expression expressionIn) {
SourcePosition start = getTreeStartLocation();
ParseTree left = parseRelational(expressionIn);
while (peekEqualityOperator()) {
Token operator = nextToken();
ParseTree right = parseRelational(expressionIn);
left = new BinaryOperato... | [
"private",
"ParseTree",
"parseEquality",
"(",
"Expression",
"expressionIn",
")",
"{",
"SourcePosition",
"start",
"=",
"getTreeStartLocation",
"(",
")",
";",
"ParseTree",
"left",
"=",
"parseRelational",
"(",
"expressionIn",
")",
";",
"while",
"(",
"peekEqualityOperat... | 11.9 Equality Expression | [
"11",
".",
"9",
"Equality",
"Expression"
] | d81e36740f6a9e8ac31a825ee8758182e1dc5aae | https://github.com/google/closure-compiler/blob/d81e36740f6a9e8ac31a825ee8758182e1dc5aae/src/com/google/javascript/jscomp/parsing/parser/Parser.java#L3296-L3305 |
24,864 | google/closure-compiler | src/com/google/javascript/jscomp/parsing/parser/Parser.java | Parser.parseRelational | private ParseTree parseRelational(Expression expressionIn) {
SourcePosition start = getTreeStartLocation();
ParseTree left = parseShiftExpression();
while (peekRelationalOperator(expressionIn)) {
Token operator = nextToken();
ParseTree right = parseShiftExpression();
left = new BinaryOpera... | java | private ParseTree parseRelational(Expression expressionIn) {
SourcePosition start = getTreeStartLocation();
ParseTree left = parseShiftExpression();
while (peekRelationalOperator(expressionIn)) {
Token operator = nextToken();
ParseTree right = parseShiftExpression();
left = new BinaryOpera... | [
"private",
"ParseTree",
"parseRelational",
"(",
"Expression",
"expressionIn",
")",
"{",
"SourcePosition",
"start",
"=",
"getTreeStartLocation",
"(",
")",
";",
"ParseTree",
"left",
"=",
"parseShiftExpression",
"(",
")",
";",
"while",
"(",
"peekRelationalOperator",
"(... | 11.8 Relational | [
"11",
".",
"8",
"Relational"
] | d81e36740f6a9e8ac31a825ee8758182e1dc5aae | https://github.com/google/closure-compiler/blob/d81e36740f6a9e8ac31a825ee8758182e1dc5aae/src/com/google/javascript/jscomp/parsing/parser/Parser.java#L3320-L3329 |
24,865 | google/closure-compiler | src/com/google/javascript/jscomp/parsing/parser/Parser.java | Parser.parseShiftExpression | private ParseTree parseShiftExpression() {
SourcePosition start = getTreeStartLocation();
ParseTree left = parseAdditiveExpression();
while (peekShiftOperator()) {
Token operator = nextToken();
ParseTree right = parseAdditiveExpression();
left = new BinaryOperatorTree(getTreeLocation(start... | java | private ParseTree parseShiftExpression() {
SourcePosition start = getTreeStartLocation();
ParseTree left = parseAdditiveExpression();
while (peekShiftOperator()) {
Token operator = nextToken();
ParseTree right = parseAdditiveExpression();
left = new BinaryOperatorTree(getTreeLocation(start... | [
"private",
"ParseTree",
"parseShiftExpression",
"(",
")",
"{",
"SourcePosition",
"start",
"=",
"getTreeStartLocation",
"(",
")",
";",
"ParseTree",
"left",
"=",
"parseAdditiveExpression",
"(",
")",
";",
"while",
"(",
"peekShiftOperator",
"(",
")",
")",
"{",
"Toke... | 11.7 Shift Expression | [
"11",
".",
"7",
"Shift",
"Expression"
] | d81e36740f6a9e8ac31a825ee8758182e1dc5aae | https://github.com/google/closure-compiler/blob/d81e36740f6a9e8ac31a825ee8758182e1dc5aae/src/com/google/javascript/jscomp/parsing/parser/Parser.java#L3347-L3356 |
24,866 | google/closure-compiler | src/com/google/javascript/jscomp/parsing/parser/Parser.java | Parser.parseAdditiveExpression | private ParseTree parseAdditiveExpression() {
SourcePosition start = getTreeStartLocation();
ParseTree left = parseMultiplicativeExpression();
while (peekAdditiveOperator()) {
Token operator = nextToken();
ParseTree right = parseMultiplicativeExpression();
left = new BinaryOperatorTree(get... | java | private ParseTree parseAdditiveExpression() {
SourcePosition start = getTreeStartLocation();
ParseTree left = parseMultiplicativeExpression();
while (peekAdditiveOperator()) {
Token operator = nextToken();
ParseTree right = parseMultiplicativeExpression();
left = new BinaryOperatorTree(get... | [
"private",
"ParseTree",
"parseAdditiveExpression",
"(",
")",
"{",
"SourcePosition",
"start",
"=",
"getTreeStartLocation",
"(",
")",
";",
"ParseTree",
"left",
"=",
"parseMultiplicativeExpression",
"(",
")",
";",
"while",
"(",
"peekAdditiveOperator",
"(",
")",
")",
... | 11.6 Additive Expression | [
"11",
".",
"6",
"Additive",
"Expression"
] | d81e36740f6a9e8ac31a825ee8758182e1dc5aae | https://github.com/google/closure-compiler/blob/d81e36740f6a9e8ac31a825ee8758182e1dc5aae/src/com/google/javascript/jscomp/parsing/parser/Parser.java#L3370-L3379 |
24,867 | google/closure-compiler | src/com/google/javascript/jscomp/parsing/parser/Parser.java | Parser.parseMultiplicativeExpression | private ParseTree parseMultiplicativeExpression() {
SourcePosition start = getTreeStartLocation();
ParseTree left = parseExponentiationExpression();
while (peekMultiplicativeOperator()) {
Token operator = nextToken();
ParseTree right = parseExponentiationExpression();
left = new BinaryOper... | java | private ParseTree parseMultiplicativeExpression() {
SourcePosition start = getTreeStartLocation();
ParseTree left = parseExponentiationExpression();
while (peekMultiplicativeOperator()) {
Token operator = nextToken();
ParseTree right = parseExponentiationExpression();
left = new BinaryOper... | [
"private",
"ParseTree",
"parseMultiplicativeExpression",
"(",
")",
"{",
"SourcePosition",
"start",
"=",
"getTreeStartLocation",
"(",
")",
";",
"ParseTree",
"left",
"=",
"parseExponentiationExpression",
"(",
")",
";",
"while",
"(",
"peekMultiplicativeOperator",
"(",
")... | 11.5 Multiplicative Expression | [
"11",
".",
"5",
"Multiplicative",
"Expression"
] | d81e36740f6a9e8ac31a825ee8758182e1dc5aae | https://github.com/google/closure-compiler/blob/d81e36740f6a9e8ac31a825ee8758182e1dc5aae/src/com/google/javascript/jscomp/parsing/parser/Parser.java#L3392-L3401 |
24,868 | google/closure-compiler | src/com/google/javascript/jscomp/parsing/parser/Parser.java | Parser.parseUnaryExpression | private ParseTree parseUnaryExpression() {
SourcePosition start = getTreeStartLocation();
if (peekUnaryOperator()) {
Token operator = nextToken();
ParseTree operand = parseUnaryExpression();
return new UnaryExpressionTree(getTreeLocation(start), operator, operand);
} else if (peekAwaitExpr... | java | private ParseTree parseUnaryExpression() {
SourcePosition start = getTreeStartLocation();
if (peekUnaryOperator()) {
Token operator = nextToken();
ParseTree operand = parseUnaryExpression();
return new UnaryExpressionTree(getTreeLocation(start), operator, operand);
} else if (peekAwaitExpr... | [
"private",
"ParseTree",
"parseUnaryExpression",
"(",
")",
"{",
"SourcePosition",
"start",
"=",
"getTreeStartLocation",
"(",
")",
";",
"if",
"(",
"peekUnaryOperator",
"(",
")",
")",
"{",
"Token",
"operator",
"=",
"nextToken",
"(",
")",
";",
"ParseTree",
"operan... | 11.4 Unary Operator | [
"11",
".",
"4",
"Unary",
"Operator"
] | d81e36740f6a9e8ac31a825ee8758182e1dc5aae | https://github.com/google/closure-compiler/blob/d81e36740f6a9e8ac31a825ee8758182e1dc5aae/src/com/google/javascript/jscomp/parsing/parser/Parser.java#L3437-L3448 |
24,869 | google/closure-compiler | src/com/google/javascript/jscomp/parsing/parser/Parser.java | Parser.parseLeftHandSideExpression | @SuppressWarnings("incomplete-switch")
private ParseTree parseLeftHandSideExpression() {
SourcePosition start = getTreeStartLocation();
ParseTree operand = parseNewExpression();
// this test is equivalent to is member expression
if (!(operand instanceof NewExpressionTree)
|| ((NewExpressionTr... | java | @SuppressWarnings("incomplete-switch")
private ParseTree parseLeftHandSideExpression() {
SourcePosition start = getTreeStartLocation();
ParseTree operand = parseNewExpression();
// this test is equivalent to is member expression
if (!(operand instanceof NewExpressionTree)
|| ((NewExpressionTr... | [
"@",
"SuppressWarnings",
"(",
"\"incomplete-switch\"",
")",
"private",
"ParseTree",
"parseLeftHandSideExpression",
"(",
")",
"{",
"SourcePosition",
"start",
"=",
"getTreeStartLocation",
"(",
")",
";",
"ParseTree",
"operand",
"=",
"parseNewExpression",
"(",
")",
";",
... | Also inlines the call expression productions | [
"Also",
"inlines",
"the",
"call",
"expression",
"productions"
] | d81e36740f6a9e8ac31a825ee8758182e1dc5aae | https://github.com/google/closure-compiler/blob/d81e36740f6a9e8ac31a825ee8758182e1dc5aae/src/com/google/javascript/jscomp/parsing/parser/Parser.java#L3516-L3553 |
24,870 | google/closure-compiler | src/com/google/javascript/jscomp/parsing/parser/Parser.java | Parser.parseMemberExpressionNoNew | private ParseTree parseMemberExpressionNoNew() {
SourcePosition start = getTreeStartLocation();
ParseTree operand;
if (peekAsyncFunctionStart()) {
operand = parseAsyncFunctionExpression();
} else if (peekFunction()) {
operand = parseFunctionExpression();
} else {
operand = parsePri... | java | private ParseTree parseMemberExpressionNoNew() {
SourcePosition start = getTreeStartLocation();
ParseTree operand;
if (peekAsyncFunctionStart()) {
operand = parseAsyncFunctionExpression();
} else if (peekFunction()) {
operand = parseFunctionExpression();
} else {
operand = parsePri... | [
"private",
"ParseTree",
"parseMemberExpressionNoNew",
"(",
")",
"{",
"SourcePosition",
"start",
"=",
"getTreeStartLocation",
"(",
")",
";",
"ParseTree",
"operand",
";",
"if",
"(",
"peekAsyncFunctionStart",
"(",
")",
")",
"{",
"operand",
"=",
"parseAsyncFunctionExpre... | 11.2 Member Expression without the new production | [
"11",
".",
"2",
"Member",
"Expression",
"without",
"the",
"new",
"production"
] | d81e36740f6a9e8ac31a825ee8758182e1dc5aae | https://github.com/google/closure-compiler/blob/d81e36740f6a9e8ac31a825ee8758182e1dc5aae/src/com/google/javascript/jscomp/parsing/parser/Parser.java#L3566-L3599 |
24,871 | google/closure-compiler | src/com/google/javascript/jscomp/parsing/parser/Parser.java | Parser.parsePatternAssignmentTarget | private ParseTree parsePatternAssignmentTarget(PatternKind patternKind) {
SourcePosition start = getTreeStartLocation();
ParseTree assignmentTarget;
assignmentTarget = parsePatternAssignmentTargetNoDefault(patternKind);
if (peek(TokenType.EQUAL)) {
eat(TokenType.EQUAL);
ParseTree defaultVal... | java | private ParseTree parsePatternAssignmentTarget(PatternKind patternKind) {
SourcePosition start = getTreeStartLocation();
ParseTree assignmentTarget;
assignmentTarget = parsePatternAssignmentTargetNoDefault(patternKind);
if (peek(TokenType.EQUAL)) {
eat(TokenType.EQUAL);
ParseTree defaultVal... | [
"private",
"ParseTree",
"parsePatternAssignmentTarget",
"(",
"PatternKind",
"patternKind",
")",
"{",
"SourcePosition",
"start",
"=",
"getTreeStartLocation",
"(",
")",
";",
"ParseTree",
"assignmentTarget",
";",
"assignmentTarget",
"=",
"parsePatternAssignmentTargetNoDefault",
... | A PatternAssignmentTarget is the location where the assigned value gets stored, including an
optional default value.
<dl>
<dt> Spec AssignmentElement === PatternAssignmentTarget(PatternKind.ANY)
<dd> Valid in an assignment that is not a formal parameter list or variable declaration.
Sub-patterns and arbitrary left han... | [
"A",
"PatternAssignmentTarget",
"is",
"the",
"location",
"where",
"the",
"assigned",
"value",
"gets",
"stored",
"including",
"an",
"optional",
"default",
"value",
"."
] | d81e36740f6a9e8ac31a825ee8758182e1dc5aae | https://github.com/google/closure-compiler/blob/d81e36740f6a9e8ac31a825ee8758182e1dc5aae/src/com/google/javascript/jscomp/parsing/parser/Parser.java#L3850-L3862 |
24,872 | google/closure-compiler | src/com/google/javascript/jscomp/parsing/parser/Parser.java | Parser.eatId | private IdentifierToken eatId() {
if (peekId()) {
return eatIdOrKeywordAsId();
} else {
reportExpectedError(peekToken(), TokenType.IDENTIFIER);
if (peekIdOrKeyword()) {
return eatIdOrKeywordAsId();
} else {
return null;
}
}
} | java | private IdentifierToken eatId() {
if (peekId()) {
return eatIdOrKeywordAsId();
} else {
reportExpectedError(peekToken(), TokenType.IDENTIFIER);
if (peekIdOrKeyword()) {
return eatIdOrKeywordAsId();
} else {
return null;
}
}
} | [
"private",
"IdentifierToken",
"eatId",
"(",
")",
"{",
"if",
"(",
"peekId",
"(",
")",
")",
"{",
"return",
"eatIdOrKeywordAsId",
"(",
")",
";",
"}",
"else",
"{",
"reportExpectedError",
"(",
"peekToken",
"(",
")",
",",
"TokenType",
".",
"IDENTIFIER",
")",
"... | Consumes an identifier token that is not a reserved word.
@see "http://www.ecma-international.org/ecma-262/5.1/#sec-7.6" | [
"Consumes",
"an",
"identifier",
"token",
"that",
"is",
"not",
"a",
"reserved",
"word",
"."
] | d81e36740f6a9e8ac31a825ee8758182e1dc5aae | https://github.com/google/closure-compiler/blob/d81e36740f6a9e8ac31a825ee8758182e1dc5aae/src/com/google/javascript/jscomp/parsing/parser/Parser.java#L4042-L4053 |
24,873 | google/closure-compiler | src/com/google/javascript/jscomp/parsing/parser/Parser.java | Parser.eatIdOrKeywordAsId | private IdentifierToken eatIdOrKeywordAsId() {
Token token = nextToken();
if (token.type == TokenType.IDENTIFIER) {
return (IdentifierToken) token;
} else if (Keywords.isKeyword(token.type)) {
return new IdentifierToken(
token.location, Keywords.get(token.type).toString());
} else ... | java | private IdentifierToken eatIdOrKeywordAsId() {
Token token = nextToken();
if (token.type == TokenType.IDENTIFIER) {
return (IdentifierToken) token;
} else if (Keywords.isKeyword(token.type)) {
return new IdentifierToken(
token.location, Keywords.get(token.type).toString());
} else ... | [
"private",
"IdentifierToken",
"eatIdOrKeywordAsId",
"(",
")",
"{",
"Token",
"token",
"=",
"nextToken",
"(",
")",
";",
"if",
"(",
"token",
".",
"type",
"==",
"TokenType",
".",
"IDENTIFIER",
")",
"{",
"return",
"(",
"IdentifierToken",
")",
"token",
";",
"}",... | Consumes an identifier token that may be a reserved word, i.e.
an IdentifierName, not necessarily an Identifier.
@see "http://www.ecma-international.org/ecma-262/5.1/#sec-7.6" | [
"Consumes",
"an",
"identifier",
"token",
"that",
"may",
"be",
"a",
"reserved",
"word",
"i",
".",
"e",
".",
"an",
"IdentifierName",
"not",
"necessarily",
"an",
"Identifier",
"."
] | d81e36740f6a9e8ac31a825ee8758182e1dc5aae | https://github.com/google/closure-compiler/blob/d81e36740f6a9e8ac31a825ee8758182e1dc5aae/src/com/google/javascript/jscomp/parsing/parser/Parser.java#L4072-L4083 |
24,874 | google/closure-compiler | src/com/google/javascript/jscomp/parsing/parser/Parser.java | Parser.eat | private Token eat(TokenType expectedTokenType) {
Token token = nextToken();
if (token.type != expectedTokenType) {
reportExpectedError(token, expectedTokenType);
return null;
}
return token;
} | java | private Token eat(TokenType expectedTokenType) {
Token token = nextToken();
if (token.type != expectedTokenType) {
reportExpectedError(token, expectedTokenType);
return null;
}
return token;
} | [
"private",
"Token",
"eat",
"(",
"TokenType",
"expectedTokenType",
")",
"{",
"Token",
"token",
"=",
"nextToken",
"(",
")",
";",
"if",
"(",
"token",
".",
"type",
"!=",
"expectedTokenType",
")",
"{",
"reportExpectedError",
"(",
"token",
",",
"expectedTokenType",
... | Consumes the next token. If the consumed token is not of the expected type then
report an error and return null. Otherwise return the consumed token.
@param expectedTokenType
@return The consumed token, or null if the next token is not of the expected type. | [
"Consumes",
"the",
"next",
"token",
".",
"If",
"the",
"consumed",
"token",
"is",
"not",
"of",
"the",
"expected",
"type",
"then",
"report",
"an",
"error",
"and",
"return",
"null",
".",
"Otherwise",
"return",
"the",
"consumed",
"token",
"."
] | d81e36740f6a9e8ac31a825ee8758182e1dc5aae | https://github.com/google/closure-compiler/blob/d81e36740f6a9e8ac31a825ee8758182e1dc5aae/src/com/google/javascript/jscomp/parsing/parser/Parser.java#L4092-L4099 |
24,875 | google/closure-compiler | src/com/google/javascript/jscomp/parsing/parser/Parser.java | Parser.nextToken | private Token nextToken() {
Token token = scanner.nextToken();
lastSourcePosition = token.location.end;
return token;
} | java | private Token nextToken() {
Token token = scanner.nextToken();
lastSourcePosition = token.location.end;
return token;
} | [
"private",
"Token",
"nextToken",
"(",
")",
"{",
"Token",
"token",
"=",
"scanner",
".",
"nextToken",
"(",
")",
";",
"lastSourcePosition",
"=",
"token",
".",
"location",
".",
"end",
";",
"return",
"token",
";",
"}"
] | Consumes the next token and returns it. Will return a never ending stream of
TokenType.END_OF_FILE at the end of the file so callers don't have to check for EOF
explicitly.
<p>Tokenizing is contextual. nextToken() will never return a regular expression literal. | [
"Consumes",
"the",
"next",
"token",
"and",
"returns",
"it",
".",
"Will",
"return",
"a",
"never",
"ending",
"stream",
"of",
"TokenType",
".",
"END_OF_FILE",
"at",
"the",
"end",
"of",
"the",
"file",
"so",
"callers",
"don",
"t",
"have",
"to",
"check",
"for"... | d81e36740f6a9e8ac31a825ee8758182e1dc5aae | https://github.com/google/closure-compiler/blob/d81e36740f6a9e8ac31a825ee8758182e1dc5aae/src/com/google/javascript/jscomp/parsing/parser/Parser.java#L4139-L4143 |
24,876 | google/closure-compiler | src/com/google/javascript/jscomp/parsing/parser/Parser.java | Parser.nextRegularExpressionLiteralToken | private LiteralToken nextRegularExpressionLiteralToken() {
LiteralToken token = scanner.nextRegularExpressionLiteralToken();
lastSourcePosition = token.location.end;
return token;
} | java | private LiteralToken nextRegularExpressionLiteralToken() {
LiteralToken token = scanner.nextRegularExpressionLiteralToken();
lastSourcePosition = token.location.end;
return token;
} | [
"private",
"LiteralToken",
"nextRegularExpressionLiteralToken",
"(",
")",
"{",
"LiteralToken",
"token",
"=",
"scanner",
".",
"nextRegularExpressionLiteralToken",
"(",
")",
";",
"lastSourcePosition",
"=",
"token",
".",
"location",
".",
"end",
";",
"return",
"token",
... | Consumes a regular expression literal token and returns it. | [
"Consumes",
"a",
"regular",
"expression",
"literal",
"token",
"and",
"returns",
"it",
"."
] | d81e36740f6a9e8ac31a825ee8758182e1dc5aae | https://github.com/google/closure-compiler/blob/d81e36740f6a9e8ac31a825ee8758182e1dc5aae/src/com/google/javascript/jscomp/parsing/parser/Parser.java#L4148-L4152 |
24,877 | google/closure-compiler | src/com/google/javascript/jscomp/parsing/parser/Parser.java | Parser.nextTemplateLiteralToken | private TemplateLiteralToken nextTemplateLiteralToken() {
TemplateLiteralToken token = scanner.nextTemplateLiteralToken();
lastSourcePosition = token.location.end;
return token;
} | java | private TemplateLiteralToken nextTemplateLiteralToken() {
TemplateLiteralToken token = scanner.nextTemplateLiteralToken();
lastSourcePosition = token.location.end;
return token;
} | [
"private",
"TemplateLiteralToken",
"nextTemplateLiteralToken",
"(",
")",
"{",
"TemplateLiteralToken",
"token",
"=",
"scanner",
".",
"nextTemplateLiteralToken",
"(",
")",
";",
"lastSourcePosition",
"=",
"token",
".",
"location",
".",
"end",
";",
"return",
"token",
";... | Consumes a template literal token and returns it. | [
"Consumes",
"a",
"template",
"literal",
"token",
"and",
"returns",
"it",
"."
] | d81e36740f6a9e8ac31a825ee8758182e1dc5aae | https://github.com/google/closure-compiler/blob/d81e36740f6a9e8ac31a825ee8758182e1dc5aae/src/com/google/javascript/jscomp/parsing/parser/Parser.java#L4155-L4159 |
24,878 | google/closure-compiler | src/com/google/javascript/jscomp/parsing/parser/Parser.java | Parser.createLookaheadParser | @Deprecated
private Parser createLookaheadParser() {
return new Parser(
config,
new LookaheadErrorReporter(),
this.scanner.getFile(),
this.scanner.getOffset(),
inGeneratorContext());
} | java | @Deprecated
private Parser createLookaheadParser() {
return new Parser(
config,
new LookaheadErrorReporter(),
this.scanner.getFile(),
this.scanner.getOffset(),
inGeneratorContext());
} | [
"@",
"Deprecated",
"private",
"Parser",
"createLookaheadParser",
"(",
")",
"{",
"return",
"new",
"Parser",
"(",
"config",
",",
"new",
"LookaheadErrorReporter",
"(",
")",
",",
"this",
".",
"scanner",
".",
"getFile",
"(",
")",
",",
"this",
".",
"scanner",
".... | Forks the parser at the current point and returns a new
parser for speculative parsing.
@deprecated Creating a lookahead parser often leads to exponential parse times
(see issues #1049, #1115, and #1148 on github) so avoid using this if possible. | [
"Forks",
"the",
"parser",
"at",
"the",
"current",
"point",
"and",
"returns",
"a",
"new",
"parser",
"for",
"speculative",
"parsing",
"."
] | d81e36740f6a9e8ac31a825ee8758182e1dc5aae | https://github.com/google/closure-compiler/blob/d81e36740f6a9e8ac31a825ee8758182e1dc5aae/src/com/google/javascript/jscomp/parsing/parser/Parser.java#L4211-L4219 |
24,879 | google/closure-compiler | src/com/google/javascript/jscomp/type/SemanticReverseAbstractInterpreter.java | SemanticReverseAbstractInterpreter.maybeRestrictName | @CheckReturnValue
private FlowScope maybeRestrictName(
FlowScope blindScope, Node node, JSType originalType, JSType restrictedType) {
if (restrictedType != null && restrictedType != originalType) {
return declareNameInScope(blindScope, node, restrictedType);
}
return blindScope;
} | java | @CheckReturnValue
private FlowScope maybeRestrictName(
FlowScope blindScope, Node node, JSType originalType, JSType restrictedType) {
if (restrictedType != null && restrictedType != originalType) {
return declareNameInScope(blindScope, node, restrictedType);
}
return blindScope;
} | [
"@",
"CheckReturnValue",
"private",
"FlowScope",
"maybeRestrictName",
"(",
"FlowScope",
"blindScope",
",",
"Node",
"node",
",",
"JSType",
"originalType",
",",
"JSType",
"restrictedType",
")",
"{",
"if",
"(",
"restrictedType",
"!=",
"null",
"&&",
"restrictedType",
... | If the restrictedType differs from the originalType, then we should branch the current flow
scope and create a new flow scope with the name declared with the new type.
<p>We try not to create spurious child flow scopes as this makes type inference slower.
<p>We also do not want spurious slots around in type inference... | [
"If",
"the",
"restrictedType",
"differs",
"from",
"the",
"originalType",
"then",
"we",
"should",
"branch",
"the",
"current",
"flow",
"scope",
"and",
"create",
"a",
"new",
"flow",
"scope",
"with",
"the",
"name",
"declared",
"with",
"the",
"new",
"type",
"."
] | d81e36740f6a9e8ac31a825ee8758182e1dc5aae | https://github.com/google/closure-compiler/blob/d81e36740f6a9e8ac31a825ee8758182e1dc5aae/src/com/google/javascript/jscomp/type/SemanticReverseAbstractInterpreter.java#L401-L408 |
24,880 | google/closure-compiler | src/com/google/javascript/jscomp/type/SemanticReverseAbstractInterpreter.java | SemanticReverseAbstractInterpreter.caseIn | @CheckReturnValue
private FlowScope caseIn(Node object, String propertyName, FlowScope blindScope) {
JSType jsType = object.getJSType();
jsType = this.getRestrictedWithoutNull(jsType);
jsType = this.getRestrictedWithoutUndefined(jsType);
boolean hasProperty = false;
ObjectType objectType = Object... | java | @CheckReturnValue
private FlowScope caseIn(Node object, String propertyName, FlowScope blindScope) {
JSType jsType = object.getJSType();
jsType = this.getRestrictedWithoutNull(jsType);
jsType = this.getRestrictedWithoutUndefined(jsType);
boolean hasProperty = false;
ObjectType objectType = Object... | [
"@",
"CheckReturnValue",
"private",
"FlowScope",
"caseIn",
"(",
"Node",
"object",
",",
"String",
"propertyName",
",",
"FlowScope",
"blindScope",
")",
"{",
"JSType",
"jsType",
"=",
"object",
".",
"getJSType",
"(",
")",
";",
"jsType",
"=",
"this",
".",
"getRes... | Given 'property in object', ensures that the object has the property in the informed scope by
defining it as a qualified name if the object type lacks the property and it's not in the blind
scope.
@param object The node of the right-side of the in.
@param propertyName The string of the left-side of the in. | [
"Given",
"property",
"in",
"object",
"ensures",
"that",
"the",
"object",
"has",
"the",
"property",
"in",
"the",
"informed",
"scope",
"by",
"defining",
"it",
"as",
"a",
"qualified",
"name",
"if",
"the",
"object",
"type",
"lacks",
"the",
"property",
"and",
"... | d81e36740f6a9e8ac31a825ee8758182e1dc5aae | https://github.com/google/closure-compiler/blob/d81e36740f6a9e8ac31a825ee8758182e1dc5aae/src/com/google/javascript/jscomp/type/SemanticReverseAbstractInterpreter.java#L486-L509 |
24,881 | google/closure-compiler | src/com/google/javascript/jscomp/type/SemanticReverseAbstractInterpreter.java | SemanticReverseAbstractInterpreter.unwrap | private static FlowScope unwrap(FlowScope scope) {
while (scope instanceof RefinementTrackingFlowScope) {
scope = ((RefinementTrackingFlowScope) scope).delegate;
}
return scope;
} | java | private static FlowScope unwrap(FlowScope scope) {
while (scope instanceof RefinementTrackingFlowScope) {
scope = ((RefinementTrackingFlowScope) scope).delegate;
}
return scope;
} | [
"private",
"static",
"FlowScope",
"unwrap",
"(",
"FlowScope",
"scope",
")",
"{",
"while",
"(",
"scope",
"instanceof",
"RefinementTrackingFlowScope",
")",
"{",
"scope",
"=",
"(",
"(",
"RefinementTrackingFlowScope",
")",
"scope",
")",
".",
"delegate",
";",
"}",
... | Unwraps any RefinementTrackingFlowScopes. | [
"Unwraps",
"any",
"RefinementTrackingFlowScopes",
"."
] | d81e36740f6a9e8ac31a825ee8758182e1dc5aae | https://github.com/google/closure-compiler/blob/d81e36740f6a9e8ac31a825ee8758182e1dc5aae/src/com/google/javascript/jscomp/type/SemanticReverseAbstractInterpreter.java#L612-L617 |
24,882 | google/closure-compiler | src/com/google/javascript/jscomp/FunctionRewriter.java | FunctionRewriter.parseHelperCode | public Node parseHelperCode(Reducer reducer) {
Node root =
compiler.parseSyntheticCode(reducer.getClass() + ":helper", reducer.getHelperSource());
return (root != null) ? root.removeFirstChild() : null;
} | java | public Node parseHelperCode(Reducer reducer) {
Node root =
compiler.parseSyntheticCode(reducer.getClass() + ":helper", reducer.getHelperSource());
return (root != null) ? root.removeFirstChild() : null;
} | [
"public",
"Node",
"parseHelperCode",
"(",
"Reducer",
"reducer",
")",
"{",
"Node",
"root",
"=",
"compiler",
".",
"parseSyntheticCode",
"(",
"reducer",
".",
"getClass",
"(",
")",
"+",
"\":helper\"",
",",
"reducer",
".",
"getHelperSource",
"(",
")",
")",
";",
... | Parse helper code needed by a reducer.
@return Helper code root. If parse fails, return null. | [
"Parse",
"helper",
"code",
"needed",
"by",
"a",
"reducer",
"."
] | d81e36740f6a9e8ac31a825ee8758182e1dc5aae | https://github.com/google/closure-compiler/blob/d81e36740f6a9e8ac31a825ee8758182e1dc5aae/src/com/google/javascript/jscomp/FunctionRewriter.java#L115-L119 |
24,883 | google/closure-compiler | src/com/google/javascript/jscomp/parsing/Config.java | Config.buildAnnotations | private static ImmutableMap<String, Annotation> buildAnnotations(Iterable<String> whitelist) {
ImmutableMap.Builder<String, Annotation> annotationsBuilder = ImmutableMap.builder();
annotationsBuilder.putAll(Annotation.recognizedAnnotations);
for (String unrecognizedAnnotation : whitelist) {
if (!unrec... | java | private static ImmutableMap<String, Annotation> buildAnnotations(Iterable<String> whitelist) {
ImmutableMap.Builder<String, Annotation> annotationsBuilder = ImmutableMap.builder();
annotationsBuilder.putAll(Annotation.recognizedAnnotations);
for (String unrecognizedAnnotation : whitelist) {
if (!unrec... | [
"private",
"static",
"ImmutableMap",
"<",
"String",
",",
"Annotation",
">",
"buildAnnotations",
"(",
"Iterable",
"<",
"String",
">",
"whitelist",
")",
"{",
"ImmutableMap",
".",
"Builder",
"<",
"String",
",",
"Annotation",
">",
"annotationsBuilder",
"=",
"Immutab... | Create the annotation names from the user-specified annotation whitelist. | [
"Create",
"the",
"annotation",
"names",
"from",
"the",
"user",
"-",
"specified",
"annotation",
"whitelist",
"."
] | d81e36740f6a9e8ac31a825ee8758182e1dc5aae | https://github.com/google/closure-compiler/blob/d81e36740f6a9e8ac31a825ee8758182e1dc5aae/src/com/google/javascript/jscomp/parsing/Config.java#L189-L199 |
24,884 | google/closure-compiler | src/com/google/javascript/jscomp/ReferenceCollectingCallback.java | ReferenceCollectingCallback.processScope | void processScope(Scope scope) {
boolean shouldAddToBlockStack = !scope.isHoistScope();
this.narrowScope = scope;
if (shouldAddToBlockStack) {
blockStack.add(new BasicBlock(null, scope.getRootNode()));
}
(new NodeTraversal(compiler, this, scopeCreator)).traverseAtScope(scope);
if (shouldAd... | java | void processScope(Scope scope) {
boolean shouldAddToBlockStack = !scope.isHoistScope();
this.narrowScope = scope;
if (shouldAddToBlockStack) {
blockStack.add(new BasicBlock(null, scope.getRootNode()));
}
(new NodeTraversal(compiler, this, scopeCreator)).traverseAtScope(scope);
if (shouldAd... | [
"void",
"processScope",
"(",
"Scope",
"scope",
")",
"{",
"boolean",
"shouldAddToBlockStack",
"=",
"!",
"scope",
".",
"isHoistScope",
"(",
")",
";",
"this",
".",
"narrowScope",
"=",
"scope",
";",
"if",
"(",
"shouldAddToBlockStack",
")",
"{",
"blockStack",
"."... | Targets reference collection to a particular scope. | [
"Targets",
"reference",
"collection",
"to",
"a",
"particular",
"scope",
"."
] | d81e36740f6a9e8ac31a825ee8758182e1dc5aae | https://github.com/google/closure-compiler/blob/d81e36740f6a9e8ac31a825ee8758182e1dc5aae/src/com/google/javascript/jscomp/ReferenceCollectingCallback.java#L124-L135 |
24,885 | google/closure-compiler | src/com/google/javascript/jscomp/ReferenceCollectingCallback.java | ReferenceCollectingCallback.shouldTraverse | @Override
public boolean shouldTraverse(NodeTraversal nodeTraversal, Node n, Node parent) {
// We automatically traverse a hoisted function body when that function
// is first referenced, so that the reference lists are in the right order.
//
// TODO(nicksantos): Maybe generalize this to a continuatio... | java | @Override
public boolean shouldTraverse(NodeTraversal nodeTraversal, Node n, Node parent) {
// We automatically traverse a hoisted function body when that function
// is first referenced, so that the reference lists are in the right order.
//
// TODO(nicksantos): Maybe generalize this to a continuatio... | [
"@",
"Override",
"public",
"boolean",
"shouldTraverse",
"(",
"NodeTraversal",
"nodeTraversal",
",",
"Node",
"n",
",",
"Node",
"parent",
")",
"{",
"// We automatically traverse a hoisted function body when that function",
"// is first referenced, so that the reference lists are in t... | Updates block stack. | [
"Updates",
"block",
"stack",
"."
] | d81e36740f6a9e8ac31a825ee8758182e1dc5aae | https://github.com/google/closure-compiler/blob/d81e36740f6a9e8ac31a825ee8758182e1dc5aae/src/com/google/javascript/jscomp/ReferenceCollectingCallback.java#L270-L301 |
24,886 | google/closure-compiler | src/com/google/javascript/rhino/SourcePosition.java | SourcePosition.setPositionInformation | public void setPositionInformation(int startLineno, int startCharno,
int endLineno, int endCharno) {
if (startLineno > endLineno) {
throw new IllegalStateException(
"Recorded bad position information\n"
+ "start-line: " + startLineno + "\n"
+ ... | java | public void setPositionInformation(int startLineno, int startCharno,
int endLineno, int endCharno) {
if (startLineno > endLineno) {
throw new IllegalStateException(
"Recorded bad position information\n"
+ "start-line: " + startLineno + "\n"
+ ... | [
"public",
"void",
"setPositionInformation",
"(",
"int",
"startLineno",
",",
"int",
"startCharno",
",",
"int",
"endLineno",
",",
"int",
"endCharno",
")",
"{",
"if",
"(",
"startLineno",
">",
"endLineno",
")",
"{",
"throw",
"new",
"IllegalStateException",
"(",
"\... | Sets the position information contained in this source position. | [
"Sets",
"the",
"position",
"information",
"contained",
"in",
"this",
"source",
"position",
"."
] | d81e36740f6a9e8ac31a825ee8758182e1dc5aae | https://github.com/google/closure-compiler/blob/d81e36740f6a9e8ac31a825ee8758182e1dc5aae/src/com/google/javascript/rhino/SourcePosition.java#L83-L102 |
24,887 | google/closure-compiler | src/com/google/javascript/jscomp/deps/PathUtil.java | PathUtil.removeExtraneousSlashes | static String removeExtraneousSlashes(String s) {
int lastNonSlash = NON_SLASH_MATCHER.lastIndexIn(s);
if (lastNonSlash != -1) {
s = s.substring(0, lastNonSlash + 1);
}
return SLASH_MATCHER.collapseFrom(s, '/');
} | java | static String removeExtraneousSlashes(String s) {
int lastNonSlash = NON_SLASH_MATCHER.lastIndexIn(s);
if (lastNonSlash != -1) {
s = s.substring(0, lastNonSlash + 1);
}
return SLASH_MATCHER.collapseFrom(s, '/');
} | [
"static",
"String",
"removeExtraneousSlashes",
"(",
"String",
"s",
")",
"{",
"int",
"lastNonSlash",
"=",
"NON_SLASH_MATCHER",
".",
"lastIndexIn",
"(",
"s",
")",
";",
"if",
"(",
"lastNonSlash",
"!=",
"-",
"1",
")",
"{",
"s",
"=",
"s",
".",
"substring",
"(... | Removes extra slashes from a path. Leading slash is preserved, trailing
slash is stripped, and any runs of more than one slash in the middle is
replaced by a single slash. | [
"Removes",
"extra",
"slashes",
"from",
"a",
"path",
".",
"Leading",
"slash",
"is",
"preserved",
"trailing",
"slash",
"is",
"stripped",
"and",
"any",
"runs",
"of",
"more",
"than",
"one",
"slash",
"in",
"the",
"middle",
"is",
"replaced",
"by",
"a",
"single",... | d81e36740f6a9e8ac31a825ee8758182e1dc5aae | https://github.com/google/closure-compiler/blob/d81e36740f6a9e8ac31a825ee8758182e1dc5aae/src/com/google/javascript/jscomp/deps/PathUtil.java#L99-L106 |
24,888 | google/closure-compiler | src/com/google/javascript/jscomp/deps/PathUtil.java | PathUtil.makeAbsolute | public static String makeAbsolute(String path, String rootPath) {
if (!isAbsolute(path)) {
path = rootPath + "/" + path;
}
return collapseDots(path);
} | java | public static String makeAbsolute(String path, String rootPath) {
if (!isAbsolute(path)) {
path = rootPath + "/" + path;
}
return collapseDots(path);
} | [
"public",
"static",
"String",
"makeAbsolute",
"(",
"String",
"path",
",",
"String",
"rootPath",
")",
"{",
"if",
"(",
"!",
"isAbsolute",
"(",
"path",
")",
")",
"{",
"path",
"=",
"rootPath",
"+",
"\"/\"",
"+",
"path",
";",
"}",
"return",
"collapseDots",
... | Converts the given path into an absolute one. This prepends the given
rootPath and removes all .'s from the path. If an absolute path is given,
it will not be prefixed.
<p>Unlike File.getAbsolutePath(), this function does remove .'s from the
path and unlike File.getCanonicalPath(), this function does not resolve
symli... | [
"Converts",
"the",
"given",
"path",
"into",
"an",
"absolute",
"one",
".",
"This",
"prepends",
"the",
"given",
"rootPath",
"and",
"removes",
"all",
".",
"s",
"from",
"the",
"path",
".",
"If",
"an",
"absolute",
"path",
"is",
"given",
"it",
"will",
"not",
... | d81e36740f6a9e8ac31a825ee8758182e1dc5aae | https://github.com/google/closure-compiler/blob/d81e36740f6a9e8ac31a825ee8758182e1dc5aae/src/com/google/javascript/jscomp/deps/PathUtil.java#L138-L143 |
24,889 | google/closure-compiler | src/com/google/javascript/jscomp/deps/PathUtil.java | PathUtil.makeRelative | public static String makeRelative(String basePath, String targetPath) {
// Ensure the paths are both absolute or both relative.
if (isAbsolute(basePath) !=
isAbsolute(targetPath)) {
throw new IllegalArgumentException(
"Paths must both be relative or both absolute.\n" +
" baseP... | java | public static String makeRelative(String basePath, String targetPath) {
// Ensure the paths are both absolute or both relative.
if (isAbsolute(basePath) !=
isAbsolute(targetPath)) {
throw new IllegalArgumentException(
"Paths must both be relative or both absolute.\n" +
" baseP... | [
"public",
"static",
"String",
"makeRelative",
"(",
"String",
"basePath",
",",
"String",
"targetPath",
")",
"{",
"// Ensure the paths are both absolute or both relative.",
"if",
"(",
"isAbsolute",
"(",
"basePath",
")",
"!=",
"isAbsolute",
"(",
"targetPath",
")",
")",
... | Returns targetPath relative to basePath.
<p>basePath and targetPath must either both be relative, or both be
absolute paths.</p>
<p>This function is different from makeRelative
in that it is able to add in ../ components and collapse existing ones as well.</p>
Examples:
base="some/relative/path" target="some/relativ... | [
"Returns",
"targetPath",
"relative",
"to",
"basePath",
"."
] | d81e36740f6a9e8ac31a825ee8758182e1dc5aae | https://github.com/google/closure-compiler/blob/d81e36740f6a9e8ac31a825ee8758182e1dc5aae/src/com/google/javascript/jscomp/deps/PathUtil.java#L165-L210 |
24,890 | google/closure-compiler | src/com/google/javascript/jscomp/DataFlowAnalysis.java | DataFlowAnalysis.initialize | protected void initialize() {
// TODO(user): Calling clear doesn't deallocate the memory in a
// LinkedHashSet. Consider creating a new work set if we plan to repeatedly
// call analyze.
orderedWorkSet.clear();
for (DiGraphNode<N, Branch> node : cfg.getDirectedGraphNodes()) {
node.setAnnotatio... | java | protected void initialize() {
// TODO(user): Calling clear doesn't deallocate the memory in a
// LinkedHashSet. Consider creating a new work set if we plan to repeatedly
// call analyze.
orderedWorkSet.clear();
for (DiGraphNode<N, Branch> node : cfg.getDirectedGraphNodes()) {
node.setAnnotatio... | [
"protected",
"void",
"initialize",
"(",
")",
"{",
"// TODO(user): Calling clear doesn't deallocate the memory in a",
"// LinkedHashSet. Consider creating a new work set if we plan to repeatedly",
"// call analyze.",
"orderedWorkSet",
".",
"clear",
"(",
")",
";",
"for",
"(",
"DiGrap... | Initializes the work list and the control flow graph. | [
"Initializes",
"the",
"work",
"list",
"and",
"the",
"control",
"flow",
"graph",
"."
] | d81e36740f6a9e8ac31a825ee8758182e1dc5aae | https://github.com/google/closure-compiler/blob/d81e36740f6a9e8ac31a825ee8758182e1dc5aae/src/com/google/javascript/jscomp/DataFlowAnalysis.java#L241-L253 |
24,891 | google/closure-compiler | src/com/google/javascript/jscomp/DataFlowAnalysis.java | DataFlowAnalysis.flow | protected boolean flow(DiGraphNode<N, Branch> node) {
FlowState<L> state = node.getAnnotation();
if (isForward()) {
L outBefore = state.out;
state.out = flowThrough(node.getValue(), state.in);
return !outBefore.equals(state.out);
} else {
L inBefore = state.in;
state.in = flowT... | java | protected boolean flow(DiGraphNode<N, Branch> node) {
FlowState<L> state = node.getAnnotation();
if (isForward()) {
L outBefore = state.out;
state.out = flowThrough(node.getValue(), state.in);
return !outBefore.equals(state.out);
} else {
L inBefore = state.in;
state.in = flowT... | [
"protected",
"boolean",
"flow",
"(",
"DiGraphNode",
"<",
"N",
",",
"Branch",
">",
"node",
")",
"{",
"FlowState",
"<",
"L",
">",
"state",
"=",
"node",
".",
"getAnnotation",
"(",
")",
";",
"if",
"(",
"isForward",
"(",
")",
")",
"{",
"L",
"outBefore",
... | Performs a single flow through a node.
@return {@code true} if the flow state differs from the previous state. | [
"Performs",
"a",
"single",
"flow",
"through",
"a",
"node",
"."
] | d81e36740f6a9e8ac31a825ee8758182e1dc5aae | https://github.com/google/closure-compiler/blob/d81e36740f6a9e8ac31a825ee8758182e1dc5aae/src/com/google/javascript/jscomp/DataFlowAnalysis.java#L260-L271 |
24,892 | google/closure-compiler | src/com/google/javascript/jscomp/ReplaceStrings.java | ReplaceStrings.getResult | List<Result> getResult() {
return ImmutableList.copyOf(Iterables.filter(results.values(), USED_RESULTS));
} | java | List<Result> getResult() {
return ImmutableList.copyOf(Iterables.filter(results.values(), USED_RESULTS));
} | [
"List",
"<",
"Result",
">",
"getResult",
"(",
")",
"{",
"return",
"ImmutableList",
".",
"copyOf",
"(",
"Iterables",
".",
"filter",
"(",
"results",
".",
"values",
"(",
")",
",",
"USED_RESULTS",
")",
")",
";",
"}"
] | Get the list of all replacements performed. | [
"Get",
"the",
"list",
"of",
"all",
"replacements",
"performed",
"."
] | d81e36740f6a9e8ac31a825ee8758182e1dc5aae | https://github.com/google/closure-compiler/blob/d81e36740f6a9e8ac31a825ee8758182e1dc5aae/src/com/google/javascript/jscomp/ReplaceStrings.java#L172-L174 |
24,893 | google/closure-compiler | src/com/google/javascript/jscomp/ReplaceStrings.java | ReplaceStrings.getStringMap | VariableMap getStringMap() {
ImmutableMap.Builder<String, String> map = ImmutableMap.builder();
for (Result result : Iterables.filter(results.values(), USED_RESULTS)) {
map.put(result.replacement, result.original);
}
VariableMap stringMap = new VariableMap(map.build());
return stringMap;
} | java | VariableMap getStringMap() {
ImmutableMap.Builder<String, String> map = ImmutableMap.builder();
for (Result result : Iterables.filter(results.values(), USED_RESULTS)) {
map.put(result.replacement, result.original);
}
VariableMap stringMap = new VariableMap(map.build());
return stringMap;
} | [
"VariableMap",
"getStringMap",
"(",
")",
"{",
"ImmutableMap",
".",
"Builder",
"<",
"String",
",",
"String",
">",
"map",
"=",
"ImmutableMap",
".",
"builder",
"(",
")",
";",
"for",
"(",
"Result",
"result",
":",
"Iterables",
".",
"filter",
"(",
"results",
"... | Get the list of replaces as a VariableMap | [
"Get",
"the",
"list",
"of",
"replaces",
"as",
"a",
"VariableMap"
] | d81e36740f6a9e8ac31a825ee8758182e1dc5aae | https://github.com/google/closure-compiler/blob/d81e36740f6a9e8ac31a825ee8758182e1dc5aae/src/com/google/javascript/jscomp/ReplaceStrings.java#L177-L185 |
24,894 | google/closure-compiler | src/com/google/javascript/jscomp/ReplaceStrings.java | ReplaceStrings.doSubstitutions | private void doSubstitutions(NodeTraversal t, Config config, Node n) {
if (n.isTaggedTemplateLit()) {
// This is currently not supported, since tagged template literals have a different calling
// convention than ordinary functions, so it's unclear which arguments are expected to be
// replaced. S... | java | private void doSubstitutions(NodeTraversal t, Config config, Node n) {
if (n.isTaggedTemplateLit()) {
// This is currently not supported, since tagged template literals have a different calling
// convention than ordinary functions, so it's unclear which arguments are expected to be
// replaced. S... | [
"private",
"void",
"doSubstitutions",
"(",
"NodeTraversal",
"t",
",",
"Config",
"config",
",",
"Node",
"n",
")",
"{",
"if",
"(",
"n",
".",
"isTaggedTemplateLit",
"(",
")",
")",
"{",
"// This is currently not supported, since tagged template literals have a different cal... | Replace the parameters specified in the config, if possible. | [
"Replace",
"the",
"parameters",
"specified",
"in",
"the",
"config",
"if",
"possible",
"."
] | d81e36740f6a9e8ac31a825ee8758182e1dc5aae | https://github.com/google/closure-compiler/blob/d81e36740f6a9e8ac31a825ee8758182e1dc5aae/src/com/google/javascript/jscomp/ReplaceStrings.java#L280-L306 |
24,895 | google/closure-compiler | src/com/google/javascript/jscomp/ReplaceStrings.java | ReplaceStrings.replaceExpression | private Node replaceExpression(NodeTraversal t, Node expr, Node parent) {
Node replacement;
String key = null;
String replacementString;
switch (expr.getToken()) {
case STRING:
key = expr.getString();
replacementString = getReplacement(key);
replacement = IR.string(replacem... | java | private Node replaceExpression(NodeTraversal t, Node expr, Node parent) {
Node replacement;
String key = null;
String replacementString;
switch (expr.getToken()) {
case STRING:
key = expr.getString();
replacementString = getReplacement(key);
replacement = IR.string(replacem... | [
"private",
"Node",
"replaceExpression",
"(",
"NodeTraversal",
"t",
",",
"Node",
"expr",
",",
"Node",
"parent",
")",
"{",
"Node",
"replacement",
";",
"String",
"key",
"=",
"null",
";",
"String",
"replacementString",
";",
"switch",
"(",
"expr",
".",
"getToken"... | Replaces a string expression with a short encoded string expression.
@param t The traversal
@param expr The expression node
@param parent The expression node's parent
@return The replacement node (or the original expression if no replacement is made) | [
"Replaces",
"a",
"string",
"expression",
"with",
"a",
"short",
"encoded",
"string",
"expression",
"."
] | d81e36740f6a9e8ac31a825ee8758182e1dc5aae | https://github.com/google/closure-compiler/blob/d81e36740f6a9e8ac31a825ee8758182e1dc5aae/src/com/google/javascript/jscomp/ReplaceStrings.java#L316-L355 |
24,896 | google/closure-compiler | src/com/google/javascript/jscomp/ReplaceStrings.java | ReplaceStrings.getReplacement | private String getReplacement(String key) {
Result result = results.get(key);
if (result != null) {
return result.replacement;
}
String replacement = nameGenerator.generateNextName();
result = new Result(key, replacement);
results.put(key, result);
return replacement;
} | java | private String getReplacement(String key) {
Result result = results.get(key);
if (result != null) {
return result.replacement;
}
String replacement = nameGenerator.generateNextName();
result = new Result(key, replacement);
results.put(key, result);
return replacement;
} | [
"private",
"String",
"getReplacement",
"(",
"String",
"key",
")",
"{",
"Result",
"result",
"=",
"results",
".",
"get",
"(",
"key",
")",
";",
"if",
"(",
"result",
"!=",
"null",
")",
"{",
"return",
"result",
".",
"replacement",
";",
"}",
"String",
"repla... | Get a replacement string for the provide key text. | [
"Get",
"a",
"replacement",
"string",
"for",
"the",
"provide",
"key",
"text",
"."
] | d81e36740f6a9e8ac31a825ee8758182e1dc5aae | https://github.com/google/closure-compiler/blob/d81e36740f6a9e8ac31a825ee8758182e1dc5aae/src/com/google/javascript/jscomp/ReplaceStrings.java#L358-L368 |
24,897 | google/closure-compiler | src/com/google/javascript/jscomp/ReplaceStrings.java | ReplaceStrings.recordReplacement | private void recordReplacement(String key) {
Result result = results.get(key);
checkState(result != null);
result.didReplacement = true;
} | java | private void recordReplacement(String key) {
Result result = results.get(key);
checkState(result != null);
result.didReplacement = true;
} | [
"private",
"void",
"recordReplacement",
"(",
"String",
"key",
")",
"{",
"Result",
"result",
"=",
"results",
".",
"get",
"(",
"key",
")",
";",
"checkState",
"(",
"result",
"!=",
"null",
")",
";",
"result",
".",
"didReplacement",
"=",
"true",
";",
"}"
] | Record the location the replacement was made. | [
"Record",
"the",
"location",
"the",
"replacement",
"was",
"made",
"."
] | d81e36740f6a9e8ac31a825ee8758182e1dc5aae | https://github.com/google/closure-compiler/blob/d81e36740f6a9e8ac31a825ee8758182e1dc5aae/src/com/google/javascript/jscomp/ReplaceStrings.java#L371-L376 |
24,898 | google/closure-compiler | src/com/google/javascript/jscomp/ReplaceStrings.java | ReplaceStrings.getMethodFromDeclarationName | private static String getMethodFromDeclarationName(String fullDeclarationName) {
String[] parts = fullDeclarationName.split("\\.prototype\\.");
checkState(parts.length == 1 || parts.length == 2);
if (parts.length == 2) {
return parts[1];
}
return null;
} | java | private static String getMethodFromDeclarationName(String fullDeclarationName) {
String[] parts = fullDeclarationName.split("\\.prototype\\.");
checkState(parts.length == 1 || parts.length == 2);
if (parts.length == 2) {
return parts[1];
}
return null;
} | [
"private",
"static",
"String",
"getMethodFromDeclarationName",
"(",
"String",
"fullDeclarationName",
")",
"{",
"String",
"[",
"]",
"parts",
"=",
"fullDeclarationName",
".",
"split",
"(",
"\"\\\\.prototype\\\\.\"",
")",
";",
"checkState",
"(",
"parts",
".",
"length",... | From a provide name extract the method name. | [
"From",
"a",
"provide",
"name",
"extract",
"the",
"method",
"name",
"."
] | d81e36740f6a9e8ac31a825ee8758182e1dc5aae | https://github.com/google/closure-compiler/blob/d81e36740f6a9e8ac31a825ee8758182e1dc5aae/src/com/google/javascript/jscomp/ReplaceStrings.java#L439-L446 |
24,899 | google/closure-compiler | src/com/google/javascript/jscomp/ReplaceStrings.java | ReplaceStrings.getClassFromDeclarationName | private static String getClassFromDeclarationName(String fullDeclarationName) {
String[] parts = fullDeclarationName.split("\\.prototype\\.");
checkState(parts.length == 1 || parts.length == 2);
if (parts.length == 2) {
return parts[0];
}
return null;
} | java | private static String getClassFromDeclarationName(String fullDeclarationName) {
String[] parts = fullDeclarationName.split("\\.prototype\\.");
checkState(parts.length == 1 || parts.length == 2);
if (parts.length == 2) {
return parts[0];
}
return null;
} | [
"private",
"static",
"String",
"getClassFromDeclarationName",
"(",
"String",
"fullDeclarationName",
")",
"{",
"String",
"[",
"]",
"parts",
"=",
"fullDeclarationName",
".",
"split",
"(",
"\"\\\\.prototype\\\\.\"",
")",
";",
"checkState",
"(",
"parts",
".",
"length",
... | From a provide name extract the class name. | [
"From",
"a",
"provide",
"name",
"extract",
"the",
"class",
"name",
"."
] | d81e36740f6a9e8ac31a825ee8758182e1dc5aae | https://github.com/google/closure-compiler/blob/d81e36740f6a9e8ac31a825ee8758182e1dc5aae/src/com/google/javascript/jscomp/ReplaceStrings.java#L449-L456 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.