]> git.lizzy.rs Git - nothing.git/commitdiff
(#893) Remove source_code from Script
authorrexim <reximkut@gmail.com>
Mon, 17 Jun 2019 14:50:52 +0000 (21:50 +0700)
committerrexim <reximkut@gmail.com>
Mon, 17 Jun 2019 14:50:52 +0000 (21:50 +0700)
src/game/level/script.c
src/game/level/script.h

index d7ead19857011cc9c6d554065f5238cdbb271c57..85cef53fd04d039f896f241878eafd5139245ad0 100644 (file)
@@ -20,7 +20,6 @@ struct Script
     Lt *lt;
     Gc *gc;
     struct Scope scope;
-    const char *source_code;
 };
 
 static Script *create_script(Broadcast *broadcast, const char *source_code)
@@ -45,14 +44,6 @@ static Script *create_script(Broadcast *broadcast, const char *source_code)
     load_log_library(script->gc, &script->scope);
     broadcast_load_library(broadcast, script->gc, &script->scope);
 
-    script->source_code = PUSH_LT(
-        lt,
-        string_duplicate(source_code, NULL),
-        free);
-    if (script->source_code == NULL) {
-        RETURN_LT(lt, NULL);
-    }
-
     struct ParseResult parse_result =
         read_all_exprs_from_string(
             script->gc,
@@ -102,11 +93,6 @@ void destroy_script(Script *script)
     RETURN_LT0(script->lt);
 }
 
-const char *script_source_code(const Script *script)
-{
-    return script->source_code;
-}
-
 int script_eval(Script *script, struct Expr expr)
 {
     trace_assert(script);
index f9a1e17bfd1d381c6ebd86c5b498493436f35762..54d2c2c5decf9226ca686319f4f7dba7156e7289 100644 (file)
@@ -18,8 +18,6 @@ int script_eval(Script *script, struct Expr expr);
 
 bool script_has_scope_value(const Script *script, const char *name);
 
-const char *script_source_code(const Script *script);
-
 Gc *script_gc(const Script *script);
 
 #endif  // SCRIPT_H_