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
This commit is contained in:
Timothee Cour 2021-08-19 02:33:52 -07:00 • committed by GitHub
commit 394f4ac7bb
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
12 changed files with 162 additions and 186 deletions

View file

@ -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