]> git.lizzy.rs Git - metalua.git/commitdiff
fixed error position reporting in mlc.mlua
authorfabien <fabien@fabien-ubuntu.(none)>
Wed, 10 Sep 2008 18:19:39 +0000 (20:19 +0200)
committerfabien <fabien@fabien-ubuntu.(none)>
Wed, 10 Sep 2008 18:19:39 +0000 (20:19 +0200)
src/compiler/mlc.mlua

index b114ad1ab8e842886c78cf9700fdb16d76d6d0f3..05a23f771744d423335caa984074b5074b76cf9b 100644 (file)
@@ -102,9 +102,9 @@ function mlc.convert (x, src_fmt, dst_fmt, name)
    if not status and x then 
       -- x = error msg; get rid of ???
       x = x:strmatch "[^:]+:[0-9]+: (.*)" or x
-      local lxline = lx:lineinfo().first[1] or "?"
-      error(string.format("Parsing error in %s line %s, char %s: \n%s",
-                          name or "?", lxline, lx.i, x))
+      local li = lx:lineinfo()
+      error(string.format("Parsing error in %s line %s, column %i, char %s: \n%s",
+                          name or "<nofilename>", li[1], li[2], li[3], x))
       return nil
    end