I got an unexpected internal NPE when playing with this script.

```
POST _scripts/painless/_execute
{
  "script": {
    "source": """
    return /[^\w]+/.split('abc   def higkln').toArray(String[]::new)
    """
  }
}
```
```
{
  "error" : {
    "root_cause" : [
      {
        "type" : "script_exception",
        "reason" : "compile error",
        "script_stack" : [ ],
        "script" : "\n    return /[^\\w]+/.split('abc   def higkln').toArray(String[]::new)\n    ",
        "lang" : "painless"
      }
    ],
    "type" : "script_exception",
    "reason" : "compile error",
    "script_stack" : [ ],
    "script" : "\n    return /[^\\w]+/.split('abc   def higkln').toArray(String[]::new)\n    ",
    "lang" : "painless",
    "caused_by" : {
      "type" : "null_pointer_exception",
      "reason" : "Cannot read field \"annotations\" because the return value of \"org.elasticsearch.painless.lookup.PainlessLookup.lookupPainlessClass(java.lang.Class)\" is null"
    }
  },
  "status" : 400
}

```
modules/lang-painless/src/main/java/org/elasticsearch/painless/phase/DefaultSemanticAnalysisPhase.java
boolean continuous;
        if (userConditionNode instanceof EBooleanConstant bc) {
            continuous = bc.getBool();
            if (continuous == false) {
                throw userDoNode.createError(new IllegalArgumentException("extraneous do-while loop"));
            } else {
                semanticScope.setCondition(userDoNode, ContinuousLoop.class);
            }
            if (semanticScope.getCondition(userBlockNode, AnyBreak.class) == false) {
                semanticScope.setCondition(userDoNode, MethodEscape.class);
                semanticScope.setCondition(userDoNode, AllEscape.class);
            }
        }
    }
    /**
     * Visits a for statement with error checking for an extraneous loop.
     * Checks: control flow
     */
    @Override
    public void visitFor(SFor userForNode, SemanticScope semanticScope) {
        semanticScope = semanticScope.newLocalScope();
        ANode userInitializerNode = userForNode.getInitializerNode();
        if (userInitializerNode != null) {
            if (userInitializerNode instanceof SDeclBlock) {
                visit(userInitializerNode, semanticScope);
            } else if (userInitializerNode instanceof AExpression ae) {
                checkedVisit(ae, semanticScope);
            } else {
                throw userForNode.createError(new IllegalStateException("illegal tree structure"));
            }