mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
eof space
This commit is contained in:
@@ -758,7 +758,7 @@ public class PsiBuilderImpl extends UserDataHolderBase implements PsiBuilder {
|
||||
int prevProductionLexIndex = fProduction.get(i - 1).myLexemIndex;
|
||||
IElementType prevTokenType;
|
||||
|
||||
while (item.myLexemIndex > prevProductionLexIndex && item.myLexemIndex < myLexemCount &&
|
||||
while (item.myLexemIndex > prevProductionLexIndex && item.myLexemIndex - 1 < myLexemCount &&
|
||||
( myWhitespaces.contains(prevTokenType = myLexTypes[item.myLexemIndex - 1]) ||
|
||||
myComments.contains(prevTokenType)
|
||||
)
|
||||
@@ -853,7 +853,7 @@ public class PsiBuilderImpl extends UserDataHolderBase implements PsiBuilder {
|
||||
if (start < end || myLexTypes[curToken] instanceof ILeafElementType) { // Empty token. Most probably a parser directive like indent/dedent in phyton
|
||||
final IElementType type = myLexTypes[curToken];
|
||||
final LeafElement leaf = createLeaf(type, start, end);
|
||||
(curToken == myLexemCount - 1 && whitespaceOrComment(type) ? getRoot(curNode) : curNode).rawAddChildren(leaf);
|
||||
curNode.rawAddChildren(leaf);
|
||||
}
|
||||
curToken++;
|
||||
}
|
||||
@@ -861,14 +861,6 @@ public class PsiBuilderImpl extends UserDataHolderBase implements PsiBuilder {
|
||||
return curToken;
|
||||
}
|
||||
|
||||
private static CompositeElement getRoot(@NotNull CompositeElement curNode) {
|
||||
while (true) {
|
||||
CompositeElement parent = curNode.getTreeParent();
|
||||
if (parent == null) return curNode;
|
||||
curNode = parent;
|
||||
}
|
||||
}
|
||||
|
||||
private static CompositeElement createComposite(final StartMarker marker) {
|
||||
final IElementType type = marker.myType;
|
||||
if (type == TokenType.ERROR_ELEMENT) {
|
||||
@@ -1035,7 +1027,7 @@ public class PsiBuilderImpl extends UserDataHolderBase implements PsiBuilder {
|
||||
while (curToken < lastIdx) {
|
||||
final int start = myLexStarts[curToken];
|
||||
final int end = myLexEnds[curToken];
|
||||
final IElementType type = myLexTypes[curToken];
|
||||
final IElementType type = myLexTypes[curToken];
|
||||
if (start < end || type instanceof ILeafElementType) { // Empty token. Most probably a parser directive like indent/dedent in phyton
|
||||
Token lexem = myPool.alloc();
|
||||
|
||||
|
||||
@@ -6,5 +6,5 @@ Properties file:Comments.properties
|
||||
PsiElement(Properties:KEY_CHARACTERS)('xx')
|
||||
PsiElement(Properties:KEY_VALUE_SEPARATOR)('=')
|
||||
Property value: yyy('yyy')
|
||||
PsiWhiteSpace('\n')
|
||||
PsiWhiteSpace('\n')
|
||||
PsiComment(Properties:END_OF_LINE_COMMENT)('#s')
|
||||
Reference in New Issue
Block a user