public void load(@Language("Groovy") String sourceText) throws CompilationFailedException {
    reset();

    try {
      classLoader.parseClass(sourceText);
    } catch (AstSuccessfullyCaptured e) {
      indexAstNodes();
      return;
    }

    throw new AstInspectorException("internal error");
  }
Compiles the specified source text up to the configured compile
phase and stores the resulting AST for subsequent inspection.

@param sourceText the source text to compile
@throws CompilationFailedException if an error occurs during compilation
spock-core/src/main/java/org/spockframework/util/inspector/AstInspector.java