summary refs log tree commit diff stats
path: root/lib/system/repr_v2.nim
diff options
context:
space:
mode:
authorTimothee Cour <timothee.cour2@gmail.com>2021-08-19 02:33:52 -0700
committerGitHub <noreply@github.com>2021-08-19 11:33:52 +0200
commit394f4ac7bb92fe5aaf902495c6b43b3451667602 (patch)
tree8957f2337957a2c28d152490d07be106b1dd2994 /lib/system/repr_v2.nim
parent7b58dc2de0f606b757a558dfdda9d930ae63f41a (diff)
downloadNim-394f4ac7bb92fe5aaf902495c6b43b3451667602.tar.gz
improvements to `addInt` and `$` for integer types (#18592)
* 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
Diffstat (limited to 'lib/system/repr_v2.nim')
-rw-r--r--lib/system/repr_v2.nim17
1 files changed, 8 insertions, 9 deletions
diff --git a/lib/system/repr_v2.nim b/lib/system/repr_v2.nim
index ba94b881d..6ab5f3c3f 100644
--- a/lib/system/repr_v2.nim
+++ b/lib/system/repr_v2.nim
@@ -8,18 +8,17 @@ proc distinctBase(T: typedesc, recursive: static bool = true): typedesc {.magic:
 
 proc repr*(x: NimNode): string {.magic: "Repr", noSideEffect.}
 
-proc repr*(x: int): string {.magic: "IntToStr", noSideEffect.}
-  ## repr for an integer argument. Returns `x`
-  ## converted to a decimal string.
+proc repr*(x: int): string =
+  ## Same as $x
+  $x
 
-proc repr*(x: int64): string {.magic: "Int64ToStr", noSideEffect.}
-  ## repr for an integer argument. Returns `x`
-  ## converted to a decimal string.
+proc repr*(x: int64): string =
+  ## Same as $x
+  $x
 
 proc repr*(x: uint64): string {.noSideEffect.} =
-  ## repr for an unsigned integer argument. Returns `x`
-  ## converted to a decimal string.
-  $x #Calls `$` from system/strmantle.nim
+  ## Same as $x
+  $x
 
 proc repr*(x: float): string =
   ## Same as $x