Commit Graph

127 Commits

Author SHA1 Message Date
flywind
60ec3e2417 add warnings to std/sysrand (#17191)
* remove unnecessary when statement

* remove outdated codes

* add warnings to std/sysrand

* Update lib/std/sysrand.nim

Co-authored-by: konsumlamm <44230978+konsumlamm@users.noreply.github.com>

Co-authored-by: Timothee Cour <timothee.cour2@gmail.com>
Co-authored-by: konsumlamm <44230978+konsumlamm@users.noreply.github.com>
2021-02-26 20:06:20 +01:00
flywind
dcd3f26876 clean up wrapnils 2021-02-25 17:52:58 +08:00
Timothee Cour
bea037f856 refs #17114: workaround for arm64 which should segfault but does not (#17178)
* refs #17114: workaround for arm64 which should segfault but does not
* fixup
* Update lib/std/wrapnils.nim

Co-authored-by: Andreas Rumpf <rumpf_a@web.de>
2021-02-25 08:40:43 +01:00
Timothee Cour
8942586fa6 wrapnils: add ??. which returns an Option (#16931)
* wrapnils: add option-like API with ??., isSome, get
* fix test after rebase
* cleanups
* fix changelog
* address comments regarding get vs unsafeGet
2021-02-24 14:02:32 +01:00
flywind
3f38f8fbb7 add strbasics.strip (#16280) 2021-02-24 10:22:47 +01:00
Timothee Cour
c274e67198 add enumutils.items for sparse enums, typetraits.SomeSparseEnum (#17080)
* add enumutils.items for enum with holes
* changelog
* ref in lib.rst
* use `type SomeSparseEnum* = (not Ordinal) and enum` instead of concept
* address comment: rename back to enum with holes
2021-02-23 20:25:35 +01:00
Timothee Cour
ce7caec4b3 add io.readChars overload (simpler, less error prone) (#16044)
* add simpler to use readChars overload

* use new readChars overload

* Update lib/wrappers/openssl.nim

Co-authored-by: Andreas Rumpf <rumpf_a@web.de>
Co-authored-by: flywind <xzsflywind@gmail.com>
2021-02-22 20:13:08 +01:00
flywind
f07a072691 [JS + docs] improve std/monotimes module (#17103) 2021-02-22 11:09:25 +01:00
flywind
4556901572 use single backtick (#17141) 2021-02-21 19:53:28 -08:00
Timothee Cour
6b3bdd798d enable bsd for tsetutils; improve setutils API (#17098) 2021-02-20 18:02:57 +01:00
Jason Beetham
35ded02074 Add setutils.complement, setutils.fullSet (#17066) 2021-02-18 17:33:28 -08:00
Timothee Cour
f455e03028 fix #17078 csources generation (#17079)
* fix #17078 csources generation

* fixup
2021-02-18 07:00:51 +01:00
Timothee Cour
31bb67a309 add -d:nimStrictMode in CI to keep code from regressing; fixes ConvFromXtoItselfNotNeeded, UnusedImport notes (#16764) 2021-02-17 19:30:09 +01:00
flywind
4f118721be make system random work in VM (#17059)
* make system random work in VM
2021-02-17 11:52:46 +01:00
Timothee Cour
b187caeb87 document since (#17048)
* document `since`
* address comment
2021-02-16 20:20:01 +01:00
flywind
240879bf3d array literals uses typed arrays; fix a jsgen bug (#16850)
* array litterals uses typed arrays
* Update compiler/jsgen.nim

Co-authored-by: Timothee Cour <timothee.cour2@gmail.com>
Co-authored-by: Andreas Rumpf <rumpf_a@web.de>
2021-02-15 11:28:11 +01:00
konsumlamm
4886f8a02d Small update for packedsets (#17037)
Rename PTrunk to Trunk
Use ord instead of cast[int]
2021-02-15 09:57:32 +01:00
Timothee Cour
4326f743d0 compilesettings: add libpath (#16997)
* compilesettings: add libpath

* add test

* changelog

* fixup

Co-authored-by: Andreas Rumpf <rumpf_a@web.de>
2021-02-12 23:50:41 +01:00
flywind
18c24eb4d0 add system random to stdlib: std/sysrand (#16459) 2021-02-11 16:00:01 -08:00
Timothee Cour
f3e4c4d6e1 std/wrapnils does not use experimental:dotOperators anymore (#16996) 2021-02-10 18:50:50 +01:00
konsumlamm
cee58ccf7f Improve documentation for std/sha1 (#16970) 2021-02-09 15:14:03 +01:00
flywind
d447c0fe3f use typeof instead type (#16962) 2021-02-08 09:46:07 +01:00
Timothee Cour
ae9ba260f6 clarify docs for wrapnils (#16929)
Co-authored-by: Dominik Picheta <dominikpicheta@googlemail.com>
2021-02-04 15:39:19 -08:00
n5m
f87b9866af link compile-time options together in docs (#16879)
* link similar compiler option proc together

* fixup links

* fix formatting and links

* example formatting

* drop declared

* link to compilesettings

* only link define pragmas once

* drop another declared

* backlink to compileOptions from compilesettings

* remove newline
2021-02-02 09:44:21 +01:00
flywind
a2855b66ae JS: make hash float support IE/Safari (#16872) 2021-02-01 13:19:25 +01:00
flywind
111092e8aa refactor hash in JS backend (#16863) 2021-01-30 14:14:38 +01:00
Juan Carlos
b8e8eaae66 BigInt runnableExamples: octal, binary, hex constructor (#16868)
Co-authored-by: Timothee Cour <timothee.cour2@gmail.com>
2021-01-29 17:48:47 -08:00
flywind
296cf9657c add lost functions (#16843) 2021-01-29 15:14:19 +01:00
Timothee Cour
6e267d28b3 remove conditionals on nimHasUserErrors, nimNoNilSeqs2, nimNoNilSeqs (#16861)
* cleanup docs for type(nil) | type(nil); simplify nimHasUserErrors

* simplify nimNoNilSeqs2

* simplify nimNoNilSeqs

* fixup
2021-01-29 14:30:24 +01:00
Timothee Cour
478d15f7f4 improve code in categories.nim; add std/private/gitutils; fix flakyness in nim CI (cloneDependency in deps.nim) (#16856)
* improve code in categories.nim; gitutils; fix flakyness in deps.nim
* cleanups
2021-01-29 07:51:12 +01:00
konsumlamm
8395abab5f Small changes to std/sums (#16797) 2021-01-25 12:15:36 +01:00
flywind
8d3e0c7b9b make oids module better (#16704)
* make oids modules better

* Update lib/pure/oids.nim

* fix
2021-01-25 07:39:25 +01:00
konsumlamm
72bbd07ec1 Add std/setutils to lib.rst (#16791)
* Add std/setutils to lib.rst

Improve doc comments for setutils

* Adhere to the RST spec

Use no UFCS in toSet
2021-01-22 13:13:18 +01:00
flywind
a0fddfecd4 perpare for more compact bit operations in JS (#16728) 2021-01-19 14:57:16 +01:00
Timothee Cour
6c07b0a1f8 jsonutils.jsonTo: support opt (#16739) 2021-01-17 11:37:06 +01:00
konsumlamm
44ceefa9fe Improve documentation for packedsets (#16715)
* Improve documentation for packedsets

Add more runnableExamples
Add deprecated pragma to intsets
Replace intsets with packedsets in lib.rst

* Apply suggested changes
2021-01-16 16:09:53 +01:00
Timothee Cour
18e14f5920 js: improve tests + some docs (#16727)
* js: improve tests

* _

* _

* _

* fixup
2021-01-16 12:08:40 +01:00
Juan Carlos
41965880ce Add js BigInts (#16409)
* Add BigInts
* Renames tos plurals
* Improve Stringifications
* Update changelog.md

Co-authored-by: flywind <43030857+xflywind@users.noreply.github.com>

* RunnableExamplerize
* discard the discardable pragma
* Several improvements from peer reviews, more docs
* More doc, more test
* More doc, more test
* Better error message 'Error: usage of low is an {.error.} defined at jsbigints.nim' instead of just 'type mismatch JsBigInt'
* is an overload, rename
* proc to scare kids away
* Update lib/js/jsbigints.nim

Co-authored-by: Timothee Cour <timothee.cour2@gmail.com>

* https://github.com/nim-lang/Nim/pull/16409#discussion_r554365041

Co-authored-by: flywind <43030857+xflywind@users.noreply.github.com>
Co-authored-by: Timothee Cour <timothee.cour2@gmail.com>
2021-01-14 20:19:41 +01:00
flywind
b727217229 refactor cmpNimIdentifier (#16611)
* refactor cmpNimIdentifier

* Apply suggestions from code review

Co-authored-by: Clyybber <darkmine956@gmail.com>

Co-authored-by: Clyybber <darkmine956@gmail.com>
2021-01-13 12:29:30 +01:00
PMunch
0e7902b976 Implements streams for sockets (#15729) 2021-01-07 16:09:57 +01:00
inv2004
04b765c16d Jsonutils: pass opt for object in object (#16615)
* jsonutils: fromJson forward opt param fix

* jsonutils: object in object test + fix: opt pass
2021-01-07 03:09:02 +01:00
inv2004
0d5cab77f6 jsonutils: fromJson forward opt param fix (#16612) 2021-01-06 18:42:49 +01:00
flywind
c04f305bf7 make cstrutils work in VM (#16590)
* make cstrutils work in VM

* more
2021-01-05 17:52:26 +01:00
flywind
5fb56a3b2c refactor cmpIgnoreStyle and cmpIgnoreCase (#16399)
* init

* support strutils

* more

* better

* Call len once per string/cstring

* Change var to let

* Compare ternary on first char

* More appropriate param name

* fix

* better

* one test

* impl

* more efficient

* minor

Co-authored-by: Clyybber <darkmine956@gmail.com>
2020-12-31 11:54:40 +01:00
flywind
95f599ca2d move asciitables to std/private/ (#16498)
* move asciitables

* minor
2020-12-29 16:20:47 +01:00
flywind
e1e069dd6c use hexchar in stdlib (#16290) 2020-12-17 13:41:05 +01:00
Jason Beetham
1082d62b08 Adds toSet to create sets from iterables (#16276) 2020-12-14 15:20:21 -08:00
Elliot Waite
f3d57761ab Fix broken links in docs (#16336)
* Fix broken links in docs

* Fix rand HSlice links
2020-12-14 20:13:12 +01:00
ee7
629b22e3d5 styleCheck: Fix error for sugar and std/with (#16176)
With this commit, we no longer see an error if we pass
`--styleCheck:error` when compiling a file that contains `import sugar`
or `import std/with`.

The problem was that those modules (and only those modules) import
`std/private/underscored_calls`, which contained a styleCheck issue:
its spelling of `nnkArgList` didn't match the `nnkArglist` spelling in
`macros.nim`.

This commit fixes the issue by renaming `nnkArgList` to `nnkArglist`
repo-wide. The other way around would be a breaking change for code that
used `nnkArglist` and `--styleCheck:error`.

Fixes: #16174
2020-12-02 20:48:16 +01:00
flywind
139075e965 move decode_helpers to std/private (#16209) 2020-12-02 10:30:55 -08:00