org.jruby.Ruby.setupSourceEncoding()方法的使用及代码示例

x33g5p2x  于2022-01-29 转载在 其他  
字(4.0k)|赞(0)|评价(0)|浏览(112)

本文整理了Java中org.jruby.Ruby.setupSourceEncoding方法的一些代码示例,展示了Ruby.setupSourceEncoding的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Ruby.setupSourceEncoding方法的具体详情如下:
包路径:org.jruby.Ruby
类名称:Ruby
方法名:setupSourceEncoding

Ruby.setupSourceEncoding介绍

暂无

代码示例

代码示例来源:origin: org.jruby/jruby-complete

private Node parseFileAndGetAST(InputStream in, String file, DynamicScope scope, int lineNumber, boolean isFromMain) {
  ParserConfiguration parserConfig =
      new ParserConfiguration(this, lineNumber, false, true, isFromMain, config);
  setupSourceEncoding(parserConfig, UTF8Encoding.INSTANCE);
  return parser.parse(file, in, scope, parserConfig);
}

代码示例来源:origin: org.jruby/jruby-core

private Node parseFileAndGetAST(InputStream in, String file, DynamicScope scope, int lineNumber, boolean isFromMain) {
  ParserConfiguration parserConfig =
      new ParserConfiguration(this, lineNumber, false, true, isFromMain, config);
  setupSourceEncoding(parserConfig, UTF8Encoding.INSTANCE);
  return parser.parse(file, in, scope, parserConfig);
}

代码示例来源:origin: com.ning.billing/killbill-osgi-bundles-jruby

public Node parseInline(InputStream in, String file, DynamicScope scope) {
  if (parserStats != null) parserStats.addEvalParse();
  ParserConfiguration parserConfig =
      new ParserConfiguration(this, 0, false, true, false, config);
  if (is1_9) {
    setupSourceEncoding(parserConfig);
  }
  return parser.parse(file, in, scope, parserConfig);
}

代码示例来源:origin: org.kill-bill.billing/killbill-osgi-bundles-jruby

public Node parseInline(InputStream in, String file, DynamicScope scope) {
  if (parserStats != null) parserStats.addEvalParse();
  ParserConfiguration parserConfig =
      new ParserConfiguration(this, 0, false, true, false, config);
  if (is1_9) {
    setupSourceEncoding(parserConfig);
  }
  return parser.parse(file, in, scope, parserConfig);
}

代码示例来源:origin: com.ning.billing/killbill-osgi-bundles-jruby

public Node parseFile(InputStream in, String file, DynamicScope scope, int lineNumber) {
  if (parserStats != null) parserStats.addLoadParse();
  ParserConfiguration parserConfig =
      new ParserConfiguration(this, lineNumber, false, false, true, config);
  if (is2_0 ||
      (is1_9 && config.getSourceEncoding() != null)) {
    setupSourceEncoding(parserConfig);
  }
  return parser.parse(file, in, scope, parserConfig);
}

代码示例来源:origin: com.ning.billing/killbill-osgi-bundles-jruby

public Node parseFileFromMain(InputStream in, String file, DynamicScope scope) {
  if (parserStats != null) parserStats.addLoadParse();
  ParserConfiguration parserConfig =
      new ParserConfiguration(this, 0, false, false, true, true, config);
  if (is2_0 ||
      (is1_9 && config.getSourceEncoding() != null)) {
    setupSourceEncoding(parserConfig);
  }
  return parser.parse(file, in, scope, parserConfig);
}

代码示例来源:origin: org.kill-bill.billing/killbill-osgi-bundles-jruby

public Node parseFile(InputStream in, String file, DynamicScope scope, int lineNumber) {
  if (parserStats != null) parserStats.addLoadParse();
  ParserConfiguration parserConfig =
      new ParserConfiguration(this, lineNumber, false, false, true, config);
  if (is2_0 ||
      (is1_9 && config.getSourceEncoding() != null)) {
    setupSourceEncoding(parserConfig);
  }
  return parser.parse(file, in, scope, parserConfig);
}

代码示例来源:origin: org.kill-bill.billing/killbill-osgi-bundles-jruby

public Node parseFileFromMain(InputStream in, String file, DynamicScope scope) {
  if (parserStats != null) parserStats.addLoadParse();
  ParserConfiguration parserConfig =
      new ParserConfiguration(this, 0, false, false, true, true, config);
  if (is2_0 ||
      (is1_9 && config.getSourceEncoding() != null)) {
    setupSourceEncoding(parserConfig);
  }
  return parser.parse(file, in, scope, parserConfig);
}

代码示例来源:origin: org.jruby/jruby-core

public Node parseInline(InputStream in, String file, DynamicScope scope) {
  addEvalParseToStats();
  ParserConfiguration parserConfig =
      new ParserConfiguration(this, 0, false, true, false, config);
  setupSourceEncoding(parserConfig, getEncodingService().getLocaleEncoding());
  return parser.parse(file, in, scope, parserConfig);
}

代码示例来源:origin: org.jruby/jruby-complete

public Node parseInline(InputStream in, String file, DynamicScope scope) {
  addEvalParseToStats();
  ParserConfiguration parserConfig =
      new ParserConfiguration(this, 0, false, true, false, config);
  setupSourceEncoding(parserConfig, getEncodingService().getLocaleEncoding());
  return parser.parse(file, in, scope, parserConfig);
}

相关文章

Ruby类方法