From 07fea75b458c52fd9a9ebf005c0ddca2bf9a0b46 Mon Sep 17 00:00:00 2001 From: Araq Date: Sat, 5 Apr 2025 10:38:19 +0200 Subject: [PATCH 01/15] WIP: tracking support for IDE integration --- src/nimony/nifconfig.nim | 5 +++++ src/nimony/nimony.nim | 31 ++++++++++++++++++++++++++++++- 2 files changed, 35 insertions(+), 1 deletion(-) diff --git a/src/nimony/nifconfig.nim b/src/nimony/nifconfig.nim index b813a59cc..a1431a8cf 100644 --- a/src/nimony/nifconfig.nim +++ b/src/nimony/nifconfig.nim @@ -13,6 +13,10 @@ import platform include nifprelude type + TrackPosition* = object + line*, col*: int + filename*: string + NifConfig* = object defines*: HashSet[string] paths*, nimblePaths*: seq[string] @@ -22,6 +26,7 @@ type compat*: bool targetCPU*: TSystemCPU targetOS*: TSystemOS + toTrack*: seq[TrackPosition] proc initNifConfig*(): NifConfig = result = NifConfig() diff --git a/src/nimony/nimony.nim b/src/nimony/nimony.nim index f6bb38f5a..4eda8d0f0 100644 --- a/src/nimony/nimony.nim +++ b/src/nimony/nimony.nim @@ -16,7 +16,7 @@ const Version = "0.2" Usage = "Nimony Compiler. Version " & Version & """ - (c) 2024 Andreas Rumpf + (c) 2024-2025 Andreas Rumpf Usage: nimony [options] [command] Command: @@ -40,6 +40,7 @@ Options: --silentMake suppresses make output --nimcache:PATH set the path used for generated files --boundchecks:on|off turn bound checks on or off + --track:file:line:col track the given position for editor integration --version show the version --help show this help """ @@ -58,6 +59,31 @@ proc processSingleModule(nimFile: string; config: sink NifConfig; moduleFlags: s quoteShell(src) semcheck(src, dest, ensureMove config, moduleFlags, commandLineArgs, true) +proc parseTrack(s: string): TrackPosition = + # -------------------------------------------------------------------------- + # Format: file:line:col + # -------------------------------------------------------------------------- + var i = 0 + var line = 0 + var col = 0 + # skip Windows drive letter: + if s.len > 3 and s[0] in {'a'..'z', 'A'..'Z'} and s[1] == ':' and s[2] == '\\': + i = 3 + while i < s.len and s[i] != ':': + inc i + let filenameEnd = i + if i < s.len and s[i] == ':': inc i + + while i < s.len and s[i] in {'0'..'9'}: + line = line * 10 + (ord(s[i]) - ord('0')) + inc i + if i < s.len and s[i] == ':': inc i + while i < s.len and s[i] in {'0'..'9'}: + col = col * 10 + (ord(s[i]) - ord('0')) + inc i + if i < s.len and s[i] == ':': inc i + result = TrackPosition(line: line, col: col, filename: s.substr(0, filenameEnd-1)) + type Command = enum None, SingleModule, FullProject @@ -146,6 +172,9 @@ proc handleCmdLine() = of "nimcache": config.nifcachePath = val forwardArgNifc = true + of "track": + config.toTrack.add parseTrack(val) + forwardArg = false else: writeHelp() if forwardArg: commandLineArgs.add " --" & key From ba913834ad263fa0fef8ad2626e489cf05f1b76f Mon Sep 17 00:00:00 2001 From: Araq Date: Sat, 5 Apr 2025 14:06:09 +0200 Subject: [PATCH 02/15] format compatible with Nim --- src/nimony/nimony.nim | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) diff --git a/src/nimony/nimony.nim b/src/nimony/nimony.nim index 4eda8d0f0..f263bb293 100644 --- a/src/nimony/nimony.nim +++ b/src/nimony/nimony.nim @@ -40,7 +40,7 @@ Options: --silentMake suppresses make output --nimcache:PATH set the path used for generated files --boundchecks:on|off turn bound checks on or off - --track:file:line:col track the given position for editor integration + --track:file,line,col track the given position for editor integration --version show the version --help show this help """ @@ -61,27 +61,23 @@ proc processSingleModule(nimFile: string; config: sink NifConfig; moduleFlags: s proc parseTrack(s: string): TrackPosition = # -------------------------------------------------------------------------- - # Format: file:line:col + # Format: file,line,col # -------------------------------------------------------------------------- var i = 0 var line = 0 var col = 0 - # skip Windows drive letter: - if s.len > 3 and s[0] in {'a'..'z', 'A'..'Z'} and s[1] == ':' and s[2] == '\\': - i = 3 - while i < s.len and s[i] != ':': + while i < s.len and s[i] != ',': inc i let filenameEnd = i - if i < s.len and s[i] == ':': inc i + if i < s.len and s[i] == ',': inc i while i < s.len and s[i] in {'0'..'9'}: line = line * 10 + (ord(s[i]) - ord('0')) inc i - if i < s.len and s[i] == ':': inc i + if i < s.len and s[i] == ',': inc i while i < s.len and s[i] in {'0'..'9'}: col = col * 10 + (ord(s[i]) - ord('0')) inc i - if i < s.len and s[i] == ':': inc i result = TrackPosition(line: line, col: col, filename: s.substr(0, filenameEnd-1)) type From e7db130cb5f7b90a96117d5d471f06f14e461084 Mon Sep 17 00:00:00 2001 From: Araq Date: Fri, 19 Sep 2025 06:43:49 +0200 Subject: [PATCH 03/15] progress --- src/nimony/nimony.nim | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/nimony/nimony.nim b/src/nimony/nimony.nim index 977cab603..250c4d212 100644 --- a/src/nimony/nimony.nim +++ b/src/nimony/nimony.nim @@ -235,7 +235,7 @@ proc handleCmdLine(c: var CmdOptions; cmdLineArgs: seq[string]; mode: CmdMode) = of "linker": c.config.linker = val of "track": - config.toTrack.add parseTrack(val) + c.config.toTrack.add parseTrack(val) forwardArg = false else: writeHelp() if forwardArg: From a6b21e51d7cda9ef28a48e0e46445535804962e8 Mon Sep 17 00:00:00 2001 From: Araq Date: Fri, 19 Sep 2025 08:48:38 +0200 Subject: [PATCH 04/15] Idetools: progress --- src/nimony/deps.nim | 44 +++++++++++++++++++++++++++++++--------- src/nimony/nifconfig.nim | 5 ++++- src/nimony/nimony.nim | 43 +++++++++++++++------------------------ src/nimony/nimsem.nim | 40 +++++++++++++++++++++++++++++++++++- 4 files changed, 93 insertions(+), 39 deletions(-) diff --git a/src/nimony/deps.nim b/src/nimony/deps.nim index d1515fce6..bbffa1eb3 100644 --- a/src/nimony/deps.nim +++ b/src/nimony/deps.nim @@ -540,7 +540,7 @@ proc generatePluginSemInstructions(c: DepContext; v: Node; b: var Builder) = b.withTree "output": b.addStrLit c.config.indexFile(v.files[0], v.plugin) -proc generateFrontendBuildFile(c: DepContext; commandLineArgs: string): string = +proc generateFrontendBuildFile(c: DepContext; commandLineArgs: string; cmd: Command): string = result = c.config.nifcachePath / c.rootNode.files[0].modname & ".build.nif" var b = nifbuilder.open(result) defer: b.close() @@ -568,6 +568,22 @@ proc generateFrontendBuildFile(c: DepContext; commandLineArgs: string): string = b.withTree "output": b.addIntLit 1 # index file output + if cmd == DoCheck: + b.withTree "cmd": + b.addSymbolDef "idetools" + b.addStrLit c.nimsem + if c.config.baseDir.len > 0: + b.addStrLit "--base:" & quoteShell(c.config.baseDir) + if commandLineArgs.len > 0: + for arg in commandLineArgs.split(' '): + if arg.len > 0: + b.addStrLit arg + b.addStrLit "idetools" + b.addKeyw "args" + b.withTree "input": + b.addIntLit 0 + b.addIntLit -1 # all inputs + for plugin in c.foundPlugins: b.withTree "cmd": b.addSymbolDef plugin @@ -605,6 +621,13 @@ proc generateFrontendBuildFile(c: DepContext; commandLineArgs: string): string = b.addStrLit nimFile b.withTree "output": b.addStrLit f + if cmd == DoCheck: + b.withTree "do": + b.addIdent "idetools" + for v in c.nodes: + let s = c.config.semmedFile(v.files[0], v.plugin) + b.withTree "input": + b.addStrLit s proc generateCachedConfigFile(c: DepContext; passC, passL: string) = let path = c.config.cachedConfigFile() @@ -818,7 +841,7 @@ proc buildGraph*(config: sink NifConfig; project: string; forceRebuild, silentMa var c = initDepContext(config, project, nifler, false, forceRebuild, moduleFlags, cmd) generateCachedConfigFile c, passC, passL - let buildFilename = generateFrontendBuildFile(c, commandLineArgs) + let buildFilename = generateFrontendBuildFile(c, commandLineArgs, cmd) #echo "run with: nifmake run ", buildFilename when defined(windows): putEnv("CC", "gcc") @@ -829,11 +852,12 @@ proc buildGraph*(config: sink NifConfig; project: string; forceRebuild, silentMa " -j run " exec nifmakeCommand & quoteShell(buildFilename) - # Parse `.s.deps.nif`. - # It is generated by nimsem and doesn't contains modules imported under `when false:`. - # https://github.com/nim-lang/nimony/issues/985 - c = initDepContext(config, project, nifler, true, forceRebuild, moduleFlags, cmd) - let buildFinalFilename = generateFinalBuildFile(c, commandLineArgsNifc, passC, passL) - exec nifmakeCommand & quoteShell(buildFinalFilename) - if cmd == DoRun: - exec c.config.exeFile(c.rootNode.files[0]) & executableArgs + if cmd != DoCheck: + # Parse `.s.deps.nif`. + # It is generated by nimsem and doesn't contains modules imported under `when false:`. + # https://github.com/nim-lang/nimony/issues/985 + c = initDepContext(config, project, nifler, true, forceRebuild, moduleFlags, cmd) + let buildFinalFilename = generateFinalBuildFile(c, commandLineArgsNifc, passC, passL) + exec nifmakeCommand & quoteShell(buildFinalFilename) + if cmd == DoRun: + exec c.config.exeFile(c.rootNode.files[0]) & executableArgs diff --git a/src/nimony/nifconfig.nim b/src/nimony/nifconfig.nim index a0409f590..9ba366ee7 100644 --- a/src/nimony/nifconfig.nim +++ b/src/nimony/nifconfig.nim @@ -13,7 +13,10 @@ import platform include nifprelude type + TrackMode* = enum + TrackNone, TrackUsages, TrackDef TrackPosition* = object + mode*: TrackMode line*, col*: int filename*: string @@ -26,7 +29,7 @@ type compat*: bool targetCPU*: TSystemCPU targetOS*: TSystemOS - toTrack*: seq[TrackPosition] + toTrack*: TrackPosition cc*: string linker*: string ccKey*: string diff --git a/src/nimony/nimony.nim b/src/nimony/nimony.nim index 34669ffb2..5b89aebc9 100644 --- a/src/nimony/nimony.nim +++ b/src/nimony/nimony.nim @@ -29,7 +29,10 @@ Usage: nimony [options] [command] Command: c project.nim compile the full project - m file.nim [project.nim] compile a single Nim module to hexer + check project.nim check the full project for errors; can be + combined with `--usages`, `--def` for + editor integration + m file.nim [project.nim] compile a single Nim module to Hexer Options: -d, --define:SYMBOL define a symbol for conditional compilation @@ -47,7 +50,8 @@ Options: --silentMake suppresses make output --nimcache:PATH set the path used for generated files --boundchecks:on|off turn bound checks on or off - --track:file,line,col track the given position for editor integration + --usages:file,line,col list usages of the symbol at the given position + --def:file,line,col list definition of the symbol at the given position --cc:C_COMPILER set the C compiler; can be a path to the compiler's executable or a name --linker:LINKER set the linker @@ -69,30 +73,9 @@ proc processSingleModule(nimFile: string; config: sink NifConfig; moduleFlags: s quoteShell(src) semcheck(src, dest, ensureMove config, moduleFlags, commandLineArgs, true) -proc parseTrack(s: string): TrackPosition = - # -------------------------------------------------------------------------- - # Format: file,line,col - # -------------------------------------------------------------------------- - var i = 0 - var line = 0 - var col = 0 - while i < s.len and s[i] != ',': - inc i - let filenameEnd = i - if i < s.len and s[i] == ',': inc i - - while i < s.len and s[i] in {'0'..'9'}: - line = line * 10 + (ord(s[i]) - ord('0')) - inc i - if i < s.len and s[i] == ',': inc i - while i < s.len and s[i] in {'0'..'9'}: - col = col * 10 + (ord(s[i]) - ord('0')) - inc i - result = TrackPosition(line: line, col: col, filename: s.substr(0, filenameEnd-1)) - type Command = enum - None, SingleModule, FullProject + None, SingleModule, FullProject, CheckProject proc dispatchBasicCommand(key: string): Command = case key.normalize: @@ -100,6 +83,8 @@ proc dispatchBasicCommand(key: string): Command = SingleModule of "c": FullProject + of "check": + CheckProject else: quit "command expected" @@ -234,9 +219,8 @@ proc handleCmdLine(c: var CmdOptions; cmdLineArgs: seq[string]; mode: CmdMode) = c.config.ccKey = extractCCKey(val) of "linker": c.config.linker = val - of "track": - c.config.toTrack.add parseTrack(val) - forwardArg = false + of "usages", "def": + forwardArg = true else: writeHelp() if forwardArg: c.commandLineArgs.add " --" & key @@ -276,6 +260,11 @@ proc compileProgram(c: var CmdOptions) = buildGraph c.config, c.args[0], c.forceRebuild, c.silentMake, c.commandLineArgs, c.commandLineArgsNifc, c.moduleFlags, (if c.doRun: DoRun else: DoCompile), c.passC, c.passL, c.executableArgs + of CheckProject: + createDir(c.config.nifcachePath) + # check full project modules + buildGraph c.config, c.args[0], c.forceRebuild, c.silentMake, + c.commandLineArgs, c.commandLineArgsNifc, c.moduleFlags, DoCheck, c.passC, c.passL, c.executableArgs when isMainModule: var c = createCmdOptions(determineBaseDir()) diff --git a/src/nimony/nimsem.nim b/src/nimony/nimsem.nim index 2bab090e4..ac91ddd62 100644 --- a/src/nimony/nimsem.nim +++ b/src/nimony/nimsem.nim @@ -25,6 +25,7 @@ Command: m input.nif output.nif index.nif compile a single Nim module to hexer x file.nif generate the .idx.nif file from a .nif file e file.nif [dep1.nif ...] execute the given .nif file + idetools file1.nif [file2.nif ...] list usages and definitions Options: -d, --define:SYMBOL define a symbol for conditional compilation @@ -48,7 +49,7 @@ proc writeVersion() = quit(Version & "\n", QuitSuccess) type Command = enum - None, SingleModule, GenerateIdx, Execute + None, SingleModule, GenerateIdx, Execute, Idetools proc singleModule(infile, outfile, idxfile: string; config: sink NifConfig; moduleFlags: set[ModuleFlag]) = if not semos.fileExists(infile): @@ -76,6 +77,27 @@ proc executeNif(files: seq[string]; config: sink NifConfig) = moduleFlags = {} ) +proc parseTrack(s: string; mode: TrackMode): TrackPosition = + # -------------------------------------------------------------------------- + # Format: file,line,col + # -------------------------------------------------------------------------- + var i = 0 + var line = 0 + var col = 0 + while i < s.len and s[i] != ',': + inc i + let filenameEnd = i + if i < s.len and s[i] == ',': inc i + + while i < s.len and s[i] in {'0'..'9'}: + line = line * 10 + (ord(s[i]) - ord('0')) + inc i + if i < s.len and s[i] == ',': inc i + while i < s.len and s[i] in {'0'..'9'}: + col = col * 10 + (ord(s[i]) - ord('0')) + inc i + result = TrackPosition(mode: mode, line: line, col: col, filename: s.substr(0, filenameEnd-1)) + proc handleCmdLine() = var args: seq[string] = @[] var cmd = Command.None @@ -94,6 +116,8 @@ proc handleCmdLine() = cmd = GenerateIdx of "e": cmd = Execute + of "idetools": + cmd = Idetools else: quit "command expected" else: @@ -137,6 +161,16 @@ proc handleCmdLine() = config.linker = val of "nimcache": config.nifcachePath = val + of "usages": + if config.toTrack.mode == TrackNone: + config.toTrack = parseTrack(val, TrackUsages) + else: + quit "only one --usages or --def can be used" + of "def": + if config.toTrack.mode == TrackNone: + config.toTrack = parseTrack(val, TrackDef) + else: + quit "only one --usages or --def can be used" else: writeHelp() if forwardArg: commandLineArgs.add " --" & key @@ -163,6 +197,10 @@ proc handleCmdLine() = if args.len == 0: quit "want more than 0 command line argument" executeNif args, ensureMove config + of Idetools: + if args.len == 0: + quit "want more than 0 command line argument" + quit "not implemented!" when isMainModule: handleCmdLine() From f73780eebf997b0dcc27143e6d7f1f886f8411e8 Mon Sep 17 00:00:00 2001 From: Araq Date: Sat, 20 Sep 2025 07:42:31 +0200 Subject: [PATCH 05/15] progress --- src/nimony/deps.nim | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/nimony/deps.nim b/src/nimony/deps.nim index bbffa1eb3..20f2dcc2e 100644 --- a/src/nimony/deps.nim +++ b/src/nimony/deps.nim @@ -41,6 +41,9 @@ proc nifcFile(config: NifConfig; f: FilePair): string = config.nifcachePath / f. proc cFile(config: NifConfig; f: FilePair): string = config.nifcachePath / f.modname & ".c" proc objFile(config: NifConfig; f: FilePair): string = config.nifcachePath / f.modname & ".o" +proc idetoolsFile(config: NifConfig; f: FilePair; bundle: string): string = + config.nifcachePath / bundle / f.modname & ".idetools.nif" + # It turned out to be too annoying in practice to have the exe file in # the current directory per default so we now put it into the nifcache too: proc exeFile(config: NifConfig; f: FilePair): string = @@ -522,6 +525,9 @@ proc generateSemInstructions(c: DepContext; v: Node; b: var Builder; isMain: boo b.addStrLit c.config.semmedFile(v.files[0], v.plugin) b.withTree "output": b.addStrLit c.config.indexFile(v.files[0], v.plugin) + if c.cmd == DoCheck: + b.withTree "output": + b.addStrLit c.config.idetoolsFile(v.files[0], v.plugin) proc generatePluginSemInstructions(c: DepContext; v: Node; b: var Builder) = #[ An import plugin fills `nimcache/` for us. It is our job to @@ -621,6 +627,7 @@ proc generateFrontendBuildFile(c: DepContext; commandLineArgs: string; cmd: Comm b.addStrLit nimFile b.withTree "output": b.addStrLit f + if cmd == DoCheck: b.withTree "do": b.addIdent "idetools" From a7d3d0ef6e7d5b4eb109e7314f6526adc01a3d18 Mon Sep 17 00:00:00 2001 From: araq Date: Sat, 20 Sep 2025 12:40:30 +0200 Subject: [PATCH 06/15] progress --- src/nimony/idetools.nim | 134 +++++++++++++++++++++++++++++++++++++++ src/nimony/nifconfig.nim | 2 +- src/nimony/nimsem.nim | 18 ++++-- 3 files changed, 147 insertions(+), 7 deletions(-) create mode 100644 src/nimony/idetools.nim diff --git a/src/nimony/idetools.nim b/src/nimony/idetools.nim new file mode 100644 index 000000000..cb9d3a1fd --- /dev/null +++ b/src/nimony/idetools.nim @@ -0,0 +1,134 @@ +# Nimony +# (c) Copyright 2025 Andreas Rumpf +# +# See the file "license.txt", included in this +# distribution, for details about the copyright. + +import std / [sets, syncio] +include ".." / lib / nifprelude +import semos, symparser, nifindexes, tooldirs, nifconfig, nimony_model + +proc lineInfoMatch*(info, toTrack: PackedLineInfo; tokenLen: int): bool = + let i = unpack(pool.man, info) + let t = unpack(pool.man, toTrack) + if i.file.isValid and t.file.isValid: + if i.file != t.file: return false + if i.line != t.line: return false + if i.col < t.col: return false + if i.col + tokenLen > t.col: return false + return true + +proc foundUsage(tok: PackedToken) = + # format that is compatible with nimsuggest's in the hope it helps: + let info = unpack(pool.man, tok.info) + if info.file.isValid: + var r = "use\t" + r.add "\t" # unknown symbol kind + r.add pool.syms[tok.symId] + r.add "\t" + # unknown signature: + r.add "\t" + # filename: + r.add "\t" + r.add pool.files[info.file] + r.add "\t" + r.addInt info.line + r.add "\t" + r.addInt info.col + stdout.writeLine(r) + +proc findLocal(file: string; sym: SymId; toTrack: PackedLineInfo) = + var buf = parseFromFile(file) + var n = beginRead(buf) + var scopes: seq[(Cursor, int)] = @[(n, 0)] + + var name = pool.syms[sym] + extractBasename name + + let tokenLen = name.len + var foundScope = false + var nested = 0 + while true: + case n.stmtKind + of ScopeS: + inc nested + scopes.add (n, nested) + of ProcS, FuncS, MethodS, IteratorS, TemplateS, MacroS, ConverterS: + inc nested + scopes.add (n, nested) + else: + case n.kind + of Symbol: + if n.symId == sym and lineInfoMatch(n.info, toTrack, tokenLen): + foundScope = true + break + of ParLe: inc nested + of ParRi: + dec nested + if nested == scopes[^1][1]: + discard scopes.pop() + + if nested == 0: break + else: + discard + inc n + + n = scopes[^1][0] + inc n + nested = 1 # in owning structure + while true: + case n.kind + of ParLe: inc nested + of ParRi: + dec nested + if nested == 0: break + of Symbol: + if n.symId == sym: + foundUsage(n.load) + else: + discard + inc n + +proc usages*(files: openArray[string]; config: NifConfig) = + # This is comparable to a linking step: We iterate over all `.idetools.nif` files to see + # what symbol is meant by the `file,line,col` tracking information. + var syms = initHashSet[SymId]() + var foundLocals = 0 + for file in files: + let x = changeModuleExt(file, ".idetools.nif") + if semos.fileExists(x): + var s = nifstreams.open(x) + try: + var tok = next(s) + if tok.kind == ParLe: tok = next(s) + if tok.kind == Symbol: + let sym = tok.symId + if isLocalName(pool.syms[sym]): + # for a local symbol we know we are in the correct file and need to find the outermost scope + # where the symbol is declared. That is the parent node that is a `scope` or routine node. + let requestedInfo = lineinfos.pack(pool.man, pool.files.getOrIncl(config.toTrack.filename), config.toTrack.line, config.toTrack.col) + findLocal(file, sym, requestedInfo) + inc foundLocals + else: + syms.incl sym + finally: + close(s) + if syms.len == 0: + if foundLocals == 0: + quit "no symbols found" + else: + return + for file in files: + var s = nifstreams.open(file) + try: + discard processDirectives(s.r) + while true: + let tok = next(s) + case tok.kind + of Symbol: + if tok.symId in syms: foundUsage(tok) + of EofToken: break + of UnknownToken, DotToken, Ident, SymbolDef, StringLit, CharLit, IntLit, UIntLit, FloatLit, ParLe, ParRi: + discard "proceed" + finally: + close(s) diff --git a/src/nimony/nifconfig.nim b/src/nimony/nifconfig.nim index 9ba366ee7..bb21437c8 100644 --- a/src/nimony/nifconfig.nim +++ b/src/nimony/nifconfig.nim @@ -17,7 +17,7 @@ type TrackNone, TrackUsages, TrackDef TrackPosition* = object mode*: TrackMode - line*, col*: int + line*, col*: int32 filename*: string NifConfig* = object diff --git a/src/nimony/nimsem.nim b/src/nimony/nimsem.nim index ac91ddd62..d7f703e23 100644 --- a/src/nimony/nimsem.nim +++ b/src/nimony/nimsem.nim @@ -12,7 +12,7 @@ import ".." / hexer / hexer # only imported to ensure it keeps compiling import ".." / gear2 / modnames import ".." / lib / argsfinder import sem, nifconfig, semos, semdata, indexgen, programs -import nifstreams, derefs, deps, nifcursors, nifreader, nifbuilder, nifindexes, tooldirs +import nifstreams, derefs, deps, nifcursors, nifreader, nifbuilder, nifindexes, tooldirs, idetools const Version = "0.2" @@ -82,19 +82,19 @@ proc parseTrack(s: string; mode: TrackMode): TrackPosition = # Format: file,line,col # -------------------------------------------------------------------------- var i = 0 - var line = 0 - var col = 0 + var line = 0'i32 + var col = 0'i32 while i < s.len and s[i] != ',': inc i let filenameEnd = i if i < s.len and s[i] == ',': inc i while i < s.len and s[i] in {'0'..'9'}: - line = line * 10 + (ord(s[i]) - ord('0')) + line = line * 10'i32 + (ord(s[i]) - ord('0')).int32 inc i if i < s.len and s[i] == ',': inc i while i < s.len and s[i] in {'0'..'9'}: - col = col * 10 + (ord(s[i]) - ord('0')) + col = col * 10'i32 + (ord(s[i]) - ord('0')).int32 inc i result = TrackPosition(mode: mode, line: line, col: col, filename: s.substr(0, filenameEnd-1)) @@ -200,7 +200,13 @@ proc handleCmdLine() = of Idetools: if args.len == 0: quit "want more than 0 command line argument" - quit "not implemented!" + case config.toTrack.mode + of TrackUsages: + usages(args, config) + of TrackDef: + quit "definitions not implemented yet" + of TrackNone: + quit "no --track information provided" when isMainModule: handleCmdLine() From a68c71f57648efbd304d80ddfac3984280b40173 Mon Sep 17 00:00:00 2001 From: Araq Date: Sat, 20 Sep 2025 18:39:01 +0200 Subject: [PATCH 07/15] progress --- src/nimony/deps.nim | 6 ---- src/nimony/idetools.nim | 67 +++++++++++++++++++++++------------------ 2 files changed, 38 insertions(+), 35 deletions(-) diff --git a/src/nimony/deps.nim b/src/nimony/deps.nim index 20f2dcc2e..477634252 100644 --- a/src/nimony/deps.nim +++ b/src/nimony/deps.nim @@ -41,9 +41,6 @@ proc nifcFile(config: NifConfig; f: FilePair): string = config.nifcachePath / f. proc cFile(config: NifConfig; f: FilePair): string = config.nifcachePath / f.modname & ".c" proc objFile(config: NifConfig; f: FilePair): string = config.nifcachePath / f.modname & ".o" -proc idetoolsFile(config: NifConfig; f: FilePair; bundle: string): string = - config.nifcachePath / bundle / f.modname & ".idetools.nif" - # It turned out to be too annoying in practice to have the exe file in # the current directory per default so we now put it into the nifcache too: proc exeFile(config: NifConfig; f: FilePair): string = @@ -525,9 +522,6 @@ proc generateSemInstructions(c: DepContext; v: Node; b: var Builder; isMain: boo b.addStrLit c.config.semmedFile(v.files[0], v.plugin) b.withTree "output": b.addStrLit c.config.indexFile(v.files[0], v.plugin) - if c.cmd == DoCheck: - b.withTree "output": - b.addStrLit c.config.idetoolsFile(v.files[0], v.plugin) proc generatePluginSemInstructions(c: DepContext; v: Node; b: var Builder) = #[ An import plugin fills `nimcache/` for us. It is our job to diff --git a/src/nimony/idetools.nim b/src/nimony/idetools.nim index cb9d3a1fd..499a3a070 100644 --- a/src/nimony/idetools.nim +++ b/src/nimony/idetools.nim @@ -92,32 +92,12 @@ proc findLocal(file: string; sym: SymId; toTrack: PackedLineInfo) = proc usages*(files: openArray[string]; config: NifConfig) = # This is comparable to a linking step: We iterate over all `.idetools.nif` files to see # what symbol is meant by the `file,line,col` tracking information. - var syms = initHashSet[SymId]() - var foundLocals = 0 - for file in files: - let x = changeModuleExt(file, ".idetools.nif") - if semos.fileExists(x): - var s = nifstreams.open(x) - try: - var tok = next(s) - if tok.kind == ParLe: tok = next(s) - if tok.kind == Symbol: - let sym = tok.symId - if isLocalName(pool.syms[sym]): - # for a local symbol we know we are in the correct file and need to find the outermost scope - # where the symbol is declared. That is the parent node that is a `scope` or routine node. - let requestedInfo = lineinfos.pack(pool.man, pool.files.getOrIncl(config.toTrack.filename), config.toTrack.line, config.toTrack.col) - findLocal(file, sym, requestedInfo) - inc foundLocals - else: - syms.incl sym - finally: - close(s) - if syms.len == 0: - if foundLocals == 0: - quit "no symbols found" - else: - return + let requestedInfo = lineinfos.pack(pool.man, pool.files.getOrIncl(config.toTrack.filename), + config.toTrack.line, config.toTrack.col) + # first pass: search for the symbol at `file,line,col`: + var isLocalSym = false + var symId = SymId 0 + var symFile = "" for file in files: var s = nifstreams.open(file) try: @@ -125,10 +105,39 @@ proc usages*(files: openArray[string]; config: NifConfig) = while true: let tok = next(s) case tok.kind - of Symbol: - if tok.symId in syms: foundUsage(tok) + of Symbol, SymbolDef: + var name = pool.syms[tok.symId] + let isLocal = isLocalName(name) + extractBasename name + + let tokenLen = name.len + if lineInfoMatch(tok.info, requestedInfo, tokenLen): + isLocalSym = isLocal + symId = tok.symId + symFile = file + break of EofToken: break - of UnknownToken, DotToken, Ident, SymbolDef, StringLit, CharLit, IntLit, UIntLit, FloatLit, ParLe, ParRi: + of UnknownToken, DotToken, Ident, StringLit, CharLit, IntLit, UIntLit, FloatLit, ParLe, ParRi: discard "proceed" finally: close(s) + + if symId == SymId 0: + quit "symbol not found" + elif isLocalSym: + findLocal(symFile, symId, requestedInfo) + else: + for file in files: + var s = nifstreams.open(file) + try: + discard processDirectives(s.r) + while true: + let tok = next(s) + case tok.kind + of Symbol: + if tok.symId == symId: foundUsage(tok) + of EofToken: break + of UnknownToken, DotToken, Ident, SymbolDef, StringLit, CharLit, IntLit, UIntLit, FloatLit, ParLe, ParRi: + discard "proceed" + finally: + close(s) From 06eafd70d27faa65710fef5537ce91dc636c62a5 Mon Sep 17 00:00:00 2001 From: Araq Date: Sun, 21 Sep 2025 08:21:38 +0200 Subject: [PATCH 08/15] progress --- src/nimony/deps.nim | 3 -- src/nimony/idetools.nim | 62 ++++++++++++++++++++++------------------- src/nimony/nimsem.nim | 4 +-- 3 files changed, 35 insertions(+), 34 deletions(-) diff --git a/src/nimony/deps.nim b/src/nimony/deps.nim index 477634252..97bc263e2 100644 --- a/src/nimony/deps.nim +++ b/src/nimony/deps.nim @@ -753,7 +753,6 @@ proc buildGraphForEval*(config: NifConfig; mainNifFile: string; dependencyNifFil let depName = depNifFile.splitModulePath.name allNifFiles.add(depName) let depHexedFile = config.nifcachePath / depName & ".s.nif" - let depCFile = config.nifcachePath / depName & ".x.nif" # Process dependency .nif file with hexer first b.withTree "do": @@ -767,8 +766,6 @@ proc buildGraphForEval*(config: NifConfig; mainNifFile: string; dependencyNifFil let mainName = mainNifFile.splitModulePath.name allNifFiles.add(mainName) let mainHexedFile = config.nifcachePath / mainName & ".x.nif" - let mainCFile = config.nifcachePath / mainName & ".c" - let mainObjFile = config.nifcachePath / mainName & ".o" # Process main .nif file with hexer first b.withTree "do": diff --git a/src/nimony/idetools.nim b/src/nimony/idetools.nim index 499a3a070..c9767f9fd 100644 --- a/src/nimony/idetools.nim +++ b/src/nimony/idetools.nim @@ -18,26 +18,27 @@ proc lineInfoMatch*(info, toTrack: PackedLineInfo; tokenLen: int): bool = if i.col + tokenLen > t.col: return false return true -proc foundUsage(tok: PackedToken) = +proc foundSymbol(tok: PackedToken; mode: TrackMode) = # format that is compatible with nimsuggest's in the hope it helps: let info = unpack(pool.man, tok.info) if info.file.isValid: - var r = "use\t" - r.add "\t" # unknown symbol kind - r.add pool.syms[tok.symId] - r.add "\t" - # unknown signature: - r.add "\t" - # filename: - r.add "\t" - r.add pool.files[info.file] - r.add "\t" - r.addInt info.line - r.add "\t" - r.addInt info.col - stdout.writeLine(r) + if (tok.kind == Symbol and mode == TrackUsages) or (tok.kind == SymbolDef and mode == TrackDef): + var r = (if tok.kind == Symbol: "use\t" else: "def\t") + r.add "\t" # unknown symbol kind + r.add pool.syms[tok.symId] + r.add "\t" + # unknown signature: + r.add "\t" + # filename: + r.add "\t" + r.add pool.files[info.file] + r.add "\t" + r.addInt info.line + r.add "\t" + r.addInt info.col + stdout.writeLine(r) -proc findLocal(file: string; sym: SymId; toTrack: PackedLineInfo) = +proc findLocal(file: string; sym: SymId; toTrack: PackedLineInfo; mode: TrackMode) = var buf = parseFromFile(file) var n = beginRead(buf) var scopes: seq[(Cursor, int)] = @[(n, 0)] @@ -58,7 +59,7 @@ proc findLocal(file: string; sym: SymId; toTrack: PackedLineInfo) = scopes.add (n, nested) else: case n.kind - of Symbol: + of Symbol, SymbolDef: if n.symId == sym and lineInfoMatch(n.info, toTrack, tokenLen): foundScope = true break @@ -82,9 +83,9 @@ proc findLocal(file: string; sym: SymId; toTrack: PackedLineInfo) = of ParRi: dec nested if nested == 0: break - of Symbol: + of Symbol, SymbolDef: if n.symId == sym: - foundUsage(n.load) + foundSymbol(n.load, mode) else: discard inc n @@ -106,13 +107,16 @@ proc usages*(files: openArray[string]; config: NifConfig) = let tok = next(s) case tok.kind of Symbol, SymbolDef: - var name = pool.syms[tok.symId] - let isLocal = isLocalName(name) - extractBasename name - - let tokenLen = name.len + # performance critical! May run over every symbol in the project! + var name = addr pool.syms[tok.symId] + var tokenLen = 0 + var dots = 0 + for i in 0 ..< name[].len: + if name[][i] == '.': + inc dots + if dots == 0: inc tokenLen if lineInfoMatch(tok.info, requestedInfo, tokenLen): - isLocalSym = isLocal + isLocalSym = dots < 2 symId = tok.symId symFile = file break @@ -125,7 +129,7 @@ proc usages*(files: openArray[string]; config: NifConfig) = if symId == SymId 0: quit "symbol not found" elif isLocalSym: - findLocal(symFile, symId, requestedInfo) + findLocal(symFile, symId, requestedInfo, config.toTrack.mode) else: for file in files: var s = nifstreams.open(file) @@ -135,9 +139,11 @@ proc usages*(files: openArray[string]; config: NifConfig) = let tok = next(s) case tok.kind of Symbol: - if tok.symId == symId: foundUsage(tok) + if tok.symId == symId: foundSymbol(tok, config.toTrack.mode) + of SymbolDef: + if tok.symId == symId: foundSymbol(tok, config.toTrack.mode) of EofToken: break - of UnknownToken, DotToken, Ident, SymbolDef, StringLit, CharLit, IntLit, UIntLit, FloatLit, ParLe, ParRi: + of UnknownToken, DotToken, Ident, StringLit, CharLit, IntLit, UIntLit, FloatLit, ParLe, ParRi: discard "proceed" finally: close(s) diff --git a/src/nimony/nimsem.nim b/src/nimony/nimsem.nim index d7f703e23..1e111632c 100644 --- a/src/nimony/nimsem.nim +++ b/src/nimony/nimsem.nim @@ -201,10 +201,8 @@ proc handleCmdLine() = if args.len == 0: quit "want more than 0 command line argument" case config.toTrack.mode - of TrackUsages: + of TrackUsages, TrackDef: usages(args, config) - of TrackDef: - quit "definitions not implemented yet" of TrackNone: quit "no --track information provided" From e6a5d96f179e4e349ce9408c197b895a8338722a Mon Sep 17 00:00:00 2001 From: Araq Date: Mon, 22 Sep 2025 00:54:52 +0200 Subject: [PATCH 09/15] progress --- src/nimony/nimony.nim | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/nimony/nimony.nim b/src/nimony/nimony.nim index 5b89aebc9..80ff3e5de 100644 --- a/src/nimony/nimony.nim +++ b/src/nimony/nimony.nim @@ -238,7 +238,7 @@ proc compileProgram(c: var CmdOptions) = c.config.linker = c.config.cc if c.args.len == 0: quit "too few command line arguments" - elif c.args.len > 2 - int(c.cmd == FullProject): + elif c.args.len > 2 - int(c.cmd in {FullProject, CheckProject}): quit "too many command line arguments" if c.checkModes != DefaultSettings: From d567984a984720e1486fdd49c31951aa8982fe77 Mon Sep 17 00:00:00 2001 From: Araq Date: Mon, 22 Sep 2025 01:44:58 +0200 Subject: [PATCH 10/15] progress --- src/nimony/deps.nim | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/nimony/deps.nim b/src/nimony/deps.nim index 97bc263e2..2c20b13d3 100644 --- a/src/nimony/deps.nim +++ b/src/nimony/deps.nim @@ -335,6 +335,8 @@ proc defineNiflerCmd(b: var Builder; nifler: string) = b.addStrLit "--portablePaths" b.addStrLit "--deps" b.addStrLit "parse" + b.addKeyw "input" + b.addKeyw "output" proc defineHexerCmds(b: var Builder; hexer: string; bits: int) = b.withTree "cmd": @@ -622,7 +624,7 @@ proc generateFrontendBuildFile(c: DepContext; commandLineArgs: string; cmd: Comm b.withTree "output": b.addStrLit f - if cmd == DoCheck: + if cmd == DoCheck and c.config.toTrack.mode != TrackNone: b.withTree "do": b.addIdent "idetools" for v in c.nodes: From 721482d85c30bed6eb769742db8f85db75b8f5e2 Mon Sep 17 00:00:00 2001 From: Araq Date: Mon, 22 Sep 2025 02:23:36 +0200 Subject: [PATCH 11/15] progress --- src/nimony/nimony.nim | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/nimony/nimony.nim b/src/nimony/nimony.nim index 80ff3e5de..a5c57742d 100644 --- a/src/nimony/nimony.nim +++ b/src/nimony/nimony.nim @@ -219,7 +219,13 @@ proc handleCmdLine(c: var CmdOptions; cmdLineArgs: seq[string]; mode: CmdMode) = c.config.ccKey = extractCCKey(val) of "linker": c.config.linker = val - of "usages", "def": + of "usages": + # set for deps.nim: + c.config.toTrack.mode = TrackUsages + forwardArg = true + of "def": + # set for deps.nim: + c.config.toTrack.mode = TrackDef forwardArg = true else: writeHelp() if forwardArg: From 67d57721e4fd81edea06b2d870dd19700faea169 Mon Sep 17 00:00:00 2001 From: Araq Date: Mon, 22 Sep 2025 02:36:01 +0200 Subject: [PATCH 12/15] track template and magic expansions for idetools --- src/nimony/sem.nim | 12 ++++++++++++ src/nimony/semcall.nim | 3 ++- src/nimony/semdata.nim | 1 + 3 files changed, 15 insertions(+), 1 deletion(-) diff --git a/src/nimony/sem.nim b/src/nimony/sem.nim index c5bf3231e..98dce0bd9 100644 --- a/src/nimony/sem.nim +++ b/src/nimony/sem.nim @@ -1609,6 +1609,7 @@ proc semTypeSym(c: var SemContext; s: Sym; info: PackedLineInfo; start: int; con # maybe substitution performed here? inc c.usedTypevars elif beforeMagic != afterMagic: + c.expanded.addSymUse s.name, info # was magic symbol, may be typeclass, otherwise nothing to do if context != InInvokeHead: let magic = cursorAt(c.dest, start).typeKind @@ -1872,7 +1873,11 @@ proc semExprSym(c: var SemContext; it: var Item; s: Sym; start: int; flags: set[ else: let res = declToCursor(c, s) if KeepMagics notin flags: + let beforeMagic = c.dest.len + let info = it.n.info maybeInlineMagic c, res + if beforeMagic != c.dest.len: + c.expanded.addSymUse s.name, info if res.status == LacksNothing: var n = res.decl if s.kind.isLocal or s.kind == EfldY: @@ -3617,6 +3622,7 @@ proc semCompiles(c: var SemContext; it: var Item) = let oldInWhen = c.inWhen let oldTemplateInstCounter = c.templateInstCounter let oldPending = c.pending.len + let oldExpanded = c.expanded.len let oldIncludeStackLen = c.includeStack.len let oldDebugAllowErrors = c.debugAllowErrors c.debugAllowErrors = true @@ -3638,6 +3644,7 @@ proc semCompiles(c: var SemContext; it: var Item) = c.inWhen = oldInWhen c.templateInstCounter = oldTemplateInstCounter c.pending.shrink(oldPending) + c.expanded.shrink(oldExpanded) c.debugAllowErrors = oldDebugAllowErrors @@ -5230,6 +5237,11 @@ proc semcheckCore(c: var SemContext; n0: Cursor) = skipParRi(cur) endRead(c.pending) + if c.expanded.len > 0: + c.dest.addParLe CommentS, NoLineInfo + c.dest.add c.expanded + c.dest.addParRi() + instantiateGenerics c for val in c.typeInstDecls: let s = fetchSym(c, val) diff --git a/src/nimony/semcall.nim b/src/nimony/semcall.nim index e9b88e888..10aa676a7 100644 --- a/src/nimony/semcall.nim +++ b/src/nimony/semcall.nim @@ -727,6 +727,7 @@ proc resolveOverloads(c: var SemContext; it: var Item; cs: var CallState) = buildErr c, cs.callNode.info, getErrorMsg(m[idx]) elif finalFn.kind == TemplateY: if c.templateInstCounter <= MaxNestedTemplates: + c.expanded.addSymUse finalFn.sym, cs.callNode.info inc c.templateInstCounter withErrorContext c, cs.callNode.info: semTemplateCall c, it, finalFn.sym, cs.beforeCall, m[idx] @@ -778,7 +779,7 @@ proc resolveOverloads(c: var SemContext; it: var Item; cs: var CallState) = swap c.dest, returnTypeBuf returnType = semReturnType(c, returnType) swap c.dest, returnTypeBuf - + typeofCallIs c, it, cs.beforeCall, returnType else: diff --git a/src/nimony/semdata.nim b/src/nimony/semdata.nim index 510e57a84..c668e9980 100644 --- a/src/nimony/semdata.nim +++ b/src/nimony/semdata.nim @@ -127,6 +127,7 @@ type semStmtCallback*: SemStmtCallback passL*: seq[string] passC*: seq[string] + expanded*: TokenBuf proc typeToCanon*(buf: TokenBuf; start: int): string = result = "" From ecbd028d730a0e89191e5a33c5cd25e2de03d52b Mon Sep 17 00:00:00 2001 From: Araq Date: Mon, 22 Sep 2025 02:57:38 +0200 Subject: [PATCH 13/15] basic test works --- src/nimony/idetools.nim | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/nimony/idetools.nim b/src/nimony/idetools.nim index c9767f9fd..2638a9c7a 100644 --- a/src/nimony/idetools.nim +++ b/src/nimony/idetools.nim @@ -14,8 +14,9 @@ proc lineInfoMatch*(info, toTrack: PackedLineInfo; tokenLen: int): bool = if i.file.isValid and t.file.isValid: if i.file != t.file: return false if i.line != t.line: return false - if i.col < t.col: return false - if i.col + tokenLen > t.col: return false + # Check if target column falls within the token's range + if t.col < i.col: return false + if t.col >= i.col + tokenLen: return false return true proc foundSymbol(tok: PackedToken; mode: TrackMode) = From f4a769b83781f5dd93f6cb30f7a81c6d73b06f61 Mon Sep 17 00:00:00 2001 From: Araq Date: Mon, 22 Sep 2025 07:18:59 +0200 Subject: [PATCH 14/15] progress --- src/nimony/sem.nim | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/nimony/sem.nim b/src/nimony/sem.nim index 98dce0bd9..bd68bee0a 100644 --- a/src/nimony/sem.nim +++ b/src/nimony/sem.nim @@ -1874,7 +1874,7 @@ proc semExprSym(c: var SemContext; it: var Item; s: Sym; start: int; flags: set[ let res = declToCursor(c, s) if KeepMagics notin flags: let beforeMagic = c.dest.len - let info = it.n.info + let info = c.dest[beforeMagic-1].info maybeInlineMagic c, res if beforeMagic != c.dest.len: c.expanded.addSymUse s.name, info @@ -5238,7 +5238,7 @@ proc semcheckCore(c: var SemContext; n0: Cursor) = endRead(c.pending) if c.expanded.len > 0: - c.dest.addParLe CommentS, NoLineInfo + c.dest.addParLe CommentS, c.expanded[0].info c.dest.add c.expanded c.dest.addParRi() From d643b966b89fcb78fb699d74eb5db87408710d00 Mon Sep 17 00:00:00 2001 From: Araq Date: Mon, 22 Sep 2025 08:31:30 +0200 Subject: [PATCH 15/15] patch test cases --- tests/nimony/const/tconstarrlen.nif | 3 ++- tests/nimony/generics/texplicitprocinst.nif | 3 ++- tests/nimony/generics/ttuplecache.nif | 3 ++- tests/nimony/iter/tforloops.nif | 3 ++- tests/nimony/iter/tforloops1.nif | 3 ++- tests/nimony/nosystem/t2.nif | 3 ++- tests/nimony/nosystem/tbinarytree.nif | 3 ++- tests/nimony/nosystem/tbool.nif | 3 ++- tests/nimony/nosystem/tcstring.nif | 3 ++- tests/nimony/nosystem/tdefinedarg.nif | 3 ++- tests/nimony/nosystem/tdistinct.nif | 3 ++- tests/nimony/nosystem/tfib2.nif | 3 ++- tests/nimony/nosystem/tforloop.nif | 3 ++- tests/nimony/nosystem/tgeneric_obj.nif | 3 ++- tests/nimony/nosystem/tgenericbinarytree.nif | 3 ++- tests/nimony/nosystem/tresemtype.nif | 3 ++- tests/nimony/nosystem/tsetter.nif | 3 ++- tests/nimony/nosystem/ttemplate.nif | 3 ++- tests/nimony/nosystem/tvarargs.nif | 3 ++- tests/nimony/nosystem/twhen.nif | 3 ++- tests/nimony/object/tcaseobject.nif | 3 ++- tests/nimony/overload/tnamedparams.nif | 3 ++- tests/nimony/pragmas/tcustompragma.nif | 3 ++- tests/nimony/pragmas/tpushpop.nif | 3 ++- tests/nimony/sets/tsets.nif | 3 ++- tests/nimony/sysbasics/tbasics.nif | 3 ++- tests/nimony/sysbasics/tdefaultparams.nif | 3 ++- tests/nimony/sysbasics/tderefs2.nif | 3 ++- tests/nimony/sysbasics/temptyseq.nif | 3 ++- tests/nimony/sysbasics/thooks.nif | 3 ++- tests/nimony/sysbasics/tintlitmatch.nif | 3 ++- tests/nimony/sysbasics/trefobject.nif | 3 ++- tests/nimony/sysbasics/tresultnoinit.nif | 3 ++- tests/nimony/sysbasics/ttabconstr.nif | 3 ++- tests/nimony/types/tscopedtype.nif | 3 ++- tests/nimony/when/twhenobject.nif | 3 ++- 36 files changed, 72 insertions(+), 36 deletions(-) diff --git a/tests/nimony/const/tconstarrlen.nif b/tests/nimony/const/tconstarrlen.nif index ea995d765..cc8052bdc 100644 --- a/tests/nimony/const/tconstarrlen.nif +++ b/tests/nimony/const/tconstarrlen.nif @@ -36,4 +36,5 @@ (conv (i -1) 12,2,tests/nimony/const/tconstarrlen.nim +0))) 2 +1))) 3 Len.0.tcog4tfmt1) ~1,1 (stmts - (discard .))))) \ No newline at end of file + (discard .)))) 13,4 + (comment array.0.sysvq0asl 11 int.0.sysvq0asl ~6,~3 array.0.sysvq0asl 5,~3 int.0.sysvq0asl ~9,3 len.1.sysvq0asl)) \ No newline at end of file diff --git a/tests/nimony/generics/texplicitprocinst.nif b/tests/nimony/generics/texplicitprocinst.nif index 58be3a8a6..31086a4e7 100644 --- a/tests/nimony/generics/texplicitprocinst.nif +++ b/tests/nimony/generics/texplicitprocinst.nif @@ -21,7 +21,8 @@ (call ~8 foo.2.texhjoap 1 +123) 16,6 (call ~16 foo.3.texhjoap 1 +123 6 "abc") ,10 (discard 28 - (call ~20 importedGeneric.0.texhjoap 1 +123)) 8,3 + (call ~20 importedGeneric.0.texhjoap 1 +123)) 12,3 + (comment int.0.sysvq0asl ,1 int.0.sysvq0asl ~8,2 int.0.sysvq0asl ~8,3 int.0.sysvq0asl 12,7 int.0.sysvq0asl) 8,3 (proc :foo.2.texhjoap . ~8,~3 . (at foo.0.texhjoap 4 (i -1)) 3,~3 diff --git a/tests/nimony/generics/ttuplecache.nif b/tests/nimony/generics/ttuplecache.nif index 9e19a54bd..acd484079 100644 --- a/tests/nimony/generics/ttuplecache.nif +++ b/tests/nimony/generics/ttuplecache.nif @@ -70,7 +70,8 @@ (glet :y2.0.ttuv4zf4c1 . . 4,~16 (i -1) 16 (tupat ~5 - (dot ~1 y.0.ttuv4zf4c1 data.0.Iarhs7y1.ttuv4zf4c1 +0) +1)) 22,15 + (dot ~1 y.0.ttuv4zf4c1 data.0.Iarhs7y1.ttuv4zf4c1 +0) +1)) 8,5 + (comment int.0.sysvq0asl 1,3 int.0.sysvq0asl 6,3 int.0.sysvq0asl ~2,1 int.0.sysvq0asl ~2,1 int.0.sysvq0asl ~1,5 int.0.sysvq0asl 4,5 int.0.sysvq0asl ~1,5 int.0.sysvq0asl 4,5 int.0.sysvq0asl ,11 int.0.sysvq0asl ,16 int.0.sysvq0asl) 22,15 (proc :initFooGeneric.1.ttuv4zf4c1 . ~22,~3 . (at initFooGeneric.0.ttuv4zf4c1 3 (tuple diff --git a/tests/nimony/iter/tforloops.nif b/tests/nimony/iter/tforloops.nif index d9cfd2be5..46adf16da 100644 --- a/tests/nimony/iter/tforloops.nif +++ b/tests/nimony/iter/tforloops.nif @@ -111,4 +111,5 @@ (i -1) 4 i.3) 4,1 (let :m.4 . . 8,~32 (i -1) 4 j.3))))) 3,36 - (call ~3 bar.0.tfocaa3fp1)) \ No newline at end of file + (call ~3 bar.0.tfocaa3fp1) 16,2 + (comment int.0.sysvq0asl ~5 int.0.sysvq0asl int.0.sysvq0asl 1,8 int.0.sysvq0asl ~6,8 int.0.sysvq0asl)) \ No newline at end of file diff --git a/tests/nimony/iter/tforloops1.nif b/tests/nimony/iter/tforloops1.nif index 1730ce404..6bdd8d6f1 100644 --- a/tests/nimony/iter/tforloops1.nif +++ b/tests/nimony/iter/tforloops1.nif @@ -443,7 +443,8 @@ (cmd write.1.syn1lfpjv 6 stdout.0.syn1lfpjv 21,133,tests/nimony/iter/tforloops1.nim (hderef y.1))) ,2 (cmd write.5.syn1lfpjv 6 stdout.0.syn1lfpjv 14 '\0A')))))))) 4,35 - (call ~4 main.0.tfo161bfb1))) 4,22 + (call ~4 main.0.tfo161bfb1))) 19,2 + (comment int.0.sysvq0asl ~9 int.0.sysvq0asl 1,8 cstring.0.sysvq0asl 4,16 int.0.sysvq0asl 4,16 int.0.sysvq0asl ~6,16 int.0.sysvq0asl 2,31 int.0.sysvq0asl ~9,31 int.0.sysvq0asl 1,37 int.0.sysvq0asl ~9,37 int.0.sysvq0asl 2,46 int.0.sysvq0asl ~9,46 int.0.sysvq0asl 1,49 int.0.sysvq0asl ~9,49 int.0.sysvq0asl 2,63 int.0.sysvq0asl ~9,63 int.0.sysvq0asl 1,66 int.0.sysvq0asl ~9,66 int.0.sysvq0asl ~12,25 >.0.sysvq0asl ~13,57 true.0.sysvq0asl ~13,78 echo.0.syn1lfpjv ~15,80 echo.0.syn1lfpjv ~4,86 int.0.sysvq0asl ~13,89 echo.0.syn1lfpjv ~15,94 echo.0.syn1lfpjv ~11,98 false.0.sysvq0asl ~9,99 true.0.sysvq0asl ~9,102 false.0.sysvq0asl ~10,104 true.0.sysvq0asl ~13,106 echo.0.syn1lfpjv ~11,107 true.0.sysvq0asl ~11,108 assert.0.assy765wm ~15,111 int.0.sysvq0asl ~15,117 echo.0.syn1lfpjv ~15,120 int.0.sysvq0asl ~5,128 true.0.sysvq0asl 1,128 false.0.sysvq0asl ~3,129 true.0.sysvq0asl 3,129 false.0.sysvq0asl ~11,130 echo.0.syn1lfpjv) 4,22 (proc :inc.0.tfo161bfb1 . 0,12,lib/std/system/arithmetics.nim . (at inc.1.sysvq0asl 19,~4 (i -1)) 21,12,lib/std/system/arithmetics.nim diff --git a/tests/nimony/nosystem/t2.nif b/tests/nimony/nosystem/t2.nif index 85d8e4695..6f936a19a 100644 --- a/tests/nimony/nosystem/t2.nif +++ b/tests/nimony/nosystem/t2.nif @@ -94,4 +94,5 @@ (ranges typeOfIter.0.t2er4ggt1) (stmts (ret "typeOfIter")))) - (ret result.2)))) \ No newline at end of file + (ret result.2))) 15,11 + (comment untyped.0.t2er4ggt1 18 typedesc.0.t2er4ggt1 1,6 int.0.t2er4ggt1 1,6 int.0.t2er4ggt1 ~2,6 int.0.t2er4ggt1 ~3,8 int.0.t2er4ggt1 6,8 int.0.t2er4ggt1 4,17 int.0.t2er4ggt1 ~5,17 int.0.t2er4ggt1)) \ No newline at end of file diff --git a/tests/nimony/nosystem/tbinarytree.nif b/tests/nimony/nosystem/tbinarytree.nif index 2ef248c9b..2f78b7c56 100644 --- a/tests/nimony/nosystem/tbinarytree.nif +++ b/tests/nimony/nosystem/tbinarytree.nif @@ -57,4 +57,5 @@ (ref 4 NodeObj.0.tbimvo1d9) 5 (kv ~4 data.0.tbimvo1d9 2 -123) 17 (kv ~4 left.0.tbimvo1d9 2 y.0.tbimvo1d9) 27 - (kv ~5 right.0.tbimvo1d9 2 y.0.tbimvo1d9)))) \ No newline at end of file + (kv ~5 right.0.tbimvo1d9 2 y.0.tbimvo1d9))) 10,4 + (comment int.0.tbimvo1d9)) \ No newline at end of file diff --git a/tests/nimony/nosystem/tbool.nif b/tests/nimony/nosystem/tbool.nif index 66d193116..5d20bcf6d 100644 --- a/tests/nimony/nosystem/tbool.nif +++ b/tests/nimony/nosystem/tbool.nif @@ -34,4 +34,5 @@ (true)) (stmts (ret "true")))) - (ret result.0)))) \ No newline at end of file + (ret result.0))) 7,3 + (comment bool.0.tbokvwxm9 7 true.0.tbokvwxm9 ~2,~3 bool.0.tbokvwxm9 ~5,~2 false.0.tbokvwxm9 ~5,~2 false.0.tbokvwxm9 6,~2 true.0.tbokvwxm9 6,~2 true.0.tbokvwxm9)) \ No newline at end of file diff --git a/tests/nimony/nosystem/tcstring.nif b/tests/nimony/nosystem/tcstring.nif index 2c399e14d..ddc3c483f 100644 --- a/tests/nimony/nosystem/tcstring.nif +++ b/tests/nimony/nosystem/tcstring.nif @@ -59,4 +59,5 @@ (gvar :zz.0.tcsj45p9m . . 8,~2 (cstring) 14 (hconv ~6,~2 - (cstring) "xzy"))) \ No newline at end of file + (cstring) "xzy")) 16,8 + (comment int.0.tcsj45p9m int.0.tcsj45p9m ~3 int.0.tcsj45p9m ,1 int.0.tcsj45p9m ,1 int.0.tcsj45p9m ~3,1 int.0.tcsj45p9m 1,3 int.0.tcsj45p9m 1,3 int.0.tcsj45p9m ~3,3 bool.0.tcsj45p9m ~4,10 cstring.0.tcsj45p9m ~3,5 int.0.tcsj45p9m ~9,7 pointer.0.tcsj45p9m ~8,12 cstring.0.tcsj45p9m)) \ No newline at end of file diff --git a/tests/nimony/nosystem/tdefinedarg.nif b/tests/nimony/nosystem/tdefinedarg.nif index dd71d2610..a244f951f 100644 --- a/tests/nimony/nosystem/tdefinedarg.nif +++ b/tests/nimony/nosystem/tdefinedarg.nif @@ -19,4 +19,5 @@ (true)) 4,6 (glet :z.0.tdej0g1hh1 . . (bool) 15 - (false))) \ No newline at end of file + (false)) 16,2 + (comment untyped.0.tdej0g1hh1)) \ No newline at end of file diff --git a/tests/nimony/nosystem/tdistinct.nif b/tests/nimony/nosystem/tdistinct.nif index 6b30cc267..3d50f8305 100644 --- a/tests/nimony/nosystem/tdistinct.nif +++ b/tests/nimony/nosystem/tdistinct.nif @@ -115,4 +115,5 @@ (ranges typeOfIter.0.tdiuhv8dm) (stmts (ret "typeOfIter")))) - (ret result.1)))) \ No newline at end of file + (ret result.1))) 15,13 + (comment untyped.0.tdiuhv8dm 18 typedesc.0.tdiuhv8dm 1,6 int.0.tdiuhv8dm 1,6 int.0.tdiuhv8dm ~2,6 int.0.tdiuhv8dm 1,7 int.0.tdiuhv8dm 1,7 int.0.tdiuhv8dm ~2,7 int.0.tdiuhv8dm 2,9 int.0.tdiuhv8dm 2,9 int.0.tdiuhv8dm ~2,9 bool.0.tdiuhv8dm 5,13 int.0.tdiuhv8dm ~7,26 int8.0.tdiuhv8dm)) \ No newline at end of file diff --git a/tests/nimony/nosystem/tfib2.nif b/tests/nimony/nosystem/tfib2.nif index 045774bf3..dda713368 100644 --- a/tests/nimony/nosystem/tfib2.nif +++ b/tests/nimony/nosystem/tfib2.nif @@ -113,7 +113,8 @@ (discard 11 (call ~3 fib.1.tfitjdpcx 1 +8)) ,29 (discard 16 - (call ~8 fib.1.tfitjdpcx 1 +8)) 11,28 + (call ~8 fib.1.tfitjdpcx 1 +8)) 16,5 + (comment int.0.tfitjdpcx int.0.tfitjdpcx ~3 int.0.tfitjdpcx ,1 int.0.tfitjdpcx ,1 int.0.tfitjdpcx ~3,1 int.0.tfitjdpcx 1,3 int.0.tfitjdpcx 1,3 int.0.tfitjdpcx ~3,3 bool.0.tfitjdpcx ,5 float.0.tfitjdpcx ,5 float.0.tfitjdpcx ~1,5 float.0.tfitjdpcx ,6 float.0.tfitjdpcx ,6 float.0.tfitjdpcx ~1,6 float.0.tfitjdpcx 1,8 float.0.tfitjdpcx 1,8 float.0.tfitjdpcx ~1,8 bool.0.tfitjdpcx 2,13 bool.0.tfitjdpcx ~4,24 int.0.tfitjdpcx) 11,28 (proc :fib.1.tfitjdpcx . ~11,~6 . (at fib.0.tfitjdpcx (i -1)) 9,~6 diff --git a/tests/nimony/nosystem/tforloop.nif b/tests/nimony/nosystem/tforloop.nif index 0fe010a5e..2dfb8b6a0 100644 --- a/tests/nimony/nosystem/tforloop.nif +++ b/tests/nimony/nosystem/tforloop.nif @@ -62,4 +62,5 @@ (let :mycounter.0 . . 12,~11 (i -1) .)) ~2,1 (stmts - (discard 8 mycounter.0)))) \ No newline at end of file + (discard 8 mycounter.0))) 16,4 + (comment int.0.tfov349y21 int.0.tfov349y21 ~3 int.0.tfov349y21 ,1 int.0.tfov349y21 ,1 int.0.tfov349y21 ~3,1 int.0.tfov349y21 1,3 int.0.tfov349y21 1,3 int.0.tfov349y21 ~3,3 bool.0.tfov349y21 7,5 int.0.tfov349y21 7,5 int.0.tfov349y21 ~3,5 int.0.tfov349y21)) \ No newline at end of file diff --git a/tests/nimony/nosystem/tgeneric_obj.nif b/tests/nimony/nosystem/tgeneric_obj.nif index cdaaa1a0f..966fba042 100644 --- a/tests/nimony/nosystem/tgeneric_obj.nif +++ b/tests/nimony/nosystem/tgeneric_obj.nif @@ -227,7 +227,8 @@ (ranges typeOfIter.0.tge7jvqqk1) (stmts (ret "typeOfIter")))) - (ret result.3))) 3,69 + (ret result.3))) 15,16 + (comment untyped.0.tge7jvqqk1 18 typedesc.0.tge7jvqqk1 1,22 int.0.tge7jvqqk1 1,22 int.0.tge7jvqqk1 ~2,22 int.0.tge7jvqqk1 ~3,27 int.0.tge7jvqqk1 6,27 int.0.tge7jvqqk1 3,52 array.0.tge7jvqqk1 8,55 array.0.tge7jvqqk1 3,55 array.0.tge7jvqqk1 ~4,5 set.0.tge7jvqqk1 ,5 uint8.0.tge7jvqqk1 ~4,6 array.0.tge7jvqqk1 5,6 int.0.tge7jvqqk1 5,16 int.0.tge7jvqqk1 4,17 float.0.tge7jvqqk1 ~3,45 array.0.tge7jvqqk1 9,45 int.0.tge7jvqqk1 ~7,48 array.0.tge7jvqqk1 2,48 int.0.tge7jvqqk1 ~7,49 array.0.tge7jvqqk1 5,49 int.0.tge7jvqqk1) 3,69 (proc :foo.2.tge7jvqqk1 . ~3,~1 . (at foo.1.tge7jvqqk1 13,~47 (rangetype diff --git a/tests/nimony/nosystem/tgenericbinarytree.nif b/tests/nimony/nosystem/tgenericbinarytree.nif index 778884045..3e592c50e 100644 --- a/tests/nimony/nosystem/tgenericbinarytree.nif +++ b/tests/nimony/nosystem/tgenericbinarytree.nif @@ -90,7 +90,8 @@ (glet :a.0.tge70unlm . . 8,~16 (ref 11 NodeObj.0.Itet59r.tge70unlm) 7 (call ~3 foo.1.tge70unlm 1 +123)) 2,20 - (asgn ~2 x.0.tge70unlm 2 a.0.tge70unlm) 11,19 + (asgn ~2 x.0.tge70unlm 2 a.0.tge70unlm) 13,8 + (comment int.0.tge70unlm 1,2 int.0.tge70unlm ,5 int.0.tge70unlm 6,6 int.0.tge70unlm) 11,19 (proc :foo.1.tge70unlm . ~11,~3 . (at foo.0.tge70unlm (i -1)) ,~3 diff --git a/tests/nimony/nosystem/tresemtype.nif b/tests/nimony/nosystem/tresemtype.nif index 3d571fe42..c5116ab71 100644 --- a/tests/nimony/nosystem/tresemtype.nif +++ b/tests/nimony/nosystem/tresemtype.nif @@ -40,7 +40,8 @@ (fld :val.3.treckpe1i1 . . string.0.sysvq0asl .))) 4,2 (gvar :obj.3 . . 6 Foo.3.treckpe1i1 9 (oconstr ~3 Foo.3.treckpe1i1 4 - (kv ~3 val.3.treckpe1i1 ~10,3 "abc")))) 3,5 + (kv ~3 val.3.treckpe1i1 ~10,3 "abc")))) 8,13 + (comment fooTempl.0.treckpe1i1 ,1 fooTempl.0.treckpe1i1) 3,5 (proc :foo.1.treckpe1i1 . ~3,~5 . (at foo.0.treckpe1i1 (i -1)) 8,~5 diff --git a/tests/nimony/nosystem/tsetter.nif b/tests/nimony/nosystem/tsetter.nif index 39d39a93b..938004069 100644 --- a/tests/nimony/nosystem/tsetter.nif +++ b/tests/nimony/nosystem/tsetter.nif @@ -24,4 +24,5 @@ (discard .))) 4,7 (gvar :foo.0.tseyic8ua1 . . 5 Foo.0.tseyic8ua1 .) ,8 (call bar=.0.tseyic8ua1 foo.0.tseyic8ua1 10 +123) ,9 - (call \5B\5D=.0.tseyic8ua1 foo.0.tseyic8ua1 4 +123 11 +456)) \ No newline at end of file + (call \5B\5D=.0.tseyic8ua1 foo.0.tseyic8ua1 4 +123 11 +456) 23,4 + (comment int.0.tseyic8ua1 ~1,1 int.0.tseyic8ua1 7,1 int.0.tseyic8ua1)) \ No newline at end of file diff --git a/tests/nimony/nosystem/ttemplate.nif b/tests/nimony/nosystem/ttemplate.nif index 1576b04c5..fc5975723 100644 --- a/tests/nimony/nosystem/ttemplate.nif +++ b/tests/nimony/nosystem/ttemplate.nif @@ -140,7 +140,8 @@ (ranges typeOfIter.0.tte5tld8n) (stmts (ret "typeOfIter")))) - (ret result.1))) 19,24 + (ret result.1))) 15,14 + (comment untyped.0.tte5tld8n 18 typedesc.0.tte5tld8n 1,16 int.0.tte5tld8n 1,16 int.0.tte5tld8n ~2,16 int.0.tte5tld8n 5,18 int.0.tte5tld8n 5,18 int.0.tte5tld8n ~2,18 int.0.tte5tld8n ~3,20 int.0.tte5tld8n 6,20 int.0.tte5tld8n 5,31 int.0.tte5tld8n 5,10 int.0.tte5tld8n 4,11 float.0.tte5tld8n 8,22 plus.0.tte5tld8n ,22 plus.0.tte5tld8n ~2,34 uint.0.tte5tld8n 3,34 conv.0.tte5tld8n) 19,24 (type :MyGeneric.0.Igj236q.tte5tld8n . (at MyGeneric.0.tte5tld8n 1 (i -1)) ~4,~4 . ~2,~4 diff --git a/tests/nimony/nosystem/tvarargs.nif b/tests/nimony/nosystem/tvarargs.nif index f2639468a..b39eed95a 100644 --- a/tests/nimony/nosystem/tvarargs.nif +++ b/tests/nimony/nosystem/tvarargs.nif @@ -157,4 +157,5 @@ (ranges typeOfIter.0.tvah6culb) (stmts (ret "typeOfIter")))) - (ret result.0)))) \ No newline at end of file + (ret result.0))) 15,11 + (comment untyped.0.tvah6culb 18 typedesc.0.tvah6culb 1,5 int.0.tvah6culb 1,5 int.0.tvah6culb ~2,5 int.0.tvah6culb 1,6 int.0.tvah6culb 1,6 int.0.tvah6culb ~2,6 int.0.tvah6culb 2,8 int.0.tvah6culb 2,8 int.0.tvah6culb ~2,8 bool.0.tvah6culb 12,15 char.0.tvah6culb ~11,20 untyped.0.tvah6culb ~15,29 echo.0.tvah6culb ~15,31 echo.0.tvah6culb ~11,33 echo.0.tvah6culb ~15,35 echo.0.tvah6culb)) \ No newline at end of file diff --git a/tests/nimony/nosystem/twhen.nif b/tests/nimony/nosystem/twhen.nif index feab793c7..c3f3389b7 100644 --- a/tests/nimony/nosystem/twhen.nif +++ b/tests/nimony/nosystem/twhen.nif @@ -21,4 +21,5 @@ (stmts (discard 8 "good")) 2,35 (stmts - (discard 8 "good"))) \ No newline at end of file + (discard 8 "good")) 5,2 + (comment true.0.mwhzgh6nt1 ,5 false.0.mwhzgh6nt1 ,10 isMainModule.0.mwhzgh6nt1 10,25 bool.0.mwhzgh6nt1 6,25 bool.0.mwhzgh6nt1 4,27 true.0.mwhzgh6nt1)) \ No newline at end of file diff --git a/tests/nimony/object/tcaseobject.nif b/tests/nimony/object/tcaseobject.nif index a39c9327f..fd6679767 100644 --- a/tests/nimony/object/tcaseobject.nif +++ b/tests/nimony/object/tcaseobject.nif @@ -287,4 +287,5 @@ (ranges kc.0.tcauiaoif) (stmts (ret "kc")))) - (ret result.1)))) \ No newline at end of file + (ret result.1))) 10,4 + (comment bool.0.sysvq0asl ~5,1 false.0.sysvq0asl ~5,1 false.0.sysvq0asl ~3,2 int.0.sysvq0asl ~5,3 true.0.sysvq0asl ~5,3 true.0.sysvq0asl ~3,5 bool.0.sysvq0asl ,8 bool.0.sysvq0asl ~5,9 false.0.sysvq0asl ~5,9 false.0.sysvq0asl 2,9 true.0.sysvq0asl 2,9 true.0.sysvq0asl 3,11 default.1.sysvq0asl 3,11 default.3.sysvq0asl 3,12 false.0.sysvq0asl ~3,13 bool.0.sysvq0asl 2,14 false.0.sysvq0asl ~10,14 assert.0.assy765wm ~3,15 int.0.sysvq0asl ~10,16 assert.0.assy765wm 3,17 true.0.sysvq0asl 22,17 false.0.sysvq0asl 6,18 true.0.sysvq0asl ~10,18 assert.0.assy765wm ~10,20 assert.0.assy765wm ~3,21 bool.0.sysvq0asl 2,22 false.0.sysvq0asl ~10,22 assert.0.assy765wm 3,24 default.1.sysvq0asl 3,25 false.0.sysvq0asl 6,26 false.0.sysvq0asl ~10,26 assert.0.assy765wm 3,27 true.0.sysvq0asl ~3,28 bool.0.sysvq0asl 2,29 true.0.sysvq0asl ~10,29 assert.0.assy765wm 7,32 true.0.sysvq0asl ~10,32 assert.0.assy765wm 7,39 true.0.sysvq0asl 26,39 false.0.sysvq0asl 1,48 int.0.sysvq0asl 1,49 int.0.sysvq0asl 8,51 float.0.sysvq0asl 8,51 float.0.sysvq0asl ~1,59 echo.0.syn1lfpjv)) \ No newline at end of file diff --git a/tests/nimony/overload/tnamedparams.nif b/tests/nimony/overload/tnamedparams.nif index c974554fa..e2880f35d 100644 --- a/tests/nimony/overload/tnamedparams.nif +++ b/tests/nimony/overload/tnamedparams.nif @@ -21,4 +21,5 @@ (call ~6 callme.0.tna1v8dmd 16 +0 11 +1 29,~4 "" 3 '\09' 52,~4 (false)) ,5 (cmd callme.0.tna1v8dmd 7 +0 10 +1 13 "abc" 20 '\09' 58,~5 - (false))) \ No newline at end of file + (false)) 18 + (comment int.0.sysvq0asl int.0.sysvq0asl 24 char.0.sysvq0asl 33 bool.0.sysvq0asl 40 false.0.sysvq0asl 8,2 true.0.sysvq0asl)) \ No newline at end of file diff --git a/tests/nimony/pragmas/tcustompragma.nif b/tests/nimony/pragmas/tcustompragma.nif index d24baba87..5445d4da9 100644 --- a/tests/nimony/pragmas/tcustompragma.nif +++ b/tests/nimony/pragmas/tcustompragma.nif @@ -19,4 +19,5 @@ (i -1) .) (discard .) ~35 (ret result.0))) 3,4 - (call ~3 foo.0.tcui0hn981)) \ No newline at end of file + (call ~3 foo.0.tcui0hn981) 4,2 + (comment int.0.sysvq0asl)) \ No newline at end of file diff --git a/tests/nimony/pragmas/tpushpop.nif b/tests/nimony/pragmas/tpushpop.nif index caf28898c..a900b51bb 100644 --- a/tests/nimony/pragmas/tpushpop.nif +++ b/tests/nimony/pragmas/tpushpop.nif @@ -96,7 +96,8 @@ (pragmas 2 (importc 9 "putchar") 22 (header 8 "") 43 - (noconv)) . .) 19,19 + (noconv)) . .) 8,15 + (comment int.0.sysvq0asl 4,7 int.0.sysvq0asl 2,7 int.0.sysvq0asl 36,1 int.0.sysvq0asl ~8,4 assert.0.assy765wm) 19,19 (proc :c_fpclassify.1.tpu1210461 . ~19,~4 . (at c_fpclassify.0.tpu1210461 (f +64)) 12,~4 diff --git a/tests/nimony/sets/tsets.nif b/tests/nimony/sets/tsets.nif index a59417c98..20114ce48 100644 --- a/tests/nimony/sets/tsets.nif +++ b/tests/nimony/sets/tsets.nif @@ -351,4 +351,5 @@ (ranges F.0.tseflljd71) (stmts (ret "F")))) - (ret result.1)))) \ No newline at end of file + (ret result.1))) 11,5 + (comment set.0.sysvq0asl set.0.sysvq0asl ~11,3 assert.0.assy765wm ~4,5 set.0.sysvq0asl ~11,6 assert.0.assy765wm ~11,7 assert.0.assy765wm ~11,8 assert.0.assy765wm ~11,9 assert.0.assy765wm ~11,10 assert.0.assy765wm ~11,11 assert.0.assy765wm ~11,14 assert.0.assy765wm ~6,20 resem.0.tseflljd71 ,22 set.0.sysvq0asl 4,22 char.0.sysvq0asl ~9,24 assert.0.assy765wm ~9,26 assert.0.assy765wm ~9,28 assert.0.assy765wm ~9,30 assert.0.assy765wm ~7,38 char.0.sysvq0asl ~2,39 set.0.sysvq0asl 2,39 char.0.sysvq0asl ~9,42 assert.0.assy765wm)) \ No newline at end of file diff --git a/tests/nimony/sysbasics/tbasics.nif b/tests/nimony/sysbasics/tbasics.nif index 7dd293cc0..bbb29696d 100644 --- a/tests/nimony/sysbasics/tbasics.nif +++ b/tests/nimony/sysbasics/tbasics.nif @@ -323,4 +323,5 @@ (stmts (cmd write.0.syn1lfpjv 6 stdout.0.syn1lfpjv 35,3,lib/std/assertions.nim "")) ,2 (cmd write.5.syn1lfpjv 6 stdout.0.syn1lfpjv 14 '\0A')) ,1 - (cmd quit.0.syn1lfpjv 5 +1)))))) \ No newline at end of file + (cmd quit.0.syn1lfpjv 5 +1))))) 10,3 + (comment array.0.sysvq0asl 9 int.0.sysvq0asl 3,12 int.0.sysvq0asl 3,21 pointer.0.sysvq0asl 9,35 int.0.sysvq0asl 9,35 int.0.sysvq0asl 9,35 int.0.sysvq0asl 9,35 int.0.sysvq0asl 9,35 int.0.sysvq0asl ~1,7 array.0.sysvq0asl 8,7 int.0.sysvq0asl 10,23 int.0.sysvq0asl 6,30 pointer.0.sysvq0asl 5,41 default.3.sysvq0asl 5,41 default.3.sysvq0asl 5,41 default.3.sysvq0asl 5,41 default.3.sysvq0asl 5,41 default.3.sysvq0asl ,53 int.0.sysvq0asl 5,53 int.0.sysvq0asl ~8,73 echo.0.syn1lfpjv ~6,80 echo.0.syn1lfpjv ~4,85 echo.0.syn1lfpjv ~6,91 echo.0.syn1lfpjv ~6,97 echo.0.syn1lfpjv ~4,104 echo.0.syn1lfpjv ~6,110 echo.0.syn1lfpjv ~10,119 assert.0.assy765wm)) \ No newline at end of file diff --git a/tests/nimony/sysbasics/tdefaultparams.nif b/tests/nimony/sysbasics/tdefaultparams.nif index d21e04c29..62948c6dc 100644 --- a/tests/nimony/sysbasics/tdefaultparams.nif +++ b/tests/nimony/sysbasics/tdefaultparams.nif @@ -82,7 +82,8 @@ (call ~4 foo5.1.tdebp8hax 1 +1.3 24,~20 +7) 4,34 (call ~4 foo6.1.tdebp8hax 1 +4 28,~18 +7) 9,35 (call ~9 foo6.1.tdebp8hax 11,~19 +3 23,~19 +7) 4,36 - (call ~4 foo6.1.tdebp8hax 16,~20 +3 28,~20 +7) 3,23 + (call ~4 foo6.1.tdebp8hax 16,~20 +3 28,~20 +7) 13 + (comment int.0.sysvq0asl 8 float.0.sysvq0asl ,7 int.0.sysvq0asl 8,7 float.0.sysvq0asl 18,7 int.0.sysvq0asl ,10 int.0.sysvq0asl 8,10 float.0.sysvq0asl 18,10 int.0.sysvq0asl 31,10 float.0.sysvq0asl 9,13 int.0.sysvq0asl 13,16 int.0.sysvq0asl ~8,35 int.0.sysvq0asl) 3,23 (proc :foo.1.tdebp8hax . ~3,~4 . (at foo.0.tdebp8hax (i -1)) 8,~4 diff --git a/tests/nimony/sysbasics/tderefs2.nif b/tests/nimony/sysbasics/tderefs2.nif index 2932831cd..9dc9d5b3c 100644 --- a/tests/nimony/sysbasics/tderefs2.nif +++ b/tests/nimony/sysbasics/tderefs2.nif @@ -132,7 +132,8 @@ (hderef (call ~3 g41.1.tdexr7cz81 1 (haddr s2.0)))))) 5,41 - (call ~5 foo11.0.tdexr7cz81 1 +12) 14,38 + (call ~5 foo11.0.tdexr7cz81 1 +12) 14 + (comment int.0.sysvq0asl 4 int.0.sysvq0asl 1,10 int.0.sysvq0asl 4,10 int.0.sysvq0asl 1,13 int.0.sysvq0asl 4,13 int.0.sysvq0asl ~1,16 int.0.sysvq0asl 2,24 int.0.sysvq0asl ,24 int.0.sysvq0asl ,35 int.0.sysvq0asl) 14,38 (proc :g31.1.tdexr7cz81 . ~14,~9 . (at g31.0.tdexr7cz81 ,~3 (i -1)) ~3,~9 diff --git a/tests/nimony/sysbasics/temptyseq.nif b/tests/nimony/sysbasics/temptyseq.nif index 0e54d8514..a798e461a 100644 --- a/tests/nimony/sysbasics/temptyseq.nif +++ b/tests/nimony/sysbasics/temptyseq.nif @@ -22,7 +22,8 @@ (call ~15 newSeqUninit.1.temd2l7vy 1 +0))) 4,8 (gvar :s.0.temd2l7vy . . 6 seq.0.Iq4ofkp1.temd2l7vy 43,162,lib/std/system/seqimpl.nim (expr 15 - (call ~15 newSeqUninit.2.temd2l7vy 1 +0))) 58,162,lib/std/system/seqimpl.nim + (call ~15 newSeqUninit.2.temd2l7vy 1 +0))) 16 + (comment int.0.sysvq0asl ~12,2 @.1.sysvq0asl ~6,6 @.1.sysvq0asl ~5,8 uint8.0.sysvq0asl 4,8 @.1.sysvq0asl) 58,162,lib/std/system/seqimpl.nim (proc :newSeqUninit.0.temd2l7vy . ~58,~102 . (at newSeqUninit.0.sysvq0asl 16,1,tests/nimony/sysbasics/temptyseq.nim (i -1)) ~37,~102 diff --git a/tests/nimony/sysbasics/thooks.nif b/tests/nimony/sysbasics/thooks.nif index d29ca1d60..ce3fdbf21 100644 --- a/tests/nimony/sysbasics/thooks.nif +++ b/tests/nimony/sysbasics/thooks.nif @@ -136,7 +136,8 @@ (stmts (discard .))) 4,52 (gvar :obj.0.tho8gh7q4 . . 13 MyObject.0.I76zger.tho8gh7q4 .) 12,53 - (call 1 =checkHook.1.tho8gh7q4 1 obj.0.tho8gh7q4) 12,53 + (call 1 =checkHook.1.tho8gh7q4 1 obj.0.tho8gh7q4) 10,2 + (comment int.0.sysvq0asl int.0.sysvq0asl ,3 int.0.sysvq0asl ,3 int.0.sysvq0asl 28,5 pointer.0.sysvq0asl 19,34 int.0.sysvq0asl 24,34 float.0.sysvq0asl 10,34 default.3.sysvq0asl 10,34 default.3.sysvq0asl 20,36 float.0.sysvq0asl 27,36 int.0.sysvq0asl 11,36 default.3.sysvq0asl 11,36 default.3.sysvq0asl 14,40 default.3.sysvq0asl 14,40 default.3.sysvq0asl 15,41 default.3.sysvq0asl 15,41 default.3.sysvq0asl 8,50 int.0.sysvq0asl 13,50 float.0.sysvq0asl) 12,53 (proc :=checkHook.1.tho8gh7q4 . ~12,~4 . (at =checkHook.0.tho8gh7q4 17,~17 (i -1) 22,~17 diff --git a/tests/nimony/sysbasics/tintlitmatch.nif b/tests/nimony/sysbasics/tintlitmatch.nif index a45786629..e68d2d5cf 100644 --- a/tests/nimony/sysbasics/tintlitmatch.nif +++ b/tests/nimony/sysbasics/tintlitmatch.nif @@ -86,4 +86,5 @@ (eq (i +32) ~2 x.0.tin4pj0od1 3 (hconv 17,68,lib/std/system/comparisons.nim - (i +32) +123)))) \ No newline at end of file + (i +32) +123))) 12 + (comment int16.0.sysvq0asl ,1 float.0.sysvq0asl ,4 int16.0.sysvq0asl ,5 int.0.sysvq0asl ~5,9 int32.0.sysvq0asl ~5,10 int.0.sysvq0asl 5,14 int32.0.sysvq0asl ,15 int32.0.sysvq0asl ,16 int.0.sysvq0asl 11,16 int.0.sysvq0asl ,17 int32.0.sysvq0asl 13,17 int32.0.sysvq0asl ,20 int32.0.sysvq0asl 7,21 int32.0.sysvq0asl)) \ No newline at end of file diff --git a/tests/nimony/sysbasics/trefobject.nif b/tests/nimony/sysbasics/trefobject.nif index f590d19f5..7072a55f7 100644 --- a/tests/nimony/sysbasics/trefobject.nif +++ b/tests/nimony/sysbasics/trefobject.nif @@ -74,7 +74,8 @@ (ref 4 (at ForwardNode2.Obj.0.tre8amq6m 6,2 T.6.tre8amq6m)) .))) 4,29 (gvar :forwardNode2.0.tre8amq6m . . 16,~4 - (ref 4 ForwardNode2.Obj.0.Ikl0rjv.tre8amq6m) .) 19,24 + (ref 4 ForwardNode2.Obj.0.Ikl0rjv.tre8amq6m) .) 5,1 + (comment int.0.sysvq0asl 15,23 int.0.sysvq0asl 10,10 int.0.sysvq0asl 26,19 int.0.sysvq0asl 26,28 int.0.sysvq0asl) 19,24 (type :ForwardNode2.0.Ishmn651.tre8amq6m . (at ForwardNode2.0.tre8amq6m 1 (i -1)) ~1,1 . 1,1 diff --git a/tests/nimony/sysbasics/tresultnoinit.nif b/tests/nimony/sysbasics/tresultnoinit.nif index 927368340..21dd76a13 100644 --- a/tests/nimony/sysbasics/tresultnoinit.nif +++ b/tests/nimony/sysbasics/tresultnoinit.nif @@ -11,4 +11,5 @@ (noinit)) ~25 (i -1) .) (discard .) ~29 - (ret result.0)))) \ No newline at end of file + (ret result.0))) 4 + (comment int.0.sysvq0asl)) \ No newline at end of file diff --git a/tests/nimony/sysbasics/ttabconstr.nif b/tests/nimony/sysbasics/ttabconstr.nif index bfe97aefc..0369fabb1 100644 --- a/tests/nimony/sysbasics/ttabconstr.nif +++ b/tests/nimony/sysbasics/ttabconstr.nif @@ -113,4 +113,5 @@ (tupconstr ~25,~2 (tuple (i -1) - (i -1)) 1 +6 4 +7))))) \ No newline at end of file + (i -1)) 1 +6 4 +7)))) 21 + (comment array.0.sysvq0asl 9 int.0.sysvq0asl 1,1 array.0.sysvq0asl 11,1 int.0.sysvq0asl 16,1 int.0.sysvq0asl 1,2 array.0.sysvq0asl 19,2 int.0.sysvq0asl 1,3 array.0.sysvq0asl 11,3 int.0.sysvq0asl 17,3 int.0.sysvq0asl 22,3 int.0.sysvq0asl)) \ No newline at end of file diff --git a/tests/nimony/types/tscopedtype.nif b/tests/nimony/types/tscopedtype.nif index 04dc0f9bb..1b2ce7be1 100644 --- a/tests/nimony/types/tscopedtype.nif +++ b/tests/nimony/types/tscopedtype.nif @@ -17,4 +17,5 @@ (stmts (cmd write.2.syn1lfpjv 6 stdout.0.syn1lfpjv 8,9,tests/nimony/types/tscopedtype.nim (ddot ~1 s.0 id.0.tsca4az8i1 +0))) ,2 - (cmd write.5.syn1lfpjv 6 stdout.0.syn1lfpjv 14 '\0A'))))) \ No newline at end of file + (cmd write.5.syn1lfpjv 6 stdout.0.syn1lfpjv 14 '\0A')))) 10,5 + (comment int.0.sysvq0asl ~8,3 echo.0.syn1lfpjv)) \ No newline at end of file diff --git a/tests/nimony/when/twhenobject.nif b/tests/nimony/when/twhenobject.nif index c9c865c7e..93aa95e56 100644 --- a/tests/nimony/when/twhenobject.nif +++ b/tests/nimony/when/twhenobject.nif @@ -6,4 +6,5 @@ (i -1) .) ~4,5 (fld :z.0.twh699we9 . . 3 (i -1) .) ~2,7 - (fld :a.0.twh699we9 . . 3 string.0.sysvq0asl .)))) \ No newline at end of file + (fld :a.0.twh699we9 . . 3 string.0.sysvq0asl .))) 9,5 + (comment int.0.sysvq0asl ~2,1 int.0.sysvq0asl)) \ No newline at end of file