summary refs log tree commit diff stats
path: root/lib/std
Commit message (Collapse)AuthorAgeFilesLines
* std/wrapnils does not use experimental:dotOperators anymore (#16996)Timothee Cour2021-02-101-12/+9
|
* Improve documentation for std/sha1 (#16970)konsumlamm2021-02-091-35/+50
|
* use typeof instead type (#16962)flywind2021-02-082-6/+6
|
* clarify docs for wrapnils (#16929)Timothee Cour2021-02-041-2/+7
| | | Co-authored-by: Dominik Picheta <dominikpicheta@googlemail.com>
* link compile-time options together in docs (#16879)n5m2021-02-021-2/+14
| | | | | | | | | | | | | | | | | | | | | * 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
* JS: make hash float support IE/Safari (#16872)flywind2021-02-011-0/+4
|
* refactor hash in JS backend (#16863)flywind2021-01-301-0/+8
|
* BigInt runnableExamples: octal, binary, hex constructor (#16868)Juan Carlos2021-01-291-11/+19
| | | Co-authored-by: Timothee Cour <timothee.cour2@gmail.com>
* add lost functions (#16843)flywind2021-01-291-0/+8
|
* remove conditionals on nimHasUserErrors, nimNoNilSeqs2, nimNoNilSeqs (#16861)Timothee Cour2021-01-291-9/+3
| | | | | | | | | * cleanup docs for type(nil) | type(nil); simplify nimHasUserErrors * simplify nimNoNilSeqs2 * simplify nimNoNilSeqs * fixup
* improve code in categories.nim; add std/private/gitutils; fix flakyness in ↵Timothee Cour2021-01-291-0/+40
| | | | | | nim CI (cloneDependency in deps.nim) (#16856) * improve code in categories.nim; gitutils; fix flakyness in deps.nim * cleanups
* Small changes to std/sums (#16797)konsumlamm2021-01-251-13/+29
|
* make oids module better (#16704)flywind2021-01-251-0/+7
| | | | | | | * make oids modules better * Update lib/pure/oids.nim * fix
* Add std/setutils to lib.rst (#16791)konsumlamm2021-01-221-5/+10
| | | | | | | | | * Add std/setutils to lib.rst Improve doc comments for setutils * Adhere to the RST spec Use no UFCS in toSet
* perpare for more compact bit operations in JS (#16728)flywind2021-01-191-0/+12
|
* jsonutils.jsonTo: support opt (#16739)Timothee Cour2021-01-171-2/+2
|
* Improve documentation for packedsets (#16715)konsumlamm2021-01-161-137/+135
| | | | | | | | | * Improve documentation for packedsets Add more runnableExamples Add deprecated pragma to intsets Replace intsets with packedsets in lib.rst * Apply suggested changes
* js: improve tests + some docs (#16727)Timothee Cour2021-01-161-2/+12
| | | | | | | | | | | * js: improve tests * _ * _ * _ * fixup
* Add js BigInts (#16409)Juan Carlos2021-01-141-0/+193
| | | | | | | | | | | | | | | | | | | | | | | | | * 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>
* refactor cmpNimIdentifier (#16611)flywind2021-01-131-0/+4
| | | | | | | | | * refactor cmpNimIdentifier * Apply suggestions from code review Co-authored-by: Clyybber <darkmine956@gmail.com> Co-authored-by: Clyybber <darkmine956@gmail.com>
* Implements streams for sockets (#15729)PMunch2021-01-071-0/+181
|
* Jsonutils: pass opt for object in object (#16615)inv20042021-01-071-1/+1
| | | | | * jsonutils: fromJson forward opt param fix * jsonutils: object in object test + fix: opt pass
* jsonutils: fromJson forward opt param fix (#16612)inv20042021-01-061-4/+4
|
* make cstrutils work in VM (#16590)flywind2021-01-051-5/+24
| | | | | * make cstrutils work in VM * more
* refactor cmpIgnoreStyle and cmpIgnoreCase (#16399)flywind2020-12-311-0/+53
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * 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>
* move asciitables to std/private/ (#16498)flywind2020-12-291-0/+83
| | | | | * move asciitables * minor
* use hexchar in stdlib (#16290)flywind2020-12-171-6/+19
|
* Adds toSet to create sets from iterables (#16276)Jason Beetham2020-12-141-0/+32
|
* Fix broken links in docs (#16336)Elliot Waite2020-12-142-7/+7
| | | | | * Fix broken links in docs * Fix rand HSlice links
* styleCheck: Fix error for `sugar` and `std/with` (#16176)ee72020-12-021-1/+1
| | | | | | | | | | | | | | | | 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
* move decode_helpers to std/private (#16209)flywind2020-12-021-0/+22
|
* move rest of tests to testament (#16140)flywind2020-11-274-129/+0
| | | | * move rest of tests to testament * Update tests/stdlib/tsums.nim
* move tests to testament (#16101)flywind2020-11-243-48/+0
| | | | | | | | | * move tests to testament * minor * fix random * disable test random
* packedsets fix regression introduced in #15564 (#16060)Timothee Cour2020-11-201-8/+9
| | | | | * packedsets fix regression introduced in #15564 * add tests
* Improve enumerate (#16053)Antonis Geralis2020-11-201-10/+43
| | | | | | | * Improve enumerate * updates * add tests
* Do not read the whole file to compute SHA1 hash (fixes 15997) (#16006)Igor Ribeiro de Assis2020-11-181-1/+16
| | | | | | | | | | | | | | | | | * Do not read the whole file to compute SHA1 hash (fixes 15997) * Update lib/std/sha1.nim Co-authored-by: Andreas Rumpf <rumpf_a@web.de> * Update lib/std/sha1.nim Co-authored-by: Andreas Rumpf <rumpf_a@web.de> * Directly break from loop Co-authored-by: Andreas Rumpf <rumpf_a@web.de> [backport:1.2] [backport:1.4]
* Make IntSet a generic ordinal set OrdSet[A] (#15564)landerlo2020-11-131-0/+607
| | | | | | | | | | | | | | * Make IntSet an ordinal set OrdSet[A: Ordinal] Backward compatibility with IntSet is maintained. IntSet is an alias for OrdSet[int] * move ordsets to new file, intsets exports it * ordset, move to lib/std folder * Fix `$` for ordsets and test cleanup * Fix ordsets compilation in doc example * Rename ordsets to packedsets
* Correct all eggs (#15906)Miran2020-11-101-1/+1
| | | | * "eg" is a misspelled "egg", "e.g." is "exempli gratia" * Also, "ie" is "i.e.".
* EnumUtils, speed up findStr in compiler (#15777)cooldome2020-11-031-0/+64
| | | | | | | | * add parseEnumRange * fix runnable example * update changelog * use parseEnumRange in compiler * reorganise code * add changelog, make single normalizer argument
* `ioutils` are moved to `fusion` (#15822)Miran2020-11-021-85/+0
|
* Fix doc comment for sumKbn (#15769)Antonis Geralis2020-10-291-1/+1
| | | Co-authored-by: b3liever <b3liever@yandex.com>
* Add C function dup and dup2 posix to system/io (#15675)Regis Caillaud2020-10-271-0/+85
| | | | | | | | | | | | | | | | | | | | | | | | | * * Add handle to dup and dup2 posix as duplicate and duplicateTo in std/ioutils. * Added small test & changelog entry * Fixed import in tioutils removed when isMainModule * * Nest test inside block. Rename proc var -> let in captureStdout * Renamed tmpfile to iotuils.txt * Added block: # duplicate, duplicateTo * Improved docstring * Clean non-idiomatic code * Added runnable examples * rm 2 trailing space in expected output * Made syntax prettier * Runnable example: file in getTempDir() * Tmp -> Temp * Fixed runnableExamples on windows
* implements https://github.com/nim-lang/RFCs/issues/258 (#15503)Andreas Rumpf2020-10-061-4/+39
| | | | | | | | | * implements https://github.com/nim-lang/RFCs/issues/258 * don't be too strict with custom pragma blocks * cast pragmas: documentation * added most missing inference query procs to effecttraits.nim
* Added std/effecttraits.nim (#15462)Andreas Rumpf2020-10-021-0/+19
|
* add `enumerate` macro (#15297)Miran2020-09-221-0/+56
| | | | | | | * add `enumerate` macro * address the comments * put `enumerate` in its own module
* Add some enhancements to `jsonutils.nim` (#15133)Ivan Bobev2020-09-091-31/+247
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Add some enhancements to `jsonutils.nim` * Use `jsonutils.nim` hookable API to add a possibility to deserialize JSON arrays directly to `HashSet` and `OrderedSet` types and respectively to serialize those types to JSON arrays. * Also add a possibility to deserialize JSON `null` objects to Nim option objects and respectively to serialize Nim option object to JSON object if some or to JSON `null` object if none. * Move serialization/deserialization functionality for `Table` and `OrderedTable` types from `jsonutils.nim` to `tables.nim` via the hookable API. * Add object `jsonutils.Joptions` and parameter from its type to `jsonutils.fromJson` procedure to control whether to allow deserializing JSON objects to Nim objects when the JSON has some extra or missing keys. * Add unit tests for the added functionalities to `tjsonutils.nim`. * improve fromJsonFields * Add changelog entry for the jsonutils enhancements * Add TODO in `jsonutils.nim` * Added an entry to "Future directions" section in `jsonutils.nim` as suggestion for future support of serialization and de-serialization of nested variant objects. * Added currently disabled test case in `tjsonutils.nim` for testing serialization and de-serialization of nested variant objects. * Move JSON hooks to `jsonutils.nim` Move `fromJsonHook` and `toJsonHook` procedures for different types to `jsonutils.nim` module to avoid a dependency of collections modules to the `json.nim` module. The hooks are removed from the following modules: * `tables.nim` * `sets.nim` * `options.nim` * `strtabs.nim` * Add some tests about `StringTableRef` Add tests for `StringTableRef`'s `fromJsonHook` and `toJsonHook` to `tjsonutils.nim`. * Disable a warning in `jsonutils.nim` Mark `fun` template in `jsonutils` module with `{.used.}` pragma in order to disable `[XDeclaredButNotUsed]` hint. The template is actually used by the `initCaseObject` macro in the same module. Co-authored-by: Timothee Cour <timothee.cour2@gmail.com>
* std/with support field assign (#14484)slangmgh2020-08-152-13/+19
| | | | | | | | | | | | | | | | | | | | | * std/with support filed assign * add changelog * add support x.dup.with * add example * revert support x.dup.with; add example * update changelog; fix assignment in parameter * Update changelog.md * add example for assignment in parameter * Remove colon style assign Co-authored-by: Clyybber <darkmine956@gmail.com>
* 'isolate' builtin; refs https://github.com/nim-lang/RFCs/issues/244 (#15011)Andreas Rumpf2020-07-201-0/+31
|
* fix #14475; unittest.require now works with `nim c`; require and check now ↵Timothee Cour2020-07-141-0/+22
| | | | | | | | | | | | | works with -d:nodejs (#14676) * fix #14475; make unittest work with -d:nodejs * fixup * fixup * disable inim, delaunay which failed after unittest.require got fixed * re-enable tests that have been fixed
* fromJson: support object variants (#14694)Timothee Cour2020-06-241-15/+73
|