222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
...
250
251
252
253
254
255
256
257
258
259
|
input.stream = file
input.src.file = args[1]
end
return main(input, outp, log, mode, suggestions, vars, extrule)
end
-- local ok, e = pcall(entry_cli)
local ok, e = true, entry_cli()
if not ok then
local str = 'translation failure'
if ss.exn.is(e) then
str = e.kind.desc
end
local color = false
if native then
................................................................................
end
end
end
if color then
str = string.format('\27[1;31m%s\27[m', str)
end
log:write(string.format('%s: %s\n', str, e))
os.exit(1)
end
os.exit(e)
|
|
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
...
257
258
259
260
261
262
263
264
265
266
267
268
269
|
input.stream = file
input.src.file = args[1]
end
return main(input, outp, log, mode, suggestions, vars, extrule)
end
local ok, e = xpcall(entry_cli, function(e)
if not ss.exn.is(e) then
e = ss.bug('lua vm error: %s', e)
end
e.trace = debug.traceback(nil, nil, 1)
log:write(e.trace .. '\n')
return e
end)
-- local ok, e = true, entry_cli()
if not ok then
local str = 'translation failure'
if ss.exn.is(e) then
str = e.kind.desc
end
local color = false
if native then
................................................................................
end
end
end
if color then
str = string.format('\27[1;31m%s\27[m', str)
end
log:write(string.format('%s: %s\n', str, e))
if ss._debug and ss.exn.is(e) and e.trace then
log:write(e.trace)
end
os.exit(1)
end
os.exit(e)
|