public char peek() { return peek(false); }
public String toString() { return "..." + context(current) + "..."; }
@Override public CommandLine parse(Session session, String command, int cursor) { GogoParser parser = new GogoParser(command, cursor); List<String> args = parser.statement(); return new CommandLineImpl( args.toArray(new String[args.size()]), parser.cursorArgumentIndex(), parser.argumentPosition(), cursor, command.substring(0, parser.position())); }
public String messy() { start = current; char c = peek(); if (c > 0 && SPECIAL.indexOf(c) < 0) { current++; try { while (!eof()) { c = peek(); if (!escaped && (c == ';' || c == '|' || c == '\n' || isWhitespace(c))) { break; } next(); } return text.substring(start, current); } finally { start = -1; } } else { return value(); } }
public void ws() { // derek: BUGFIX: loop if comment at beginning of input //while (!eof() && isWhitespace(peek())) { while (!eof() && (!escaped && isWhitespace(peek()) || current == 0)) { if (current != 0 || !escaped && isWhitespace(peek())) { current++; } if (peek() == '/' && current < text.length() - 2 && text.charAt(current + 1) == '/') { comment(); } if (current == 0) { break; } } }
@Override public CommandLine parse(Session session, String command, int cursor) { GogoParser parser = new GogoParser(command, cursor); List<String> args = parser.statement(); return new CommandLineImpl( args.toArray(new String[args.size()]), parser.cursorArgumentIndex(), parser.argumentPosition(), cursor, command.substring(0, parser.position())); }
public String messy() { start = current; char c = peek(); if (c > 0 && SPECIAL.indexOf(c) < 0) { current++; try { while (!eof()) { c = peek(); if (!escaped && (c == ';' || c == '|' || c == '\n' || isWhitespace(c))) { break; } next(); } return text.substring(start, current); } finally { start = -1; } } else { return value(); } }
public void ws() { // derek: BUGFIX: loop if comment at beginning of input //while (!eof() && isWhitespace(peek())) { while (!eof() && (!escaped && isWhitespace(peek()) || current == 0)) { if (current != 0 || !escaped && isWhitespace(peek())) { current++; } if (peek() == '/' && current < text.length() - 2 && text.charAt(current + 1) == '/') { comment(); } if (current == 0) { break; } } }
public char next() { return peek(true); }
public String toString() { return "..." + context(current) + "..."; }
public char peek() { return peek(false); }
public char next() { return peek(true); }