Handle incomplete macrocall gracefully, attempt to restore lexer state.

This commit is contained in:
Maxim Shafirov
2011-03-30 14:08:30 +04:00
parent 692716d235
commit 0b84810cbf
@@ -75,6 +75,17 @@ public abstract class LookAheadLexer extends LexerBase{
return myBaseLexer.getBufferEnd();
}
protected int getCacheSize() {
return myTypeCache.size();
}
protected void resetCacheSize(int size) {
while (myTypeCache.size() > size) {
myTypeCache.removeLast();
myEndOffsetCache.removeLast();
}
}
public int getState() {
int offset = myTokenStart - myLastOffset;
return myLastState | (offset << 16);