From 98ad1f02d14334f339a72d96866e5b137641bc8f Mon Sep 17 00:00:00 2001 From: Araq Date: Fri, 26 Dec 2025 04:48:49 +0100 Subject: [PATCH] progress --- compiler/ast2nif.nim | 2 ++ compiler/nifbackend.nim | 2 +- compiler/renderer.nim | 3 +++ 3 files changed, 6 insertions(+), 1 deletion(-) diff --git a/compiler/ast2nif.nim b/compiler/ast2nif.nim index 197b68b349..7064a8adf7 100644 --- a/compiler/ast2nif.nim +++ b/compiler/ast2nif.nim @@ -1501,6 +1501,7 @@ proc nextSubtree(r: var Stream; dest: var TokenBuf; tok: var PackedToken) = elif tok.kind == ParRi: dec nested if nested == 0: break + type ModuleSuffix* = distinct string PrecompiledModule* = object @@ -1581,6 +1582,7 @@ proc processTopLevel(c: var DecodeContext; s: var Stream; loadFullAst: bool; suf # Parse the full statement var buf = createTokenBuf(50) nextSubtree(s, buf, t) + t = next(s) # skip ParRi var cursor = cursorAt(buf, 0) let stmtNode = loadNode(c, cursor, suffix, localSyms) if stmtNode != nil: diff --git a/compiler/nifbackend.nim b/compiler/nifbackend.nim index afe0718435..a22404d52e 100644 --- a/compiler/nifbackend.nim +++ b/compiler/nifbackend.nim @@ -95,7 +95,7 @@ proc generateCode*(g: ModuleGraph; mainFileIdx: FileIndex) = # Load system module first - it's always needed and contains essential hooks var precompSys = PrecompiledModule(module: nil) if g.config.m.systemFileIdx != InvalidFileIdx: - precompSys = moduleFromNifFile(g, g.config.m.systemFileIdx) + precompSys = moduleFromNifFile(g, g.config.m.systemFileIdx, loadFullAst=true) g.systemModule = precompSys.module # Load all modules in dependency order using stack traversal diff --git a/compiler/renderer.nim b/compiler/renderer.nim index a2e7626b42..e8cdfad6d2 100644 --- a/compiler/renderer.nim +++ b/compiler/renderer.nim @@ -1836,6 +1836,9 @@ proc gsub(g: var TSrcGen, n: PNode, c: TContext, fromStmtList = false) = putWithSpace(g, tkSymbol, "error") #gcomma(g, n, c) gsub(g, n[0], c) + of nkReplayAction: + put(g, tkSymbol, "replayaction") + #gsons(g, n, c, 0) else: #nkNone, nkExplicitTypeListCall: internalError(g.config, n.info, "renderer.gsub(" & $n.kind & ')')