mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
Stylus. Inroduced IndentProprocessorParser for Stylus and SASS
This commit is contained in:
@@ -164,6 +164,34 @@ public abstract class AbstractIndentParser implements PsiParser {
|
||||
}
|
||||
}
|
||||
|
||||
protected void advanceUntil(TokenSet tokenSet) {
|
||||
while (getTokenType() != null && !isNewLine() && !tokenSet.contains(getTokenType())) {
|
||||
advance();
|
||||
}
|
||||
}
|
||||
|
||||
protected void advanceUntilEol() {
|
||||
advanceUntil(TokenSet.EMPTY);
|
||||
}
|
||||
|
||||
protected void errorUntil(TokenSet tokenSet, String message) {
|
||||
PsiBuilder.Marker errorMarker = mark();
|
||||
advanceUntil(tokenSet);
|
||||
errorMarker.error(message);
|
||||
}
|
||||
|
||||
protected void errorUntilEol(String message) {
|
||||
PsiBuilder.Marker errorMarker = mark();
|
||||
advanceUntilEol();
|
||||
errorMarker.error(message);
|
||||
}
|
||||
|
||||
protected void expectEolOrEof() {
|
||||
if (!isNewLine() && !eof()) {
|
||||
errorUntilEol("End of line expected");
|
||||
}
|
||||
}
|
||||
|
||||
protected abstract IElementType getIndentElementType();
|
||||
protected abstract IElementType getEolElementType();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user