move system.dollars in a separate file (#10829)
This commit is contained in:
parent
b270917de1
commit
84d3f3d448
9 changed files with 223 additions and 212 deletions
|
|
@ -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)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue