else if (mode == RecoveryMode.DECL) if (t.getType() == CSSLexer.RCURLY) //if '}' is processed the curlyNest has been already decreased return aposOpen==false && quotOpen==false && parenNest==0 && curlyNest==state.curlyNest-1; else
/** * Consumes token until lexer state is balanced and * token from follow is matched. Matched token is also consumed */ private void consumeUntilGreedy(TokenStream input, BitSet follow) { CSSToken t = null; do{ Token next = input.LT(1); if (next instanceof CSSToken) t= (CSSToken) input.LT(1); else break; /* not a CSSToken, probably EOF */ log.trace("Skipped greedy: {} follow: {}", t, follow); // consume token even if it will match input.consume(); }while(!(t.getLexerState().isBalanced() && follow.member(t.getType()))); }
/** * Consumes token until lexer state is function-balanced and * token from follow is matched. Matched token is also consumed */ private void consumeUntilGreedy(TokenStream input, BitSet follow, LexerState.RecoveryMode mode, LexerState ls) { CSSToken t = null; do{ Token next = input.LT(1); if (next instanceof CSSToken) t= (CSSToken) input.LT(1); else break; /* not a CSSToken, probably EOF */ log.trace("Skipped greedy: {}", t); // consume token even if it will match input.consume(); }while(!(t.getLexerState().isBalanced(mode, ls) && follow.member(t.getType()))); }
/** * Consumes token until lexer state is balanced and * token from follow is matched. Matched token is also consumed */ private void consumeUntilGreedy(TokenStream input, BitSet follow) { CSSToken t = null; do{ Token next = input.LT(1); if (next instanceof CSSToken) t= (CSSToken) input.LT(1); else break; /* not a CSSToken, probably EOF */ log.trace("Skipped greedy: {} follow: {}", t, follow); // consume token even if it will match input.consume(); }while(!(t.getLexerState().isBalanced() && follow.member(t.getType()))); }
/** * Consumes token until lexer state is function-balanced and * token from follow is matched. Matched token is also consumed */ private void consumeUntilGreedy(TokenStream input, BitSet follow, CSSLexerState.RecoveryMode mode, CSSLexerState ls) { CSSToken t = null; do{ Token next = input.LT(1); if (next instanceof CSSToken) t= (CSSToken) input.LT(1); else break; /* not a CSSToken, probably EOF */ log.trace("Skipped greedy: {}", t); // consume token even if it will match input.consume(); }while(!(t.getLexerState().isBalanced(mode, ls, t) && follow.member(t.getType()))); }
/** * Consumes token until lexer state is function-balanced and * token from follow is matched. */ private void consumeUntil(TokenStream input, BitSet follow, LexerState.RecoveryMode mode, LexerState ls) { CSSToken t = null; boolean finish = false; do{ Token next = input.LT(1); if (next instanceof CSSToken) t= (CSSToken) input.LT(1); else break; /* not a CSSToken, probably EOF */ // consume token if does not match finish = (t.getLexerState().isBalanced(mode, ls) && follow.member(t.getType())); if (!finish) { log.trace("Skipped: {}", t); input.consume(); } }while(!finish); }
/** * Consumes token until lexer state is function-balanced and * token from follow is matched. */ private void consumeUntil(TokenStream input, BitSet follow, CSSLexerState.RecoveryMode mode, CSSLexerState ls) { CSSToken t = null; boolean finish = false; do{ Token next = input.LT(1); if (next instanceof CSSToken) t= (CSSToken) input.LT(1); else break; /* not a CSSToken, probably EOF */ // consume token if does not match finish = (t.getLexerState().isBalanced(mode, ls, t) && follow.member(t.getType())); if (!finish) { log.trace("Skipped: {}", t); input.consume(); } }while(!finish); } }