]> git.lizzy.rs Git - metalua.git/blobdiff - src/compiler/metalua.mlua
fixes on the compilation process separation through io.popen()
[metalua.git] / src / compiler / metalua.mlua
index 9e1fdc38a9a1886cae2203715cecc05eb61191b4..934243504d32a873399634bfe7a1869fa822445e 100644 (file)
@@ -13,10 +13,9 @@ BYTECODE_SYNTHESE_ERROR_NUMBER  = -100
 -{ extension 'match' }
 
 function spring_pcall (f, arg, name)
-   -- FIXME: won't work if `arg' or `name' contain a backslash-escaped quot char.
-   arg  = arg  :gsub ("'", "\\'")
-   name = name :gsub ("'", "\\'")
-   local pattern = [[lua -l metalua.mlc -l serialize -e "print(serialize(%s('%s', '%s')))"]]
+   local pattern = 
+      [=[lua -l metalua.compiler -l serialize -e ]=]..
+      [=["print (serialize (%s ([[%s]], [[%s]])))"]=]
    local cmd = string.format (pattern, f, arg, name)
    --print ("Running the following process: " .. cmd)
    local fd = io.popen (cmd)