mirror of
https://github.com/nim-lang/Nim.git
synced 2025-12-30 18:02:05 +00:00
* improvements to $(SomeInteger) and addInt * remove mIntToStr, mInt64ToStr * improvements * fix tests/pragmas/tinjectstmt.nim; the diff is harmless, cgen code is identical with -d:danger or debug mode * rm tests/system/tstrmantle.nim * revert compiler/jsgen.nim for -d:nimVersion140
15 lines
446 B
Nim
15 lines
446 B
Nim
from std/private/digitsutils import addInt
|
|
|
|
template toLocation*(result: var string, file: string | cstring, line: int, col: int) =
|
|
## avoids spurious allocations
|
|
# Hopefully this can be re-used everywhere so that if a user needs to customize,
|
|
# it can be done in a single place.
|
|
result.add file
|
|
if line > 0:
|
|
result.add "("
|
|
addInt(result, line)
|
|
if col > 0:
|
|
result.add ", "
|
|
addInt(result, col)
|
|
result.add ")"
|