diff --git a/src/hastur.nim b/src/hastur.nim index c259d78f..8399f558 100644 --- a/src/hastur.nim +++ b/src/hastur.nim @@ -388,7 +388,7 @@ proc nifctests(overwrite: bool) = execNifc " cpp -r " & tryIssues let issues = "tests/nifc/issues.nif" - execNifc " c -r --linedir:on " & issues + # execNifc " c -r --linedir:on " & issues execNifc " cpp -r --linedir:off " & issues proc hexertests(overwrite: bool) = diff --git a/src/nifc/nifc_model.nim b/src/nifc/nifc_model.nim index 3f16df36..5f87baea 100644 --- a/src/nifc/nifc_model.nim +++ b/src/nifc/nifc_model.nim @@ -145,7 +145,11 @@ proc parse*(r: var Reader; m: var Module; parentInfo: PackedLineInfo): bool = # relative file position if t.pos.line != 0 or t.pos.col != 0: let (file, line, col) = unpack(pool.man, parentInfo) - currentInfo = pack(pool.man, file, line+t.pos.line, col+t.pos.col) + let curLine = line+t.pos.line + let curCol = col+t.pos.col + if not hasId(pool.files, file): + bug "no file name in the line info" + currentInfo = pack(pool.man, file, curLine, curCol) else: # absolute file position: let fileId = pool.files.getOrIncl(decodeFilename t) diff --git a/tests/nifc/app.c.nif b/tests/nifc/app.c.nif index f6d64e70..1d59ce4a 100644 --- a/tests/nifc/app.c.nif +++ b/tests/nifc/app.c.nif @@ -1,5 +1,5 @@ (.nif24) -(stmts +0,1,test1.nim(stmts (proc :main.c . (i +32) . (stmts (var :x.mangled . (f +32) 1.2) diff --git a/tests/nifc/cimport_array.c.nif b/tests/nifc/cimport_array.c.nif index 2056d114..079cd7aa 100644 --- a/tests/nifc/cimport_array.c.nif +++ b/tests/nifc/cimport_array.c.nif @@ -1,5 +1,5 @@ (.nif24) -(stmts +0,1,test1.nim(stmts (incl "testcarry.h") (gvar :cary.mangled . CArray.c .) (discard diff --git a/tests/nifc/hello.expected.idx.nif b/tests/nifc/hello.expected.idx.nif index dd4a5515..37b66d48 100644 --- a/tests/nifc/hello.expected.idx.nif +++ b/tests/nifc/hello.expected.idx.nif @@ -1,10 +1,10 @@ (.nif24) (index (public) -(private - (kv MyObject.ptr.flexarray +975) - (kv MyObject.ptr.object +699) - (kv MyObject.my.sequence +171) +(private 0,1,test1.nim + (kv MyObject.ptr.flexarray +988) 0,1,test1.nim + (kv MyObject.ptr.object +699) 0,1,test1.nim + (kv MyObject.my.sequence +171) 0,1,test1.nim (kv MyObject.sequence.base +127)) (build) diff --git a/tests/nifc/hello.nif b/tests/nifc/hello.nif index 88196908..08803e8f 100644 --- a/tests/nifc/hello.nif +++ b/tests/nifc/hello.nif @@ -1,5 +1,5 @@ (.nif24) -(stmts +0,1,test1.nim(stmts (incl "") (incl "") (type 1,1,hello.nim :MyObject.c . (object . )) diff --git a/tests/nifc/issues.nif b/tests/nifc/issues.nif index 07f18186..f72183d9 100644 --- a/tests/nifc/issues.nif +++ b/tests/nifc/issues.nif @@ -1,5 +1,5 @@ (.nif24) -(stmts +0,1,test1.nim(stmts (incl "") (incl "") (type :MyProc.e . (proctype . (params (param :x.0 . (ptr MyObject3.m)) (param :y.0 . (ptr MyObject4.m))) MyObject2.m . )) diff --git a/tests/nifc/selectany/t1.nif b/tests/nifc/selectany/t1.nif index 86b4a2d5..ac7e838b 100644 --- a/tests/nifc/selectany/t1.nif +++ b/tests/nifc/selectany/t1.nif @@ -1,5 +1,5 @@ (.nif24) -(stmts +0,1,test1.nim(stmts (incl "") (proc :genericProc.c . (void) (pragmas (selectany)) (stmts diff --git a/tests/nifc/selectany/t2.nif b/tests/nifc/selectany/t2.nif index 21a3b0b3..3d66b440 100644 --- a/tests/nifc/selectany/t2.nif +++ b/tests/nifc/selectany/t2.nif @@ -1,5 +1,5 @@ (.nif24) -(stmts +0,1,test2.nim(stmts (incl "") (proc :genericProc.c . (void) (pragmas (selectany)) (stmts (call printf.c "hello %s\0A" "file t2") diff --git a/tests/nifc/selectany/t3.nif b/tests/nifc/selectany/t3.nif index e4040fb8..3adb2045 100644 --- a/tests/nifc/selectany/t3.nif +++ b/tests/nifc/selectany/t3.nif @@ -1,5 +1,5 @@ (.nif24) -(stmts +0,1,test3.nim(stmts (incl "") (proc :genericProc.c . (void) (pragmas (selectany)) (stmts (call printf.c "hello %s\0A" "file t3") diff --git a/tests/nifc/try.nif b/tests/nifc/try.nif index 0d941897..0c79b7c8 100644 --- a/tests/nifc/try.nif +++ b/tests/nifc/try.nif @@ -1,5 +1,5 @@ (.nif24) -(stmts +0,1,test1.nim(stmts (incl "") (incl "")