Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
20 commits
Select commit Hold shift + click to select a range
e9127b2
adds Nim's AST to/from NIF
demotomohiro Oct 23, 2025
25ca7cc
encodes/decodes itemId.module
demotomohiro Oct 27, 2025
5eeede3
uses PSym.item and PType.item as id in NIF
demotomohiro Oct 27, 2025
51eccea
saves/loads PSym guard, bitsize and alignment
demotomohiro Oct 28, 2025
8a4d921
saves/loads PNode and PSym line info
demotomohiro Oct 29, 2025
6f237be
saves/loads symbol magic, options and offset
demotomohiro Oct 29, 2025
b50c453
adds procedure test code and fix bugs
demotomohiro Oct 29, 2025
3ceb223
adds more procedure test code
demotomohiro Oct 29, 2025
10885d4
adds statements test code
demotomohiro Oct 29, 2025
6a74316
fixes assertion defect when encoding empty object type definition
demotomohiro Oct 29, 2025
467a279
adds pragma test code
demotomohiro Oct 30, 2025
66d7a8e
adds generics test code and fixes bug
demotomohiro Oct 30, 2025
3c599ed
adds expression test code
demotomohiro Oct 30, 2025
91db9ac
uses ItemId instead of PSym or PType for the set of decoded syms and …
demotomohiro Oct 30, 2025
9f73412
saves/loads float Inf, NaN and NegInf literals
demotomohiro Oct 31, 2025
f3178e4
saves/loads flags of nkIdent node
demotomohiro Nov 1, 2025
5f3be1e
makes tencode_node2node.nim faster
demotomohiro Nov 1, 2025
ab13900
saves/loads PSym.ast, constraint and instantiatedFrom
demotomohiro Nov 1, 2025
54aa552
refers imported symbols like Nimony
demotomohiro Nov 4, 2025
43ff7b1
loads modules imported by system module and create module sym before …
demotomohiro Nov 5, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1,829 changes: 1,829 additions & 0 deletions compiler/icnif/enum2nif.nim

Large diffs are not rendered by default.

10 changes: 10 additions & 0 deletions compiler/icnif/icniftags.nim
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
import "../../dist/nimony/src/lib" / [nifstreams]

let
symIdTag* = registerTag("symId")
symTag* = registerTag("s")
typeIdTag* = registerTag("typeId")
typeTag* = registerTag("t")
sonsTag* = registerTag("sons")

modIdTag* = registerTag("modId")
19 changes: 19 additions & 0 deletions compiler/icnif/nifbasics.nim
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
import std/[tables]
import ".." / [ast, lineinfos, msgs, options]
import "../../dist/nimony/src/gear2" / modnames

proc modname(moduleToNifSuffix: var Table[FileIndex, string]; module: PSym; conf: ConfigRef): string =
assert module.kind == skModule
let idx: FileIndex = module.position.FileIndex
# copied from ../nifgen.nim
result = moduleToNifSuffix.getOrDefault(idx)
if result.len == 0:
let fp = toFullPath(conf, idx)
result = moduleSuffix(fp, cast[seq[string]](conf.searchPaths))
moduleToNifSuffix[idx] = result
#echo result, " -> ", fp

proc toNifSym*(sym: PSym; moduleToNifSuffix: var Table[FileIndex, string]; conf: ConfigRef): string =
let module = sym.originatingModule

result = sym.name.s & '.' & $sym.disamb & '.' & modname(moduleToNifSuffix, module, conf)
Loading