diff --git a/compiler/ast.nim b/compiler/ast.nim index a1b69bed86..7fd92d8fc4 100755 --- a/compiler/ast.nim +++ b/compiler/ast.nim @@ -227,9 +227,6 @@ type sfInnerProc, # proc is an inner proc sfThread, # proc will run as a thread # variable is a thread variable - sfInline # forced-inline procs - sfImmediate, # macro or template is immediately expanded without - # considering any possible overloads sfCompileTime, # proc can be evaluated at compile time sfMerge, # proc can be merged with itself sfDeadCodeElim, # dead code elimination for the module is turned on @@ -246,6 +243,8 @@ const sfFakeConst* = sfDeadCodeElim # const cannot be put into a data section sfDispatcher* = sfDeadCodeElim # copied method symbol is the dispatcher sfNoInit* = sfMainModule # don't generate code to init the variable + sfImmediate* = sfDeadCodeElim # macro or template is immediately expanded + # without considering any possible overloads type TTypeKind* = enum # order is important! diff --git a/compiler/rodread.nim b/compiler/rodread.nim index 3385ce942d..c3123161be 100755 --- a/compiler/rodread.nim +++ b/compiler/rodread.nim @@ -535,7 +535,7 @@ proc cmdChangeTriggersRecompilation(old, new: TCommands): bool = proc processRodFile(r: PRodReader, crc: TCrc32) = var w: string - d, L, inclCrc: int + d, inclCrc: int while r.s[r.pos] != '\0': var section = rdWord(r) if r.reason != rrNone: @@ -573,20 +573,17 @@ proc processRodFile(r: PRodReader, crc: TCrc32) = of "FILES": inc(r.pos, 2) # skip "(\10" inc(r.line) - L = 0 - while r.s[r.pos] > '\x0A' and r.s[r.pos] != ')': - setlen(r.files, L + 1) + while r.s[r.pos] != ')': var relativePath = decodeStr(r.s, r.pos) var resolvedPath = relativePath.findModule - r.files[L] = if resolvedPath.len > 0: resolvedPath else: relativePath + r.files.add(if resolvedPath.len > 0: resolvedPath else: relativePath) inc(r.pos) # skip #10 inc(r.line) - inc(L) if r.s[r.pos] == ')': inc(r.pos) of "INCLUDES": inc(r.pos, 2) # skip "(\10" inc(r.line) - while r.s[r.pos] > '\x0A' and r.s[r.pos] != ')': + while r.s[r.pos] != ')': w = r.files[decodeVInt(r.s, r.pos)] inc(r.pos) # skip ' ' inclCrc = decodeVInt(r.s, r.pos) @@ -597,13 +594,10 @@ proc processRodFile(r: PRodReader, crc: TCrc32) = inc(r.pos) inc(r.line) if r.s[r.pos] == ')': inc(r.pos) - of "DEPS": + of "DEPS": inc(r.pos) # skip ':' - L = 0 while r.s[r.pos] > '\x0A': - setlen(r.modDeps, L + 1) - r.modDeps[L] = r.files[decodeVInt(r.s, r.pos)] - inc(L) + r.modDeps.add r.files[decodeVInt(r.s, r.pos)] if r.s[r.pos] == ' ': inc(r.pos) of "INTERF": r.interfIdx = r.pos + 2 @@ -629,9 +623,11 @@ proc processRodFile(r: PRodReader, crc: TCrc32) = of "INIT": r.initIdx = r.pos + 2 # "(\10" skipSection(r) - else: - MsgWriteln("skipping section: " & section & - " at " & $r.pos & " in " & r.filename) + else: + InternalError("invalid section: '" & section & + "' at " & $r.line & " in " & r.filename) + #MsgWriteln("skipping section: " & section & + # " at " & $r.line & " in " & r.filename) skipSection(r) if r.s[r.pos] == '\x0A': inc(r.pos) diff --git a/compiler/semmagic.nim b/compiler/semmagic.nim index 932f36c2f9..4f120e2abd 100644 --- a/compiler/semmagic.nim +++ b/compiler/semmagic.nim @@ -22,7 +22,7 @@ proc semSlurp(c: PContext, n: PNode, flags: TExprFlags): PNode = result = newStrNode(nkStrLit, content) result.typ = getSysType(tyString) result.info = n.info - c.slurpedFiles.add(filename) + c.slurpedFiles.add(a.strVal) except EIO: GlobalError(a.info, errCannotOpenFile, a.strVal) diff --git a/todo.txt b/todo.txt index 9921e06d73..c4fa447110 100755 --- a/todo.txt +++ b/todo.txt @@ -1,7 +1,6 @@ version 0.9.0 ============= -- bootstrapping fails with --symbolFiles:on again! - ``=`` should be overloadable; requires specialization for ``=`` - fix remaining generics bugs - fix remaining closure bugs: @@ -49,6 +48,8 @@ Bugs without ``-d:release`` leaks memory? - bug: object {.pure, final.} does not work again! - bug: tsortdev does not run with native GC? +- bug: pragma statements in combination with symbol files are evaluated twice + but this can lead to compilation errors version 0.9.XX