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 ) ; } }
End building the prepared script