]> git.lizzy.rs Git - metalua.git/commitdiff
lineinfo missing in "local func" and in ~= operator
authorFabien Fleutot <fabien@MacFabien.home>
Sun, 14 Sep 2008 17:33:59 +0000 (19:33 +0200)
committerFabien Fleutot <fabien@MacFabien.home>
Sun, 14 Sep 2008 17:33:59 +0000 (19:33 +0200)
src/compiler/mlp_expr.lua
src/compiler/mlp_stat.lua

index 258c1b6e7cb02e3f4f6ecb3503863d891ced536a..761d9cf8cd10405cd4e8ef82d73c615463741c73 100644 (file)
@@ -137,7 +137,8 @@ local function op_ne(a, _, b)
    -- suppressed from the official AST grammar (although still supported
    -- in practice by the compiler).
    -- return { tag="Op", "ne", a, b }
-   return { tag="Op", "not", { tag="Op", "eq", a, b } }
+   return { tag="Op", "not", { tag="Op", "eq", a, b, lineinfo= {
+            first = a.lineinfo.first, last = b.lineinfo.last } } }
 end
    
 
index ab89a522b6a65f3a5e1f9490d0c060b3ded13239..d5fa0d7d8c058a59d884c40eb36321d6303512d8 100644 (file)
@@ -182,7 +182,11 @@ end
 local local_stat_parser = gg.multisequence{
    -- local function <name> <func_val>
    { "function", id, func_val, builder = 
-      function(x) return { tag="Localrec", { x[1] }, { x[2] } } end },
+      function(x) 
+         local vars = { x[1], lineinfo = x[1].lineinfo }
+         local vals = { x[2], lineinfo = x[2].lineinfo }
+         return { tag="Localrec", vars, vals } 
+      end },
    -- local <id_list> ( = <expr_list> )?
    default = gg.sequence{ id_list, gg.onkeyword{ "=", expr_list },
       builder = function(x) return {tag="Local", x[1], x[2] or { } } end } }