本文整理汇总了Java中com.google.javascript.jscomp.MakeDeclaredNamesUnique.InlineRenamer类的典型用法代码示例。如果您正苦于以下问题:Java InlineRenamer类的具体用法?Java InlineRenamer怎么用?Java InlineRenamer使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
InlineRenamer类属于com.google.javascript.jscomp.MakeDeclaredNamesUnique包,在下文中一共展示了InlineRenamer类的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getProcessor
import com.google.javascript.jscomp.MakeDeclaredNamesUnique.InlineRenamer; //导入依赖的package包/类
@Override
public CompilerPass getProcessor(final Compiler compiler) {
if (!invert) {
return new CompilerPass() {
@Override
public void process(Node externs, Node root) {
compiler.resetUniqueNameId();
MakeDeclaredNamesUnique renamer = null;
if (useDefaultRenamer) {
renamer = new MakeDeclaredNamesUnique();
} else {
renamer = new MakeDeclaredNamesUnique(
new InlineRenamer(
compiler.getUniqueNameIdSupplier(),
localNamePrefix,
removeConst));
}
NodeTraversal.traverseRoots(
compiler, Lists.newArrayList(externs, root), renamer);
}
};
} else {
return MakeDeclaredNamesUnique.getContextualRenameInverter(compiler);
}
}
示例2: makeLocalNamesUnique
import com.google.javascript.jscomp.MakeDeclaredNamesUnique.InlineRenamer; //导入依赖的package包/类
/**
* Fix-up all local names to be unique for this subtree.
* @param fnNode A mutable instance of the function to be inlined.
*/
private void makeLocalNamesUnique(Node fnNode, boolean isCallInLoop) {
Supplier<String> idSupplier = compiler.getUniqueNameIdSupplier();
// Make variable names unique to this instance.
NodeTraversal.traverseEs6ScopeRoots(
compiler,
null,
ImmutableList.of(fnNode),
new MakeDeclaredNamesUnique(
new InlineRenamer(
compiler.getCodingConvention(), idSupplier, "inline_", isCallInLoop, true, null),
false),
true);
// Make label names unique to this instance.
new RenameLabels(compiler, new LabelNameSupplier(idSupplier), false, false)
.process(null, fnNode);
}
示例3: getProcessor
import com.google.javascript.jscomp.MakeDeclaredNamesUnique.InlineRenamer; //导入依赖的package包/类
@Override
protected CompilerPass getProcessor(final Compiler compiler) {
if (!invert) {
return new CompilerPass() {
@Override
public void process(Node externs, Node root) {
compiler.resetUniqueNameId();
MakeDeclaredNamesUnique renamer;
if (useDefaultRenamer) {
renamer = new MakeDeclaredNamesUnique();
} else {
renamer = new MakeDeclaredNamesUnique(new InlineRenamer(compiler.getCodingConvention(),
compiler.getUniqueNameIdSupplier(), localNamePrefix, removeConst, true, null));
}
NodeTraversal.traverseRootsEs6(compiler, renamer, externs, root);
}
};
} else {
return MakeDeclaredNamesUnique.getContextualRenameInverter(compiler);
}
}
示例4: getProcessor
import com.google.javascript.jscomp.MakeDeclaredNamesUnique.InlineRenamer; //导入依赖的package包/类
@Override
public CompilerPass getProcessor(final Compiler compiler) {
if (!invert) {
return new CompilerPass() {
@Override
public void process(Node externs, Node root) {
compiler.resetUniqueNameId();
MakeDeclaredNamesUnique renamer = null;
if (useDefaultRenamer) {
renamer = new MakeDeclaredNamesUnique();
} else {
renamer = new MakeDeclaredNamesUnique(
new InlineRenamer(
compiler.getCodingConvention(),
compiler.getUniqueNameIdSupplier(),
localNamePrefix,
removeConst));
}
NodeTraversal.traverseRoots(
compiler, Lists.newArrayList(externs, root), renamer);
}
};
} else {
return MakeDeclaredNamesUnique.getContextualRenameInverter(compiler);
}
}
示例5: makeLocalNamesUnique
import com.google.javascript.jscomp.MakeDeclaredNamesUnique.InlineRenamer; //导入依赖的package包/类
/**
* Fix-up all local names to be unique for this subtree.
* @param fnNode A mutable instance of the function to be inlined.
*/
private void makeLocalNamesUnique(Node fnNode, boolean isCallInLoop) {
NodeTraversal.traverse(
compiler, fnNode, new MakeDeclaredNamesUnique(
new InlineRenamer(
compiler.getUniqueNameIdSupplier(),
"inline_",
isCallInLoop)));
}
示例6: makeLocalNamesUnique
import com.google.javascript.jscomp.MakeDeclaredNamesUnique.InlineRenamer; //导入依赖的package包/类
/**
* Fix-up all local names to be unique for this subtree.
* @param fnNode A mutable instance of the function to be inlined.
*/
private void makeLocalNamesUnique(Node fnNode, boolean isCallInLoop) {
Supplier<String> idSupplier = compiler.getUniqueNameIdSupplier();
// Make variable names unique to this instance.
NodeTraversal.traverse(
compiler, fnNode, new MakeDeclaredNamesUnique(
new InlineRenamer(
idSupplier,
"inline_",
isCallInLoop)));
// Make label names unique to this instance.
new RenameLabels(compiler, new LabelNameSupplier(idSupplier), false)
.process(null, fnNode);
}
示例7: makeLocalNamesUnique
import com.google.javascript.jscomp.MakeDeclaredNamesUnique.InlineRenamer; //导入依赖的package包/类
/**
* Fix-up all local names to be unique for this subtree.
* @param fnNode A mutable instance of the function to be inlined.
*/
private void makeLocalNamesUnique(Node fnNode, boolean isCallInLoop) {
Supplier<String> idSupplier = compiler.getUniqueNameIdSupplier();
// Make variable names unique to this instance.
NodeTraversal.traverse(
compiler, fnNode, new MakeDeclaredNamesUnique(
new InlineRenamer(
compiler.getCodingConvention(),
idSupplier,
"inline_",
isCallInLoop)));
// Make label names unique to this instance.
new RenameLabels(compiler, new LabelNameSupplier(idSupplier), false)
.process(null, fnNode);
}