Re: loadfile and line number
[
Date Prev][
Date Next][
Thread Prev][
Thread Next]
[
Date Index]
[
Thread Index]
- Subject: Re: loadfile and line number
- From: Shmuel Zeigerman <shmuz@...>
- Date: 2012年10月11日 13:24:41 +0200
On 11/10/2012 13:17, Luiz Henrique de Figueiredo wrote:
It can't, sorry. The line number is added to the error message deep down
in the Lua core:
http://www.lua.org/source/5.2/llex.c.html#lexerror
You can extract the line number from the error message with
string.match(message,":(%d+):")
Unfortunately, this method is not robust enough.
If some part of the line in question matches the same pattern ":(%d+):",
it will be captured instead.
--
Shmuel