当前位置: 首页>>代码示例>>Java>>正文


Java InlineRenamer类代码示例

本文整理汇总了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);
  }
}
 
开发者ID:andyjko,项目名称:feedlack,代码行数:26,代码来源:MakeDeclaredNamesUniqueTest.java

示例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);
}
 
开发者ID:google,项目名称:closure-compiler,代码行数:21,代码来源:FunctionToBlockMutator.java

示例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);
  }
}
 
开发者ID:google,项目名称:closure-compiler,代码行数:22,代码来源:MakeDeclaredNamesUniqueTest.java

示例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);
  }
}
 
开发者ID:nicks,项目名称:closure-compiler-old,代码行数:27,代码来源:MakeDeclaredNamesUniqueTest.java

示例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)));
}
 
开发者ID:andyjko,项目名称:feedlack,代码行数:13,代码来源:FunctionToBlockMutator.java

示例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);
}
 
开发者ID:SpoonLabs,项目名称:astor,代码行数:18,代码来源:FunctionToBlockMutator.java

示例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);
}
 
开发者ID:nicks,项目名称:closure-compiler-old,代码行数:19,代码来源:FunctionToBlockMutator.java


注:本文中的com.google.javascript.jscomp.MakeDeclaredNamesUnique.InlineRenamer类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。