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 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 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; }