mjanicek / rembulan

Rembulan, an implementation of Lua 5.3 for the Java Virtual Machine
Apache License 2.0
162 stars 28 forks source link

Add file and line information to exceptions thrown from Lua #8

Open mjanicek opened 7 years ago

mjanicek commented 7 years ago

Exceptions thrown from Lua programs do not include the filename and line information as they do in PUC-Lua. E.g.:

$ rembulan
Rembulan 0.1-SNAPSHOT (Java HotSpot(TM) 64-Bit Server VM, Java 1.8.0_60)
> nil + 1
attempt to perform arithmetic on a nil value
stack traceback:
   (omitted)
$ lua
Lua 5.3.3  Copyright (C) 1994-2016 Lua.org, PUC-Rio
> nil + 1
stdin:1: attempt to perform arithmetic on a nil value
stack traceback:
  (omitted)

(It's about the stdin:1 prefix of the error message.)

Debugging Lua programs is difficult without this information.

mkarneim commented 7 years ago

Indeed, this would be really helpful.