/** * IRBuild.buildGetDefinition returns a frozen string and this is for all intern'd Java strings. */ public FrozenString(String s) { this(s, ByteList.create(s)); }
public XStrNode(ISourcePosition position, ByteList value, int coderange) { // FIXME: Shouldn't this have codeRange like StrNode? super(position, false); this.value = (value == null ? ByteList.create("") : value); this.coderange = coderange; }
public XStrNode(ISourcePosition position, ByteList value, int coderange) { // FIXME: Shouldn't this have codeRange like StrNode? super(position, false); this.value = (value == null ? ByteList.create("") : value); this.coderange = coderange; }
/** * IRBuild.buildGetDefinition returns a frozen string and this is for all intern'd Java strings. */ public FrozenString(String s) { this(s, ByteList.create(s)); }
public XStrNode(ISourcePosition position, ByteList value) { // FIXME: Shouldn't this have codeRange like StrNode? super(position); this.value = (value == null ? ByteList.create("") : value); }
public XStrNode(ISourcePosition position, ByteList value) { // FIXME: Shouldn't this have codeRange like StrNode? super(position); this.value = (value == null ? ByteList.create("") : value); }
public InlineMacroProcessor(String macroName, DocumentRuby documentRuby) { super(macroName, documentRuby); ByteList pattern = ByteList.create(macroName + ":(\\S+?)\\[.*?\\]"); regexp = RubyRegexp.newRegexp(rubyRuntime, pattern); }
@JRubyMethod(module = true) public static synchronized IRubyObject systmpdir(ThreadContext context, IRubyObject recv) { Ruby runtime = context.getRuntime(); ByteList tmp = ByteList.create(System.getProperty("java.io.tmpdir")); // default for all platforms except Windows if (Platform.IS_WINDOWS) { String commonAppData = System.getenv("CSIDL_COMMON_APPDATA"); if (commonAppData != null) tmp = ByteList.create(commonAppData); } RubyString ret = RubyString.newString(runtime, tmp, runtime.getDefaultExternalEncoding()); ret.untaint(context); return ret; }
@Override public Object execute(ParserSupport support, RubyYaccLexer lexer, Object yyVal, Object[] yyVals, int yyTop) { yyVal = new StrNode(lexer.getPosition(), ByteList.create("")); return yyVal; } };
@JRubyMethod(module = true) public static synchronized IRubyObject systmpdir(ThreadContext context, IRubyObject recv) { Ruby runtime = context.getRuntime(); ByteList tmp = ByteList.create(System.getProperty("java.io.tmpdir")); // default for all platforms except Windows if (Platform.IS_WINDOWS) { String commonAppData = System.getenv("CSIDL_COMMON_APPDATA"); if (commonAppData != null) tmp = ByteList.create(commonAppData); } RubyString ret = RubyString.newString(runtime, tmp, runtime.getDefaultExternalEncoding()); ret.untaint(context); return ret; }
@Override public Object execute(ParserSupport support, RubyLexer lexer, Object yyVal, Object[] yyVals, int yyTop) { ByteList aChar = ByteList.create(""); aChar.setEncoding(lexer.getEncoding()); yyVal = lexer.createStr(aChar, 0); return yyVal; } };
@Override public Object execute(ParserSupport support, RubyLexer lexer, Object yyVal, Object[] yyVals, int yyTop) { ByteList aChar = ByteList.create(""); aChar.setEncoding(lexer.getEncoding()); yyVal = lexer.createStr(aChar, 0); return yyVal; } };
private void initDefinedMessages() { for (DefinedMessage definedMessage : DefinedMessage.values()) { RubyString str = RubyString.newString(this, ByteList.create(definedMessage.getText())); str.setFrozen(true); definedMessages.put(definedMessage, str); } }
private void initDefinedMessages() { for (DefinedMessage definedMessage : DefinedMessage.values()) { RubyString str = freezeAndDedupString( RubyString.newString(this, ByteList.create(definedMessage.getText()))); definedMessages.put(definedMessage, str); } }
private void initDefinedMessages() { for (DefinedMessage definedMessage : DefinedMessage.values()) { RubyString str = freezeAndDedupString( RubyString.newString(this, ByteList.create(definedMessage.getText()))); definedMessages.put(definedMessage, str); } }
@Override public Object execute(ParserSupport support, RubyYaccLexer lexer, Object yyVal, Object[] yyVals, int yyTop) { ByteList aChar = ByteList.create(""); aChar.setEncoding(lexer.getEncoding()); yyVal = lexer.createStrNode(((Token)yyVals[0+yyTop]).getPosition(), aChar, 0); return yyVal; } };
@Override public Object execute(ParserSupport support, RubyYaccLexer lexer, Object yyVal, Object[] yyVals, int yyTop) { ByteList aChar = ByteList.create(""); aChar.setEncoding(lexer.getEncoding()); yyVal = lexer.createStrNode(((Token)yyVals[0+yyTop]).getPosition(), aChar, 0); return yyVal; } };
private ByteList createMaster(RegexpOptions options) { if (lexer.isOneEight()) { return ByteList.create(""); } else { Encoding encoding = options.setup19(configuration.getRuntime()); return new ByteList(new byte[] {}, encoding); } }
public IRubyObject getDefaultExternal() { Encoding defaultEncoding = runtime.getDefaultExternalEncoding(); if (defaultEncoding == null) { // TODO: MRI seems to default blindly to US-ASCII and we were using Charset default from Java...which is right? ByteList encodingName = ByteList.create("US-ASCII"); defaultEncoding = runtime.getEncodingService().loadEncoding(encodingName); runtime.setDefaultExternalEncoding(defaultEncoding); } return getEncoding(defaultEncoding); }
public IRubyObject getDefaultExternal() { Encoding defaultEncoding = runtime.getDefaultExternalEncoding(); if (defaultEncoding == null) { // TODO: MRI seems to default blindly to US-ASCII and we were using Charset default from Java...which is right? ByteList encodingName = ByteList.create("US-ASCII"); defaultEncoding = runtime.getEncodingService().loadEncoding(encodingName); runtime.setDefaultExternalEncoding(defaultEncoding); } return getEncoding(defaultEncoding); }