/** * @see Object#clone() */ @Override public Object clone() { return dup(); }
/** * creates a duplicate of this bytelist but only in the case of a stringValue and its resulting * hash value. No other elements are duplicated. */ public ByteList dup() { ByteList dup = dup(realSize); dup.hash = hash; dup.stringValue = stringValue; return dup; }
/** * creates a duplicate of this bytelist but only in the case of a stringValue and its resulting * hash value. No other elements are duplicated. */ public ByteList dup() { ByteList dup = dup(realSize); dup.hash = hash; dup.stringValue = stringValue; return dup; }
/** * @see Object#clone() */ @Override public Object clone() { return dup(); }
/** * @see Object#clone() */ @Override public Object clone() { return dup(); }
/** * creates a duplicate of this bytelist but only in the case of a stringValue and its resulting * hash value. No other elements are duplicated. */ public ByteList dup() { ByteList dup = dup(realSize); dup.hash = hash; dup.stringValue = stringValue; return dup; }
/** * Make an instance variable out of this symbol (e.g. :foo will generate :foo=). * @return the new symbol */ public RubySymbol asWriter() { ByteList bytes = getBytes().dup(); bytes.append((byte) '='); return newIDSymbol(getRuntime(), bytes); }
public void dispatchDelayedToken(int token) { //mri: ripper_dispatch_delayed_token int saved_line = ruby_sourceline; int saved_tokp = tokp; ruby_sourceline = delayed_line; tokp = lex_pbeg + delayed_col; String event = tokenToEventId(token); IRubyObject value = delayed == null ? parser.context.nil : parser.getRuntime().newString(delayed.dup()); yaccValue = parser.dispatch(event, value); delayed = null; ruby_sourceline = saved_line; tokp = saved_tokp; }
public RubySymbol asInstanceVariable() { ByteList bytes = getBytes().dup(); bytes.prepend((byte) '@'); return newIDSymbol(getRuntime(), bytes); }
public void dispatchDelayedToken(int token) { //mri: ripper_dispatch_delayed_token int saved_line = ruby_sourceline; int saved_tokp = tokp; ruby_sourceline = delayed_line; tokp = lex_pbeg + delayed_col; String event = tokenToEventId(token); IRubyObject value = delayed == null ? parser.context.nil : parser.getRuntime().newString(delayed.dup()); yaccValue = parser.dispatch(event, value); delayed = null; ruby_sourceline = saved_line; tokp = saved_tokp; }
/** * Make an instance variable out of this symbol (e.g. :foo will generate :foo=). * @return the new symbol */ public RubySymbol asWriter() { ByteList bytes = getBytes().dup(); bytes.append((byte) '='); return newIDSymbol(getRuntime(), bytes); }
public RubySymbol asInstanceVariable() { ByteList bytes = getBytes().dup(); bytes.prepend((byte) '@'); return newIDSymbol(getRuntime(), bytes); }
protected IRClosure(IRManager manager, IRScope lexicalParent, int lineNumber, StaticScope staticScope, ByteList prefix) { super(manager, lexicalParent, null, lineNumber, staticScope); this.startLabel = getNewLabel(prefix + "START"); this.endLabel = getNewLabel(prefix + "END"); this.closureId = lexicalParent.getNextClosureId(); ByteList name = prefix.dup(); name.append(Integer.toString(closureId).getBytes()); setName(manager.getRuntime().newSymbol(name)); this.body = null; }
protected IRClosure(IRManager manager, IRScope lexicalParent, int lineNumber, StaticScope staticScope, ByteList prefix) { super(manager, lexicalParent, null, lineNumber, staticScope); this.startLabel = getNewLabel(prefix + "START"); this.endLabel = getNewLabel(prefix + "END"); this.closureId = lexicalParent.getNextClosureId(); ByteList name = prefix.dup(); name.append(Integer.toString(closureId).getBytes()); setName(manager.getRuntime().newSymbol(name)); this.body = null; }
public LocalVariable getNewFlipStateVariable() { ByteList flip = FLIP.dup(); flip.append(allocateNextPrefixedName("%flip")); return getLocalVariable(getManager().getRuntime().newSymbol(flip) , 0); }
public LocalVariable getNewFlipStateVariable() { ByteList flip = FLIP.dup(); flip.append(allocateNextPrefixedName("%flip")); return getLocalVariable(getManager().getRuntime().newSymbol(flip) , 0); }
/** rb_reg_source * */ @JRubyMethod public IRubyObject source() { check(); Encoding enc = (pattern == null) ? str.getEncoding() : pattern.getEncoding(); ByteList newStr = str.dup(); newStr.setEncoding(enc); return RubyString.newString(getRuntime(), newStr).infectBy(this); }
/** rb_reg_source * */ @JRubyMethod public IRubyObject source() { check(); Encoding enc = (pattern == null) ? str.getEncoding() : pattern.getEncoding(); ByteList newStr = str.dup(); newStr.setEncoding(enc); return RubyString.newString(getRuntime(), newStr).infectBy(this); }
@Override public void setName(RubySymbol name) { ByteList newName = getLexicalParent().getName().getBytes().dup(); newName.append(name.getBytes()); super.setName(getManager().getRuntime().newSymbol(newName)); }
@Override public void setName(RubySymbol name) { ByteList newName = getLexicalParent().getName().getBytes().dup(); newName.append(name.getBytes()); super.setName(getManager().getRuntime().newSymbol(newName)); }