From 0a624bec1ef734cec0cf3376c9073ea40c0b0381 Mon Sep 17 00:00:00 2001 From: Araq Date: Wed, 8 Jul 2015 11:12:39 +0200 Subject: implemented {.noforward:on.} for type sections; useful for c2nim generated wrappers; to be documented --- compiler/passes.nim | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) (limited to 'compiler/passes.nim') diff --git a/compiler/passes.nim b/compiler/passes.nim index e031dae10..ceb3e2b8a 100644 --- a/compiler/passes.nim +++ b/compiler/passes.nim @@ -190,8 +190,17 @@ proc processModule(module: PSym, stream: PLLStream, rd: PRodReader) = while true: var n = parseTopLevelStmt(p) if n.kind == nkEmpty: break - if not processTopLevelStmt(n, a): break - + if sfNoForward in module.flags: + # read everything, no streaming possible + var sl = newNodeI(nkStmtList, n.info) + sl.add n + while true: + var n = parseTopLevelStmt(p) + if n.kind == nkEmpty: break + sl.add n + discard processTopLevelStmt(sl, a) + break + elif not processTopLevelStmt(n, a): break closeParsers(p) if s.kind != llsStdIn: break closePasses(a) -- cgit 1.4.1-2-gfad0