move formatfloat out of system (#20195)
* move formatfloat out of system * fixes doc * Update changelog.md * careless * fixes * deprecate system/formatfloat * better handling
This commit is contained in:
parent
12f23d5ae8
commit
b6bfe38ff5
23 changed files with 201 additions and 176 deletions
|
|
@ -15,7 +15,7 @@ import ".." / [ast, idents, lineinfos, msgs, ropes, options,
|
|||
from os import removeFile, isAbsolute
|
||||
|
||||
when defined(nimPreviewSlimSystem):
|
||||
import std/[syncio, assertions]
|
||||
import std/[syncio, assertions, formatfloat]
|
||||
|
||||
type
|
||||
PackedConfig* = object
|
||||
|
|
|
|||
|
|
@ -20,7 +20,7 @@ import
|
|||
wordrecg, lineinfos, pathutils, parseutils
|
||||
|
||||
when defined(nimPreviewSlimSystem):
|
||||
import std/assertions
|
||||
import std/[assertions, formatfloat]
|
||||
|
||||
const
|
||||
MaxLineLength* = 80 # lines longer than this lead to a warning
|
||||
|
|
|
|||
|
|
@ -18,7 +18,7 @@ import
|
|||
lexer, options, idents, strutils, ast, msgs, lineinfos
|
||||
|
||||
when defined(nimPreviewSlimSystem):
|
||||
import std/[syncio, assertions]
|
||||
import std/[syncio, assertions, formatfloat]
|
||||
|
||||
type
|
||||
TRenderFlag* = enum
|
||||
|
|
|
|||
|
|
@ -42,7 +42,7 @@ when not declared(signbit):
|
|||
proc signbit*(x: SomeFloat): bool {.inline.} =
|
||||
result = c_signbit(x) != 0
|
||||
|
||||
import system/formatfloat
|
||||
import std/formatfloat
|
||||
|
||||
proc toStrMaxPrecision*(f: BiggestFloat | float32): string =
|
||||
const literalPostfix = when f is float32: "f" else: ""
|
||||
|
|
|
|||
|
|
@ -61,7 +61,7 @@ import
|
|||
from pathutils import AbsoluteFile
|
||||
|
||||
when defined(nimPreviewSlimSystem):
|
||||
import std/[assertions, syncio]
|
||||
import std/[assertions, syncio, formatfloat]
|
||||
|
||||
|
||||
type
|
||||
|
|
|
|||
|
|
@ -25,6 +25,9 @@ when defined(nimfix):
|
|||
when not defined(leanCompiler):
|
||||
import spawn
|
||||
|
||||
when defined(nimPreviewSlimSystem):
|
||||
import std/formatfloat
|
||||
|
||||
# implementation
|
||||
|
||||
proc semExpr(c: PContext, n: PNode, flags: TExprFlags = {}, expectedType: PType = nil): PNode
|
||||
|
|
|
|||
|
|
@ -18,7 +18,7 @@ import
|
|||
from system/memory import nimCStrLen
|
||||
|
||||
when defined(nimPreviewSlimSystem):
|
||||
import std/assertions
|
||||
import std/[assertions, formatfloat]
|
||||
|
||||
proc errorType*(g: ModuleGraph): PType =
|
||||
## creates a type representing an error state
|
||||
|
|
|
|||
|
|
@ -14,7 +14,7 @@ import
|
|||
lineinfos, int128, modulegraphs, astmsgs
|
||||
|
||||
when defined(nimPreviewSlimSystem):
|
||||
import std/assertions
|
||||
import std/[assertions, formatfloat]
|
||||
|
||||
type
|
||||
TPreferedDesc* = enum
|
||||
|
|
|
|||
|
|
@ -18,6 +18,9 @@ import
|
|||
gorgeimpl, lineinfos, btrees, macrocacheimpl,
|
||||
modulegraphs, sighashes, int128, vmprofiler
|
||||
|
||||
when defined(nimPreviewSlimSystem):
|
||||
import std/formatfloat
|
||||
|
||||
import ast except getstr
|
||||
from semfold import leValueConv, ordinalValToString
|
||||
from evaltempl import evalTemplate
|
||||
|
|
|
|||
|
|
@ -13,7 +13,7 @@ import streams, json, intsets, tables, ast, astalgo, idents, types, msgs,
|
|||
options, lineinfos
|
||||
|
||||
when defined(nimPreviewSlimSystem):
|
||||
import std/assertions
|
||||
import std/[assertions, formatfloat]
|
||||
|
||||
proc ptrToInt(x: PNode): int {.inline.} =
|
||||
result = cast[int](x) # don't skip alignment
|
||||
|
|
|
|||
|
|
@ -28,12 +28,12 @@ from std/os import getEnv, existsEnv, delEnv, putEnv, envPairs,
|
|||
from std/times import cpuTime
|
||||
from std/hashes import hash
|
||||
from std/osproc import nil
|
||||
from system/formatfloat import addFloatRoundtrip, addFloatSprintf
|
||||
|
||||
|
||||
when defined(nimPreviewSlimSystem):
|
||||
import std/syncio
|
||||
|
||||
else:
|
||||
from std/formatfloat import addFloatRoundtrip, addFloatSprintf
|
||||
|
||||
# There are some useful procs in vmconv.
|
||||
import vmconv, vmmarshal
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue