summary refs log tree commit diff stats
path: root/lib/pure/collections
Commit message (Collapse)AuthorAgeFilesLines
* Discussion both in (#12678)c-blake2019-11-201-31/+41
| | | | | | | | | | | https://github.com/nim-lang/Nim/pull/12600 and in https://forum.nim-lang.org/t/5499 indicates that everyone is happy/happier with ``pop``. This just renames the brand new ``take``s to ``pop`` and installs inline aliases/wrappers to preserve ``Table.take`` and ``TableRef.take``. Update apis.rst to try to maintain consistency of remove-and-return procs.
* remove long-deprecated 'mapIt'narimiran2019-11-131-7/+0
|
* .cursor implementation (#12637)Andreas Rumpf2019-11-121-4/+7
| | | | | | | | | | | * cursors: first implementation * added currently failing test * .cursor works for doubly linked lists * make -d:useMalloc work again * added code to nil out refs in a destructor * it's now called --gc:arc * renderer.nim: render nkBreakState properly * make simple closure iterators work without leaking
* fix #12519: introduce OrderedTable.take, CountTable.del, CountTable.take ↵Miran2019-11-081-4/+148
| | | | | | | | | | | | (#12600) * add OrderedTable.take * add CountTable.del and CountTable.take * add .since pragma to the introduced public procs * add changelog entry [ci skip]
* Make sequtils.zip return seq of anonymous tuples (#12575)Kaushal Modi2019-11-041-40/+64
| | | | | | | | | | * Make sequtils.zip return seq of anonymous tuples Earlier the tuples had named fields "a" and "b" and that made it difficult to assign the zip returned seqs to other vars which expected seqs of tuples with field names other than "a" and "b". * Make sequtils.zip backwards compatible with Nim 1.0.x
* fix several typos in documentation and comments (#12553)Nindaleth2019-10-302-2/+2
|
* sequtils: replace deprecated 'random' call within example (#12515) [backport]Jjp1372019-10-251-1/+1
|
* Fix word wrappingJjp1372019-10-222-5/+6
|
* Fix many broken linksJjp1372019-10-224-7/+7
| | | | | | Note that contrary to what docgen.rst currently says, the ids have to match exactly or else most web browsers will not jump to the intended symbol.
* fixes #11764, faster hashing of (u)int (#12407)Miran2019-10-151-2/+2
|
* fixes #12366 [backport] (#12393)Andreas Rumpf2019-10-091-0/+17
|
* use system.move instead of system.shallowCopy if the GC mode requires itAndreas Rumpf2019-10-045-10/+24
|
* Fix spellings (#12277) [backport]Federico Ceratto2019-09-271-2/+2
|
* last stdlib cleanupsAraq2019-09-213-0/+6
|
* removed the deprecatedGet pragmaAraq2019-09-211-3/+2
|
* lib\pure\htmlgen.nimAraq2019-09-212-761/+0
| | | | avoid callsite for htmlgen
* fix #12200, cannot 'inc' CountTable by a negative value (#12208)Miran2019-09-171-2/+5
| | | | | | * fix #12200, cannot 'inc' CountTable by a negative value * use Positive
* fixes a subtle tables.nim regressionAraq2019-09-051-32/+32
|
* [refactoring] remove unused imports in the compiler and in some stdlib modulesAraq2019-07-181-1/+1
|
* [bugfix] critbits styleCheck fix: consistent var naming (#11752)Kaushal Modi2019-07-161-8/+8
|
* styleCheck fix: type naming: s/outType/OutType/ (#11749)Kaushal Modi2019-07-161-9/+9
|
* minor style changesAraq2019-07-101-2/+2
|
* make more parts of the stdlib compile with --styleCheck:errorAraq2019-07-101-1/+1
|
* styleCheck: make the compiler and large parts of the stdlib compatible with ↵Araq2019-07-101-3/+3
| | | | --styleCheck:error
* [other] prettify collections (#11695)Miran2019-07-0914-186/+209
|
* [bugfix] fix #11588, don't check if SharedTable is initializednarimiran2019-06-262-11/+13
|
* [bugfix] fix OrderedTable iterators (#11562)Miran2019-06-221-5/+7
|
* [bugfix] fix `delete` in strutils and sequtils (#11535)Miran2019-06-201-1/+1
|
* [bugfix] fix OrderedTable default initialization (#11549)Miran2019-06-202-2/+3
|
* [other] documentation: deprecation comments are now auto-generatednarimiran2019-06-191-3/+1
|
* [refactoring] refactor the compiler and stdlib to deprecation warnings (#11419)Arne Döring2019-06-111-2/+2
|
* make fullpaths the default in error messages and stack traces for mor… ↵Andreas Rumpf2019-06-052-2/+2
| | | | | | | | | | | | (#11385) * make fullpaths the default in error messages and stack traces for more convenient development * split up -d:release into -d:release and -d:danger flags * workaround a Nim config parser bug * fixes an old nim config parser bug * make megatest green again * make nimpretty tests work again * make nimsuggest green
* Render deprecated pragmas (#8886)LemonBoy2019-06-034-15/+9
| | | | | | | | | * Render deprecated pragmas * fix the expected html * clean up the documentation regarding deprecations * fix typo * fix system.nim * fix random
* sets: minor documentation fixes [ci skip] (#11377)Jjp1372019-06-021-3/+3
| | | | | | | | Mainly replace a backslash, which was supposed to represent set difference, with the Unicode symbol for set difference (U+2216). The backslash did not appear in the output since it is used to escape characters in reST. Fix a few typos as well.
* right shift is now by default sign preserving (#11322)Arne Döring2019-05-291-11/+11
| | | | | | | | | | | * right shift is now by default sign preserving * fix hashString and semfold * enable arithmetic shift right globally for CI * fix typo * remove xxx * use oldShiftRight as flag * apply feedback * add changelog entry
* fixes #11344Araq2019-05-281-4/+9
|
* fixes #1286; object case transitions are now soundAndreas Rumpf2019-05-271-6/+2
|
* Workaround "move not found" exception in JS when using tables. (#11256)Dominik Picheta2019-05-151-1/+4
|
* sequtils: minor typoAraq2019-05-101-1/+1
|
* CountTable: check for usages after sorting (#11189)Miran2019-05-081-1/+10
|
* tables: check for mutation when iterating (#11160)Miran2019-05-041-42/+127
|
* introduce temporary <//> for 'owned' to get this compile with 0.19 (#11145)Andreas Rumpf2019-05-022-15/+19
| | | | | | | | * introduce temporary <//> for 'owned' to get this compile with 0.19 * make newTable[string, owned Node]() compile (but it crashes) * make sink/owned parameters consistent * make actiontable test compile again * VM: support sytem.move; makes tests green
* Initialized collections (#11094)Miran2019-04-296-424/+650
| | | | | | | | | | | | * tables: initialized by default * sets: initialized by default * DRY: extract shared functionality * add a changelog entry * fix errors * don't test include files * make it work for sharedtables * fix discovered bugs * add exhaustive tests
* reimplement_pr_10974 (#11130)cooldome2019-04-271-0/+16
|
* tables: fix link (#11090) [ci skip]Jjp1372019-04-231-1/+1
|
* Improve tables docs for del/take (#11030)Christopher Dunn2019-04-171-1/+5
| | | | * Continuation of b40a637f * https://forum.nim-lang.org/t/4789
* faster CountTable sort(), optional SortOrder (#11010)Andy Davidoff2019-04-161-27/+30
| | | | | | | | | * use existing sort for CountTable, and add SortOrder options to CountTable, OrderedTable sort(s) * add some tests, runnables, etc. * fix runnable imports
* make sets.nim useful for selective 'from import'sAraq2019-04-051-57/+54
|
* stdlib: use system.default if it existsAndreas Rumpf2019-03-052-12/+10
|
* Initial version of the hot-code reloading support for native targets (#10729)zah2019-02-261-2/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * squashed work by Zahary * squashing a ton of useful history... otherwise rebasing on top of upstream Nim after commit 82c009a2cbc5d07ab9a847f1c58228a20efaf219 would be impossible. * Code review changes; Working test suite (without code reloading enabled) * - documentation - implemented the HCR test - almost works... - fix the issue on Unix where for executable targets the source file for the main module of a project in nimcache was being overwritten with the binary itself (and thus the actual source code was lost) - fixing embedded paths to shared objects on unix (the "lib" prefix was being prepended to the entire path instead of just the filename) - other fixes - removing unnecessary includes since that file is already included in chcks.nim which is in turn included in system.nim (and previously was getting imported in chcks.nim but then system.nim improts something... and that breaks HCR (perhaps it could be fixed but it would be nice not to import anything in system)) * fix for clang & C++ - explicitly casting a function pointer to void* more stable mangling of parameter names when HCR is on the length of the static arrays in the DatInit functions is now part of the name of the variables, so when they get resized they get also recreated more stable mangling for inline functions - no longer depends on the module which first used them work on the new complicated HCR test - turned surprisingly complex - WIP test now successfully passes even when re-running `koch test` (previously when the nimcache wasn't cold that lead to errors) better documentation calling setStackBottomWith for PreMain passes over the HcrInit/DatInit/Init calls of all modules are now in the proper order (first all of one type, then all of the next). Also typeinfo globals are registered (created) in a single pass before the DatInit pass (because of the way generic instantiations are handled) Fix the test suite execution on macOs fix for being able to query the program arguments when using HCR on posix! other fixes * Bugfix: Fix a compilation error in C++ mode when a function pointer is converted to a raw pointer * basic documentation for the new hot code reloading semantics * Add change log entry * Don't re-execute the top-level statements while reloading JS code * fix a number of tests broken in a recent bugfix * Review changes * Added {.executeOnReload.} pragma that indicates top-level statements that should be executed on each reload. To make this work, I've modified the way the `if (hcr_init_) {...}` guards are produced in the init code. This still needs more work as the new guards seem to be inserted within the previously generated guards. This change also removes the need for `lastRegistedGlobal` in nimhcr. * Implemented the `signatureHash` magic and the `hasModuleChanged` API depending on it (the actual logic is not imlemented yet). * Add the "hcr" prefix to all HCR-related symbols in the system module. Added a new `hotcodereloading` module exporting the high-level API to the user. Besides being more hygienic, this was also required in order to make it possible to use macros in the high-level API. Without the split, `system` would have to import `macros`, which was going to produce the well-known init problems. * Attempted to solve the "GC markers problem". Crashes were expected with the previous code, because the GC markers were compiled as normal procs are registered in the GC. When their module is unloaded, dangling pointers will remain in the GC tables. To solve this issue, I don't register any GC markers when HCR is on, but I add them to the HCR globals metadata and I use a single marker registed in nimhcr during the initialization of the system module that will be responsible for marking all globals. * fix a compilation error * - implemented the hasModuleChanged functionality - tuples can be returned and broken into different vars in global scope - added comments for the closnig scopes of the if statements in the init proc - the new executeOnReload pragma works now! - other fixes * finally! fixing this hack in a proper way - declaring the destructor out of line (out of the class body) - we no longer need to forward-declare popCurrentExceptionEx * Force full module parsing This is a temporary hack that breaks some tests. I'll investigate later how these can be fixed. * tuples are now properly handled when global! * these comments mess up the codegen in debug mode when $n is not actually a new line (or something like that) - these labels are intended only for GOTO labels anyway... * "solved" the issue with the .pdb locks on windows when a binary is being debugged and hot code reloading is used at the same time * fixes after rebasing... * small fixes for the test * better handling of globals! no more compiler crashes for locals with the global pragma, also simplified code around loops in global scope which have local vars (actually globals) * we can now use the global pragma even for ... globals! * the right output * lets try those boehm GC tests * after the test is ran it will be at its starting state - no git modifications * clarification in the docs * removed unnecessary line directives for forward declarations of functions - they were causing trouble with hot code reloading when no semantic change propagates to the main module but a line directive got changed and thus the main module had to be recompiled since the .c code had changed * fixed bug! was inserting duplicate keys into the table and later was removing only 1 copy of all the duplicates (after a few reloads) * no longer breaking into DatInit code when not supposed to * fixes after rebasing * yet more fixes after rebasing * Update jssys.nim * Rework the HCR path-handling logic After reviewing the code more carefully, I've noticed that the old logic will be broken when the user overrides the '--out:f' compiler option. Besides fixing this issues, I took the opportunity to implement the missing '--outdir:d' option. Other changes: * ./koch test won't overwrite any HCR and RTL builds located in nim/lib * HCR and RTL are compiled with --threads:on by default * Clean up the globals registration logic * Handle non-flattened top-level stmtlists in JS as well * The HCR is not supported with the Boehm GC yet Also fixes some typos and the expected output of the HCR integration test * The GC marker procs are now properly used as trampolines * Fix the HCR integration test in release builds * Fix ./koch tools * this forward declaration doesn't seem to be necessary, and in fact breaks HCR because a 2nd function pointer is emitted for this externed/rtl func * the forward declaration I removed in the last commit was actually necessary * Attempt to make all tests green * Fix tgenscript * BAT file for running the HCR integration test on Windows [skip ci] * Fix the docgen tests * A final fix for Travis (hopefully)