* compiler/vmhooks: add getVar to allow vmops with var params * addFloat vmops with var param * cgen now renders float32 literals in c backend using roundtrip float to string
This commit is contained in:
parent
a8b3e7c059
commit
cf0cf32d27
21 changed files with 286 additions and 199 deletions
|
|
@ -1,5 +1,6 @@
|
|||
import std/private/digitsutils
|
||||
|
||||
import system/formatfloat
|
||||
export addFloat
|
||||
|
||||
proc `$`*(x: int): string {.magic: "IntToStr", noSideEffect.}
|
||||
## The stringify operator for an integer argument. Returns `x`
|
||||
|
|
@ -40,13 +41,9 @@ proc `$`*(x: int64): string {.magic: "Int64ToStr", noSideEffect.}
|
|||
## The stringify operator for an integer argument. Returns `x`
|
||||
## converted to a decimal string.
|
||||
|
||||
proc `$`*(x: float): string {.magic: "FloatToStr", noSideEffect.}
|
||||
## The stringify operator for a float argument. Returns `x`
|
||||
## converted to a decimal string.
|
||||
|
||||
proc `$`*(x: float32): string {.magic: "FloatToStr", noSideEffect.}
|
||||
## The stringify operator for a float32 argument. Returns `x`
|
||||
## converted to a decimal string.
|
||||
func `$`*(x: float | float32): string =
|
||||
## Outplace version of `addFloat`.
|
||||
result.addFloat(x)
|
||||
|
||||
proc `$`*(x: bool): string {.magic: "BoolToStr", noSideEffect.}
|
||||
## The stringify operator for a boolean argument. Returns `x`
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue