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:
ringabout 2022-08-24 19:38:30 +08:00 • committed by GitHub
commit b6bfe38ff5
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
23 changed files with 201 additions and 176 deletions

View file

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

View file

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

View file

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

View file

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

View file

@ -61,7 +61,7 @@ import
from pathutils import AbsoluteFile
when defined(nimPreviewSlimSystem):
import std/[assertions, syncio]
import std/[assertions, syncio, formatfloat]
type

View file

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

View file

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

View file

@ -14,7 +14,7 @@ import
lineinfos, int128, modulegraphs, astmsgs
when defined(nimPreviewSlimSystem):
import std/assertions
import std/[assertions, formatfloat]
type
TPreferedDesc* = enum

View file

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

View file

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

View file

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