public static @NotNull LeafElement leaf(@NotNull IElementType type, @NlsSafe @NotNull CharSequence text) {
    if (type == TokenType.WHITE_SPACE) {
      return new PsiWhiteSpaceImpl(text);
    }

    if (type instanceof ILeafElementType) {
      return (LeafElement)((ILeafElementType)type).createLeafNode(text);
    }

    LeafElement customLeaf = factory(type).createLeaf(type, text);
    return customLeaf != null ? customLeaf : DefaultFactoryHolder.DEFAULT.createLeaf(type, text);
  }
public static @NotNull LeafElement leaf(@NotNull IElementType type, @NlsSafe @NotNull CharSequence text)