@@ -53,7 +53,7 @@ public class GeneratedParserUtilBase {
53
53
54
54
private static final Logger LOG = Logger .getInstance ("org.intellij.grammar.parser.GeneratedParserUtilBase" );
55
55
56
- private static final int MAX_RECURSION_LEVEL = 1000 ;
56
+ private static final int MAX_RECURSION_LEVEL = StringUtil . parseInt ( System . getProperty ( "grammar.kit.gpub.max.level" ), 1000 ) ;
57
57
private static final int MAX_VARIANTS_SIZE = 10000 ;
58
58
private static final int MAX_VARIANTS_TO_DISPLAY = 50 ;
59
59
@@ -127,7 +127,7 @@ public static boolean leftMarkerIs(PsiBuilder builder, IElementType type) {
127
127
128
128
private static boolean consumeTokens (PsiBuilder builder , boolean smart , int pin , IElementType ... tokens ) {
129
129
ErrorState state = ErrorState .get (builder );
130
- if (state .completionState != null && state .predicateCount == 0 ) {
130
+ if (state .completionState != null && state .predicateSign ) {
131
131
addCompletionVariant (builder , state .completionState , tokens );
132
132
}
133
133
// suppress single token completion
@@ -298,7 +298,7 @@ else if (nextOffset == endOffset) {
298
298
private static void addCompletionVariantSmart (PsiBuilder builder , Object token ) {
299
299
ErrorState state = ErrorState .get (builder );
300
300
CompletionState completionState = state .completionState ;
301
- if (completionState != null && state .predicateCount == 0 ) {
301
+ if (completionState != null && state .predicateSign ) {
302
302
addCompletionVariant (builder , completionState , token );
303
303
}
304
304
}
@@ -767,23 +767,25 @@ public static class ErrorState {
767
767
MyList <Variant > unexpected = new MyList <Variant >(INITIAL_VARIANTS_SIZE / 10 );
768
768
769
769
final LimitedPool <Variant > VARIANTS = new LimitedPool <Variant >(VARIANTS_POOL_SIZE , new LimitedPool .ObjectFactory <Variant >() {
770
+ @ NotNull
770
771
@ Override
771
772
public Variant create () {
772
773
return new Variant ();
773
774
}
774
775
775
776
@ Override
776
- public void cleanup (final Variant o ) {
777
+ public void cleanup (Variant o ) {
777
778
}
778
779
});
779
780
final LimitedPool <Frame > FRAMES = new LimitedPool <Frame >(FRAMES_POOL_SIZE , new LimitedPool .ObjectFactory <Frame >() {
781
+ @ NotNull
780
782
@ Override
781
783
public Frame create () {
782
784
return new Frame ();
783
785
}
784
786
785
787
@ Override
786
- public void cleanup (final Frame o ) {
788
+ public void cleanup (Frame o ) {
787
789
}
788
790
});
789
791
0 commit comments