# HG changeset patch # User Matthew Wild # Date 1295719496 0 # Node ID ff14c066a643b9631565db8a582b1543d1340a72 # Parent 4d6a976c3bb7bdb3cd45befb53eb62a17a102628 Change to behaviour of --debug/-g - at the (temporary) loss of squishing modules -g will now give real tracebacks again with original filenames diff -r 4d6a976c3bb7 -r ff14c066a643 squish.lua --- a/squish.lua Tue Nov 30 13:22:35 2010 +0000 +++ b/squish.lua Sat Jan 22 18:04:56 2011 +0000 @@ -167,10 +167,6 @@ end end -if opts.debug then - f:write(require_resource("squish.debug")); -end - print_verbose("Resolving modules..."); do local LUA_DIRSEP = package.config:sub(1,1); @@ -240,12 +236,14 @@ end end if data then - f:write("package.preload['", modulename, "'] = (function (...)\n"); - f:write(data); - f:write(" end)\n"); - if opts.debug then - f:write(string.format("package.preload[%q] = ___adjust_chunk(package.preload[%q], %q);\n\n", - modulename, modulename, "@"..path)); + if not opts.debug then + f:write("package.preload['", modulename, "'] = (function (...)\n"); + f:write(data); + f:write(" end)\n"); + else + f:write("package.preload['", modulename, "'] = assert(loadstring(\n"); + f:write(("%q\n"):format(data)); + f:write(", ", ("%q"):format("@"..path), "))\n"); end else print_err("Couldn't pack module '"..modulename.."': "..(err or "unknown error... path to module file correct?"));