move system.dollars in a separate file (#10829)

This commit is contained in:
Miran 2019-03-13 15:59:09 +01:00 • committed by Andreas Rumpf
commit 84d3f3d448
9 changed files with 223 additions and 212 deletions

View file

@ -1,8 +1,20 @@
include "system/helpers"
when not declared(sysFatal):
include "system/fatal"
# ---------------------------------------------------------------------------
# helpers
type InstantiationInfo = tuple[filename: string, line: int, column: int]
proc `$`(x: int): string {.magic: "IntToStr", noSideEffect.}
proc `$`(info: InstantiationInfo): string =
# The +1 is needed here
# instead of overriding `$` (and changing its meaning), consider explicit name.
info.fileName & "(" & $info.line & ", " & $(info.column+1) & ")"
# ---------------------------------------------------------------------------
proc raiseAssert*(msg: string) {.noinline, noReturn.} =
sysFatal(AssertionError, msg)