code: public LuaPreparedScript endPreparedScript(LuaScriptConfig config) {
          if (!endsWithReturnStatement()) {
              add(new LuaAstReturnStatement());
          }
          String scriptText = buildScriptText();
          ArrayList<LuaKeyArgument> keyList = new ArrayList<>(keyArg2AstArg.keySet());
          ArrayList<LuaValueArgument> argvList = new ArrayList<>(valueArg2AstArg.keySet());
          if (config.isThreadSafe()) {
              return new ThreadSafeLuaPreparedScript(scriptText, keyList, argvList, config);
          } else {
              return new BasicLuaPreparedScript(scriptText, keyList, argvList, config);
          }
      }
docs: End building the prepared script
  @param config the configuration for the script to build
  @return the new {@link LuaPreparedScript} instance