private static void enter_section_impl_(
     PsiBuilder builder, int level, int modifiers, @Nullable String frameName) {
   ErrorState state = ErrorState.get(builder);
   Frame frame = state.FRAMES.alloc().init(builder, state, level, modifiers, frameName);
   Frame prevFrame = state.frameStack.peekLast();
   if (prevFrame != null && prevFrame.errorReportedAt > frame.position) {
     // report error for previous unsuccessful frame
     reportError(builder, state, frame, null, true, false);
   }
   if (((frame.modifiers & _LEFT_) | (frame.modifiers & _LEFT_INNER_)) != 0) {
     PsiBuilder.Marker left = (PsiBuilder.Marker) builder.getLatestDoneMarker();
     if (invalid_left_marker_guard_(builder, left, frameName)) {
       frame.leftMarker = left;
     }
   }
   state.frameStack.add(frame);
   if ((modifiers & _AND_) != 0) {
     if (state.predicateCount == 0 && !state.predicateSign) {
       throw new AssertionError("Incorrect false predicate sign");
     }
     state.predicateCount++;
   } else if ((modifiers & _NOT_) != 0) {
     if (state.predicateCount == 0) {
       state.predicateSign = false;
     } else {
       state.predicateSign = !state.predicateSign;
     }
     state.predicateCount++;
   }
 }
Ejemplo n.º 2
0
 public static void enterErrorRecordingSection(
     PsiBuilder builder_, int level, @NotNull String sectionType, @Nullable String frameName) {
   ErrorState state = ErrorState.get(builder_);
   Frame frame =
       state
           .FRAMES
           .alloc()
           .init(
               builder_.getCurrentOffset(), level, sectionType, frameName, state.variants.size());
   state.levelCheck.add(frame);
   if (sectionType == _SECTION_AND_) {
     if (state.predicateCount == 0 && !state.predicateSign) {
       throw new AssertionError("Incorrect false predicate sign");
     }
     state.predicateCount++;
   } else if (sectionType == _SECTION_NOT_) {
     if (state.predicateCount == 0) {
       state.predicateSign = false;
     } else {
       state.predicateSign = !state.predicateSign;
     }
     state.predicateCount++;
   }
 }