summary refs log tree commit diff stats
path: root/lib
Commit message (Collapse)AuthorAgeFilesLines
* std/hashes: hash(ref|ptr|pointer) + other improvements (#17731)Timothee Cour2021-04-161-23/+49
|
* start using import {.all.} (#17736)Timothee Cour2021-04-161-22/+0
|
* `import foo {.all.}` reboot (#17706)Timothee Cour2021-04-161-0/+34
|
* make the copy operation of Thread an error (#17734)flywind2021-04-161-0/+2
|
* Fix array's high & low return type for empty arrays (#17705)Tanguy Cizain2021-04-151-0/+8
| | | | | | | | | * fix array.high/low return type * Add test for empty array low return type Co-authored-by: konsumlamm <44230978+konsumlamm@users.noreply.github.com> Co-authored-by: konsumlamm <44230978+konsumlamm@users.noreply.github.com>
* Fix getCustomPragmaVal for some multi arg pragmas (#17723)Clyybber2021-04-151-41/+45
| | | | | * Fix getCustomPragmaVal for some multi arg pragmas * Bootstrap fix
* rst indentation fixes (ref #17340) (#17715)Andrey Makarov2021-04-152-39/+74
|
* simplify asyncfutures, asyncmacro (#17633)Timothee Cour2021-04-142-72/+31
|
* getCustomPragma is split up in more usable chunks (#11526)Arne Döring2021-04-141-93/+165
| | | | | | | | | | | | | | | | | * getCustomPragma is split up in more usable chunks * changelog entry * fix for style checks * shitty typedesc special casing * Add since annotation and remove typedesc comments * Fix typo * Revert since annotation because it breaks bootstrapping * Export getCustomPragmaNode conditionally * Reduce code duplication * Update since * Update lib/core/macros.nim * Apply suggestions from code review Co-authored-by: Clyybber <darkmine956@gmail.com> Co-authored-by: Andreas Rumpf <rumpf_a@web.de>
* callback cannot be nil (#17718)flywind2021-04-141-0/+1
| | | | | | | `Task.callback` cannot be nil, we need to raise it at debug and release mode Situations: - if users create a Task object without using `toTask` and invoke the Task - if users already move the Task and invoke the Task
* Update channels.nim (#17717)flywind2021-04-141-4/+4
|
* Remove the use of usrToCell in gcMark [backport:1.2] (#17709)zah2021-04-142-6/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Remove the use of usrToCell in gcMark [backport:1.2] Recently, we've discovered a GC crash resulting from inlining of the memory allocation procs that allowed the compiler to avoid maintaining any references to the "user pointer" on the stack. Instead, a "cell pointer" appeared there and all field accesses were performed with adjusted offsets. This interfered with the ability of the GC to mark the correct cell in the conservative stack scans which lead to premature collection of objects. More details here: https://github.com/status-im/Nim/commit/af69b3ceae16281efd45cbee4ce1bedd14282304 This commit closes another theoretical loophole that may lead to the same problem. If a short proc is accessing both the object and its reference count in a short sequence of instructions, the compiler may be enticed to reduce the number of registers being used by storing only a single pointer to the object and using offsets when reading and writing fields. A perfectly good strategy would be to store only the cell pointer, so the reference count updates can be performed without applying offsets. Accessing the fields of the object requires offsets anyway, but these can be adjusted at compile-time without any loss. Following this strategy will lead to the same problem of marking a wrong cell during the conservative stack scan, leading to premature collection. The problem is avoided by not using `usrToCell` in `gcMark`. Since the cell discovery logic can already handle interior pointers, the user pointers don't need to be adjusted for the GC to function correctly.
* add number literal jsbigints.big (#17707)Timothee Cour2021-04-131-7/+13
|
* remove unnecessary assignment (#17702)flywind2021-04-121-1/+0
|
* followup strformat PR. backslash escapes, tests, docs (#17700)shirleyquirk2021-04-121-4/+29
| | | | | | | | | | | | | | | | | | | | | | * Allow use of colons inside fmt allowing colons inside fmt by replacing the format specifier delimiter lets arbitrary nim code be run within fmt expressions. Co-authored-by: flywind <xzsflywind@gmail.com> * formatting,documentation,backslash escapes Adding support for evaluating expressions by special-casing parentheses causes this regression: `&"""{ "(hello)" }"""` no longer parses. In addition, code such as &"""{(if open: '(' else: ')')}""" wouldn't work. To enable that, as well as the use of, e.g. Table constructors inside curlies, I've added backslash escapes. This also means that if/for/etc statements, unparenthesized, will work, if the colons are escaped, but i've left that under-documented. It's not exactly elegant having two types of escape, but I believe it's the least bad option. * changelog * added json strformat test * pulled my thumb out and wrote a parser Co-authored-by: Andreas Rumpf <rumpf_a@web.de> Co-authored-by: flywind <xzsflywind@gmail.com>
* macrocache.nim: removed trailing whitespaceAraq2021-04-111-23/+23
|
* iterable[T] (#17196)Timothee Cour2021-04-111-0/+4
| | | | | | | | * fix failing test toSeq in manual which now works * changelog * reject proc fn(a: iterable) * add iterable to spec * remove MCS/UFCS limitation that now works
* [feature] add arbitrary code execution to strformat (#17694)shirleyquirk2021-04-111-9/+28
| | | | | | | | | * changed parser to ignore ':' within parens * Update strformat.nim * Update lib/pure/strformat.nim Co-authored-by: flywind <xzsflywind@gmail.com> Co-authored-by: Andreas Rumpf <rumpf_a@web.de>
* restyle RST option lists (#17637)Andrey Makarov2021-04-103-8/+16
| | | | | | | | | | | | | * WIP: restyle RST option lists * apply similar style to Latex * fix tests * minor visual tweaks * update tests * remove leftover comments
* Genode platform fixes (#17521)Emery Hemingway2021-04-094-24/+48
| | | | | | | | | | | | | | | | | | | * Genode: move dyncall failures to runtime Do not use the "error" pragma to warn that dynamic library loading is not implemented, print a message at runtime and exit. * Genode: use stricter dataspace type in page allocator * Genode: remove compiler configuration from nim.cfg Self-hosting Nim is not supported on Genode and defining the cross-compilation environment can be done externally. * Genode: use new mutex API * Genode: call nim_component_construct as a C procedure * Genode: implement echo for NimStringV2
* hashes: Made the runnableExample easier to understand (#17689)Andreas Rumpf2021-04-091-1/+1
|
* add std/tasks (#17447)flywind2021-04-091-0/+272
|
* Fix small typos (#17680)konsumlamm2021-04-091-0/+1
|
* Fix rst typo (#17671)konsumlamm2021-04-081-1/+1
|
* Update `sysrand` documentation (#17676)konsumlamm2021-04-081-16/+16
| | | Co-authored-by: Andreas Rumpf <rumpf_a@web.de>
* further progress on rst roles & directives (fix #17646) (#17659)Andrey Makarov2021-04-0810-50/+92
| | | | | | | * further progress on rst roles & dir-s (fix #17646) * fix documents according to the messages * fix bug 17 from #17340
* Improve endians module (#17674)konsumlamm2021-04-081-7/+42
| | | | Extend documentation Add runnableExamples
* use strstr for a faster find implementation (#17672)Andreas Rumpf2021-04-081-3/+26
| | | | | * use strstr for a faster find implementation * stress the -d:release and -d:danger switches
* fixes #17647 (#17667)Andreas Rumpf2021-04-074-21/+21
|
* use sink and lent in deques (#17661)flywind2021-04-071-10/+10
| | | | | | | | | * use sink and lent in deques * Update lib/pure/collections/deques.nim Co-authored-by: Andreas Rumpf <rumpf_a@web.de> Co-authored-by: Andreas Rumpf <rumpf_a@web.de>
* ensure the avr example keeps compiling (#17663)Andreas Rumpf2021-04-071-0/+4
| | | | | | | * ensure the avr example keeps compiling * Update tests/avr/thello.nim * now compiles properly
* close #4451 (#17627)flywind2021-04-061-1/+2
|
* don't run one example on 32-bit machines (#17655)Miran2021-04-061-3/+4
| | | | | This example seems to break our 32-bit nightlies builds. This is just a temporary solution (TM) until we figure out a better one.
* ref #14873 (#17644)flywind2021-04-061-0/+5
| | | | | | | * ref #14873 * comment * Update lib/core/locks.nim
* items(array)+friends: remove a RT comparison (#17650)Timothee Cour2021-04-061-8/+8
|
* document caveats of quit (#17648)Timothee Cour2021-04-051-4/+8
|
* Improve the typeinfo module (#17625)konsumlamm2021-04-051-122/+129
| | | Co-authored-by: Timothee Cour <timothee.cour2@gmail.com>
* fix :number-lines: regression (#17639)Andrey Makarov2021-04-051-1/+1
|
* fix rst option list at EOF (follow-up #17442) (#17638)Andrey Makarov2021-04-041-1/+1
|
* remove un-needed {.push hint[ConvFromXtoItselfNotNeeded]: off.} in ↵Timothee Cour2021-04-032-6/+1
| | | | asyncfutures, asyncmacro (#17631)
* implement RFCs/294 ; disallow enum <=> enum conversion (#16351)Timothee Cour2021-04-031-1/+1
| | | | | | | | | | | * fix https://github.com/nim-lang/RFCs/issues/294 ; disallow enum <=> enum conversion * fix the runnableExamples that was the instigator of this RFC * legacy -d:nimLegacyConvEnumEnum * use -d:nimLegacyConvEnumEnum in important_package nimgame2 * add test for enum cast * improve changelog * add changelog: Changes affecting backward compatibility * cleanup changelog * fix changelog
* fix #17615(runnableExamples silently ignored if placed after some code) (#17619)flywind2021-04-024-9/+8
| | | Co-authored-by: Timothee Cour <timothee.cour2@gmail.com>
* enable syntax highlighting for inline code (#17585)Andrey Makarov2021-04-023-33/+125
| | | | | | | | | | | | | | | | | | | | | | | | | * enable syntax highlighting for inline code * finish '.. default-role' and preliminary '.. role' implementation * more compact check in dirRole * set :literal: as default role for *.rst * Update lib/packages/docutils/rst.nim Co-authored-by: Timothee Cour <timothee.cour2@gmail.com> * use whichRole for setting currRoleKind * Update lib/packages/docutils/rst.nim Co-authored-by: Timothee Cour <timothee.cour2@gmail.com> * rename rnGeneralRole -> rnUnknownRole Co-authored-by: Timothee Cour <timothee.cour2@gmail.com>
* [docs minor] close #17618 (#17620)flywind2021-04-021-9/+12
| | | | | | | | | * [docs minor] close #17618 * Update lib/pure/times.nim Co-authored-by: konsumlamm <44230978+konsumlamm@users.noreply.github.com> Co-authored-by: konsumlamm <44230978+konsumlamm@users.noreply.github.com>
* new `genAst` as replacement for `quote do` (#17426)Timothee Cour2021-04-022-1/+91
| | | | | | | | | | | | | | * new `macros.genAst`: fixes all issues with `quote do` * add changelog entry * add workaround for https://github.com/nim-lang/Nim/issues/2465#issuecomment-511076669 * add test for #9607 * add kNoExposeLocalInjects option * add test case for nested application of genAst * genAst: automatically call newLit when needed * allow skipping `{}`: genAst: foo * add test that shows this fixes #11986 * add examples showing mixin; add examples showing passing types, macros, templates * move to std/genasts * improve docs
* [docs minor] close #16553 (#17612)flywind2021-04-021-10/+6
| | | Co-authored-by: Timothee Cour <timothee.cour2@gmail.com>
* Fix #17017 (math edge cases) (#17588)konsumlamm2021-04-011-5/+13
| | | | | | | * Fix #17017 Add more test cases * USe signbit in example
* jsonutils: support cstring (including as Table key); improve docs (#16062)Timothee Cour2021-03-311-5/+17
| | | | | * jsonutils: support cstring (including as Table key); improve docs * changelog * un-disable a test now that #16061 was fixed
* Removes asynchttpserver.getSocket. (#17587)Dominik Picheta2021-03-311-14/+0
|
* fix #15617(fix compilation failure on -d:useMalloc --gc:none) (#17555)flywind2021-03-301-0/+10
| | | | Co-authored-by: Andreas Rumpf <rumpf_a@web.de> Co-authored-by: Timothee Cour <timothee.cour2@gmail.com>