Files
Nim/lib/system/helpers.nim
alaviss 5499ec084c fix system.nim documentations (#10168)
* system: fix nimGC_getStackBottom doc
* system/helpers: avoid leaking docs to system

(cherry picked from commit be0a4d1342)
2019-01-09 11:02:43 +01:00

12 lines
447 B
Nim

# helpers used system.nim and other modules, avoids code duplication while
# also minimizing symbols exposed in system.nim
#
# TODO: move other things here that should not be exposed in system.nim
proc lineInfoToString(file: string, line, column: int): string =
file & "(" & $line & ", " & $column & ")"
proc `$`(info: type(instantiationInfo(0))): string =
# The +1 is needed here
lineInfoToString(info.fileName, info.line, info.column+1)