Skip to content

Commit 25ef229

Browse files
committed
tweak failsafe
1 parent e710e84 commit 25ef229

1 file changed

Lines changed: 4 additions & 4 deletions

File tree

java/src/org/antlr/codebuff/Formatter.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -96,15 +96,15 @@ public void processToken(int indexIntoRealTokens, int tokenIndexInStream) {
9696
int indent = indentClassifier.classify(k, features, corpus.indent, CollectFeatures.MAX_CONTEXT_DIFF_THRESHOLD);
9797
int ws = wsClassifier.classify(k, features, corpus.injectWS, CollectFeatures.MAX_CONTEXT_DIFF_THRESHOLD);
9898

99-
if ( ws==0 && cannotJoin(realTokens.get(indexIntoRealTokens-1), curToken) ) { // failsafe!
100-
ws = 1;
101-
}
102-
10399
TokenPositionAnalysis tokenPositionAnalysis =
104100
getTokenAnalysis(features, indexIntoRealTokens, tokenIndexInStream, injectNewline, alignWithPrevious, indent, ws);
105101
analysis.setSize(tokenIndexInStream+1);
106102
analysis.set(tokenIndexInStream, tokenPositionAnalysis);
107103

104+
if ( ws==0 && cannotJoin(realTokens.get(indexIntoRealTokens-1), curToken) ) { // failsafe!
105+
ws = 1;
106+
}
107+
108108
if ( injectNewline>0 ) {
109109
output.append(Tool.newlines(injectNewline));
110110
line++;

0 commit comments

Comments
 (0)