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:
parent
7b58dc2de0
commit
394f4ac7bb
12 changed files with 162 additions and 186 deletions
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue