create static method

SingletonPredictionContext create(
  1. PredictionContext? parent,
  2. int returnState
)

Implementation

static SingletonPredictionContext create(
  PredictionContext? parent,
  int returnState,
) {
  if (returnState == PredictionContext.EMPTY_RETURN_STATE && parent == null) {
    // someone can pass in the bits of an array ctx that mean $
    return EmptyPredictionContext.Instance;
  }
  return SingletonPredictionContext(parent, returnState);
}