boolean indenting = true;
int indentation = 0;
private ArrayList<Integer> istack = new ArrayList<Integer>();
- public CharToken next(int numstates) throws IOException {
- CharToken ret = nextc(numstates);
+ public CharToken next(int numstates, int resets, int waits) throws IOException {
+ CharToken ret = nextc(numstates, resets);
if (ret==CharToken.left) System.out.print("\033[31m{\033[0m");
else if (ret==CharToken.right) System.out.print("\033[31m}\033[0m");
else if (ret==null) return null;
}
CharToken waitingBrace = null;
- public CharToken nextc(int numstates) throws IOException {
+ public CharToken nextc(int numstates, int resets) throws IOException {
char c;
if (waitingBrace != null) {
CharToken ret = waitingBrace;
else _col++;
if (indenting) {
if (c==' ') { indentation++; return done(c); }
- if (c=='\n') { indentation = 0; if (blank) return nextc(numstates); blank = true; waiting = true; waitingChar='\n'; return new CharToken('\n'); }
+ if (c=='\n') { indentation = 0; if (blank) return nextc(numstates, resets); blank = true; waiting = true; waitingChar='\n'; return new CharToken('\n'); }
int last = istack.size()==0 ? -1 : istack.get(istack.size()-1);
if (indentation==last) {
if (blank) {