@Override @SuppressWarnings("empty-statement") public boolean matchMarker(ByteList marker, boolean indent, boolean withNewline) throws IOException { int matchPos = 0; if (indent) { for (int c = readCursor.at(matchPos); c != RubyYaccLexer.EOF && Character.isWhitespace(c) && c != '\n'; c = readCursor.at(++matchPos)); } for (int i = 0; i < marker.length(); i++) { if (readCursor.at(matchPos) != marker.get(i)) { return false; } matchPos++; } if (withNewline) { int c = readCursor.at(matchPos++); if (c == '\r') { // skip c = readCursor.at(matchPos); } if (c != '\n' && c != RubyYaccLexer.EOF) { return false; } } for (int i = 0; i < matchPos; i++) { readCursor.read(); } return true; }
@Override @SuppressWarnings("empty-statement") public boolean matchMarker(ByteList marker, boolean indent, boolean withNewline) throws IOException { int matchPos = 0; if (indent) { for (int c = readCursor.at(matchPos); c != RubyYaccLexer.EOF && Character.isWhitespace(c) && c != '\n'; c = readCursor.at(++matchPos)); } for (int i = 0; i < marker.length(); i++) { if (readCursor.at(matchPos) != marker.get(i)) { return false; } matchPos++; } if (withNewline) { int c = readCursor.at(matchPos++); if (c == '\r') { // skip c = readCursor.at(matchPos); } if (c != '\n' && c != RubyYaccLexer.EOF) { return false; } } for (int i = 0; i < matchPos; i++) { readCursor.read(); } return true; }
@Override public int read() { return readCursor.read(); }
@Override public int read() { return readCursor.read(); }
public int read() { int index = region.length() - 1; if (index < 0) { readCursor = parent; return parent.read(); } int c = 0xff & region.get(index); region.setRealSize(index); return forward(c); } public void unread(int c) {
private ByteList readUntil(char marker, boolean nullIfEnd) throws IOException { ByteList result = new ByteList(128); int c; while ((c = readCursor.read()) != marker && c != RubyYaccLexer.EOF) { result.append(c); } if (nullIfEnd && c == RubyYaccLexer.EOF) { return null; } return result; }
public int read() { int index = region.length() - 1; if (index < 0) { readCursor = parent; return parent.read(); } int c = 0xff & region.get(index); region.setRealSize(index); return forward(c); } public void unread(int c) {
private ByteList readUntil(char marker, boolean nullIfEnd) throws IOException { ByteList result = new ByteList(128); int c; while ((c = readCursor.read()) != marker && c != RubyYaccLexer.EOF) { result.append(c); } if (nullIfEnd && c == RubyYaccLexer.EOF) { return null; } return result; }
@Override public int skipUntil(int marker) throws IOException { int c; do { c = readCursor.read(); } while (c != marker && c != RubyYaccLexer.EOF); return c; }
@Override public int skipUntil(int marker) throws IOException { int c; do { c = readCursor.read(); } while (c != marker && c != RubyYaccLexer.EOF); return c; }