public boolean tokadd_mbchar(int first_byte, ByteList buffer) { int length = precise_mbclen(); if (length <= 0) { compile_error("invalid multibyte char (" + getEncoding() + ")"); return false; } tokAdd(first_byte, buffer); // add first byte since we have it. lex_p += length - 1; // we already read first byte so advance pointer for remainder if (length > 1) tokCopy(length - 1, buffer); // copy next n bytes over. return true; }
public boolean isGlobalCharPunct(int c) { switch (c) { case '_': case '~': case '*': case '$': case '?': case '!': case '@': case '/': case '\\': case ';': case ',': case '.': case '=': case ':': case '<': case '>': case '\"': case '-': case '&': case '`': case '\'': case '+': case '1': case '2': case '3': case '4': case '5': case '6': case '7': case '8': case '9': case '0': return true; } return isIdentifierChar(c); }
public void newtok(boolean unreadOnce) { tokline = getPosition(); // We assume all idents are 7BIT until they aren't. tokenCR = StringSupport.CR_7BIT; tokp = lex_p - (unreadOnce ? 1 : 0); // We use tokp of ripper to mark beginning of tokens. }
public boolean tokadd_ident(int c) { do { if (!tokadd_mbchar(c)) return false; c = nextc(); } while (isIdentifierChar(c)); pushback(c); return true; }
/** * Constructor for RubyDateFormatter. */ public RubyDateFormatter(ThreadContext context) { super(); this.runtime = context.runtime; lexer = new StrftimeLexer((Reader) null); }
private static int [] zzUnpackAttribute() { int [] result = new int[28]; int offset = 0; offset = zzUnpackAttribute(ZZ_ATTRIBUTE_PACKED_0, offset, result); return result; }
private static int [] zzUnpackTrans() { int [] result = new int[5520]; int offset = 0; offset = zzUnpackTrans(ZZ_TRANS_PACKED_0, offset, result); return result; }
private static int [] zzUnpackRowMap() { int [] result = new int[28]; int offset = 0; offset = zzUnpackRowMap(ZZ_ROWMAP_PACKED_0, offset, result); return result; }
private static int [] zzUnpackAction() { int [] result = new int[167]; int offset = 0; offset = zzUnpackAction(ZZ_ACTION_PACKED_0, offset, result); return result; }
private static int [] zzUnpackAttribute() { int [] result = new int[167]; int offset = 0; offset = zzUnpackAttribute(ZZ_ATTRIBUTE_PACKED_0, offset, result); return result; }
private static int [] zzUnpackTrans() { int [] result = new int[286]; int offset = 0; offset = zzUnpackTrans(ZZ_TRANS_PACKED_0, offset, result); return result; }
private static int [] zzUnpackAction() { int [] result = new int[28]; int offset = 0; offset = zzUnpackAction(ZZ_ACTION_PACKED_0, offset, result); return result; }
private static int [] zzUnpackRowMap() { int [] result = new int[167]; int offset = 0; offset = zzUnpackRowMap(ZZ_ROWMAP_PACKED_0, offset, result); return result; }
@Override public void setEncoding(Encoding encoding) { this.encoding = encoding; encodeExistingScriptLines(encoding); }
private static int [] zzUnpackAction() { int [] result = new int[18]; int offset = 0; offset = zzUnpackAction(ZZ_ACTION_PACKED_0, offset, result); return result; }
/** * Constructor for RubyDateFormatter. */ public RubyDateFormatter(ThreadContext context) { super(); this.runtime = context.runtime; lexer = new StrftimeLexer((Reader) null); }
private static int [] zzUnpackAttribute() { int [] result = new int[28]; int offset = 0; offset = zzUnpackAttribute(ZZ_ATTRIBUTE_PACKED_0, offset, result); return result; }
private static int [] zzUnpackTrans() { int [] result = new int[5520]; int offset = 0; offset = zzUnpackTrans(ZZ_TRANS_PACKED_0, offset, result); return result; }
private static int [] zzUnpackRowMap() { int [] result = new int[28]; int offset = 0; offset = zzUnpackRowMap(ZZ_ROWMAP_PACKED_0, offset, result); return result; }