code: public List<SnippetEvent> eval(String input) throws IllegalStateException {
          SourceCodeAnalysisImpl a = sourceCodeAnalysis;
          if (a != null) {
              a.suspendIndexing();
          }
          try {
              checkIfAlive();
              List<SnippetEvent> events = eval.eval(input);
              events.forEach(this::notifyKeyStatusEvent);
              return Collections.unmodifiableList(events);
          } finally {
              if (a != null) {
                  a.resumeIndexing();
              }
          }
      }
docs: Evaluate the input String, including definition and/or execution, if
  applicable. The input is checked for errors, unless the errors can be
  deferred (as is the case with some unresolvedDependencies references),
  errors will abort evaluation.
  <p>
  The input should be
  exactly one complete snippet of source code, that is, one expression,
  statement, variable declaration, method declaration, class declaration,
  or import.
  To break arbitrary input into individual complete snippets, use
  {@link SourceCodeAnalysis#analyzeCompletion(String)}.
  <p>
  For imports, the import is added.  Classes, interfaces. methods,
  and variables are defined.  The initializer of variables, statements,
  and expressions are executed.
  The modifiers public, protected, private, static, and final are not
  allowed on op-level declarations and are ignored with a warning.
  Synchronized, native, abstract, and default top-level methods are not
  allowed and are errors.
  If a previous definition of a declaration is overwritten then there will
  be an event showing its status changed to OVERWRITTEN, this will not
  occur for dropped, rejected, or already overwritten declarations.
  <p>
  If execution environment is out of process, as is the default case, then
  if the evaluated code
  causes the execution environment to terminate, this {@code JShell}
  instance will be closed but the calling process and VM remain valid.
  @param input The input String to evaluate
  @return the list of events directly or indirectly caused by this evaluation.
  @throws IllegalStateException if this {@code JShell} instance is closed.
  @see SourceCodeAnalysis#analyzeCompletion(String)
  @see JShell#onShutdown(java.util.function.Consumer)