protected boolean isNext_identchar() throws IOException { int c = nextc(); pushback(c); return c != EOF && (Character.isLetterOrDigit(c) || c == '_'); }
protected boolean isNext_identchar() throws IOException { int c = nextc(); pushback(c); return c != EOF && (Character.isLetterOrDigit(c) || c == '_'); }
protected char scanOct(int count) throws IOException { char value = '\0'; for (int i = 0; i < count; i++) { int c = nextc(); if (!isOctChar(c)) { pushback(c); break; } value <<= 3; value |= Integer.parseInt(String.valueOf((char) c), 8); } return value; }
protected char scanOct(int count) throws IOException { char value = '\0'; for (int i = 0; i < count; i++) { int c = nextc(); if (!isOctChar(c)) { pushback(c); break; } value <<= 3; value |= Integer.parseInt(String.valueOf((char) c), 8); } return value; }
pushback(c3); pushback(c2); return 0; pushback(c3); pushback(c2); break; } else if (isGlobalCharPunct(c2)) { // $_ potentially setValue("#" + (char) c2); pushback(c2); pushback(c); return tSTRING_DVAR; pushback(c2); break; pushback(c3); pushback(c2); return 0; pushback(c3); pushback(c2); break; pushback(c2); break; pushback(c); setValue("#" + significant); return tSTRING_DVAR;
pushback(c3); pushback(c2); return 0; pushback(c3); pushback(c2); break; } else if (isGlobalCharPunct(c2)) { // $_ potentially setValue("#" + (char) c2); pushback(c2); pushback(c); return tSTRING_DVAR; pushback(c2); break; pushback(c3); pushback(c2); return 0; pushback(c3); pushback(c2); break; pushback(c2); break; pushback(c); setValue("#" + significant); return tSTRING_DVAR;
public boolean tokadd_ident(int c) { do { if (!tokadd_mbchar(c)) return false; c = nextc(); } while (isIdentifierChar(c)); pushback(c); return true; }
public boolean tokadd_ident(int c) { do { if (!tokadd_mbchar(c)) return false; c = nextc(); } while (isIdentifierChar(c)); pushback(c); return true; }
protected int numberLiteralSuffix(int mask) throws IOException { int c = nextc(); if (c == 'i') return (mask & SUFFIX_I) != 0 ? mask & SUFFIX_I : 0; if (c == 'r') { int result = 0; if ((mask & SUFFIX_R) != 0) result |= (mask & SUFFIX_R); if (peek('i') && (mask & SUFFIX_I) != 0) { c = nextc(); result |= (mask & SUFFIX_I); } return result; } if (c == '.') { int c2 = nextc(); if (Character.isDigit(c2)) { compile_error("unexpected fraction part after numeric literal"); do { // Ripper does not stop so we follow MRI here and read over next word... c2 = nextc(); } while (isIdentifierChar(c2)); } else { pushback(c2); } } pushback(c); return 0; }
protected int numberLiteralSuffix(int mask) throws IOException { int c = nextc(); if (c == 'i') return (mask & SUFFIX_I) != 0 ? mask & SUFFIX_I : 0; if (c == 'r') { int result = 0; if ((mask & SUFFIX_R) != 0) result |= (mask & SUFFIX_R); if (peek('i') && (mask & SUFFIX_I) != 0) { c = nextc(); result |= (mask & SUFFIX_I); } return result; } if (c == '.') { int c2 = nextc(); if (Character.isDigit(c2)) { compile_error("unexpected fraction part after numeric literal"); do { // Ripper does not stop so we follow MRI here and read over next word... c2 = nextc(); } while (isIdentifierChar(c2)); } else { pushback(c2); } } pushback(c); return 0; }
public void parser_prepare() { int c = nextc(); switch(c) { case '#': if (peek('!')) has_shebang = true; break; case 0xef: if (lex_pend - lex_p >= 2 && p(lex_p) == 0xbb && p(lex_p + 1) == 0xbf) { setEncoding(UTF8_ENCODING); lex_p += 2; lex_pbeg = lex_p; return; } break; case EOF: return; } pushback(c); current_enc = lex_lastline.getEncoding(); }
public void parser_prepare() { int c = nextc(); switch(c) { case '#': if (peek('!')) has_shebang = true; break; case 0xef: if (lex_pend - lex_p >= 2 && p(lex_p) == 0xbb && p(lex_p + 1) == 0xbf) { setEncoding(UTF8_ENCODING); lex_p += 2; lex_pbeg = lex_p; return; } break; case EOF: return; } pushback(c); current_enc = lex_lastline.getEncoding(); }