summary refs log tree commit diff stats
path: root/tests
Commit message (Collapse)AuthorAgeFilesLines
* nvro don't touch cdecl types [backport: 1.6] (#19461)flywind2022-01-281-0/+18
| | | * nvro don't touch cdecl types; fix #19342 again
* New/better macro pragmas, mark some as experimental (#19406)metagn2022-01-203-63/+155
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * New/better macro pragmas, make some experimental fix #15920, close #18212, close #14781, close #6696, close https://github.com/nim-lang/RFCs/issues/220 Variable macro pragmas have been changed to only take a unary section node. They can now also be applied in sections with multiple variables, as well as `const` sections. They also accept arguments. Templates now support macro pragmas, mirroring other routine types. Type and variable macro pragmas have been made experimental. Symbols without parentheses instatiating nullary macros or templates has also been documented in the experimental manual. A check for a redefinition error based on the left hand side of variable definitions when using variable macro pragmas was disabled. This nerfs `byaddr` specifically, however this has been documented as a consequence of the experimental features `byaddr` uses. Given how simple these changes are I'm worried if I'm missing something. * accomodate compiler boot * allow weird pragmas * add test for #10994 * remove some control flow, try remove some logic
* Fix #11923 (#19427)Regis Caillaud2022-01-201-0/+10
| | | | | * Apply commit https://github.com/nim-lang/Nim/commit/5da931fe811717a45f2dd272ea6281979c3e8f0b that was never merged (was part of a bigger PR). Should fix issue #11932 * add a generic object for custom pragma
* Resolve cross file resolution errors in atomics (#19422) [backport:1.6]James2022-01-202-0/+20
| | | | | * Resolve call undeclared routine testAndSet * Fix undeclared field atomicType
* Added `std/envvars` for env vars handling (#19421)flywind2022-01-201-0/+59
|
* Don't reject types directly on AST (#19407)metagn2022-01-191-0/+9
| | | | | | | Instead of rejecting type expressions based on node kind, evaluate the expression as a type. This is already the behavior for call results, and it has its own error for non-types, which is the same error you would normally get with 2 words swapped.
* fix term rewriting with sideeffect (#19410)flywind2022-01-191-0/+19
| | | | | | | | | * fix term rewriting with sideeffect fix #6217 * add tests * Update tests/template/template_various.nim
* Added `std/oserrors` for OS error reporting (#19390)flywind2022-01-171-0/+9
| | | | | | | | | * Added 'std/oserrors' for OS error reporting * add a simple test * New code should not support -d:useWinAnsi anymore thanks to @Araq
* Optimize lent in JS [backport:1.6] (#19393)hlaaftana2022-01-172-8/+45
| | | | | | | * Optimize lent in JS [backport:1.6] * addr on lent doesn't work anymore, don't use it * use unsafeAddr in test again for older versions
* mangle names in nimbase.h using cppDefine (#19395) [backport]flywind2022-01-171-0/+16
| | | | mangle names in nimbase.h fix comments
* add mm to compilesettings; deprecate gc (#19394)flywind2022-01-161-1/+2
|
* deprecate unsafeAddr; extend addr (#19373)flywind2022-01-1624-39/+39
| | | | | | | | | | | | | | | | | | | | | | | | | * deprecate unsafeAddr; extend addr addr is now available for all addressable locations, unsafeAddr is deprecated and become an alias for addr * follow @Vindaar's advice * change the signature of addr * unsafeAddr => addr (stdlib) * Update changelog.md * unsafeAddr => addr (tests) * Revert "unsafeAddr => addr (stdlib)" This reverts commit ab83c99c507048a8396e636bf22d55fdd84d7d1c. * doc changes; thanks to @konsumlamm Co-authored-by: konsumlamm <44230978+konsumlamm@users.noreply.github.com> Co-authored-by: konsumlamm <44230978+konsumlamm@users.noreply.github.com>
* Use openarray of bytes in md5 (#19307)hlaaftana2022-01-153-9/+16
| | | | | | | | | | * Use openarray of bytes in md5 * fix CI * cleanup * use noSideEffect for bootstrapping * fix CI again * actually fix CI by checking if it works * this is getting ridiculous * put old md5 version in compiler, remove vmop
* Fixed concept constraints for static types (#19391)Jason Beetham2022-01-151-25/+62
|
* Generic parameters now can constrain statics in type definitions (#19362)Jason Beetham2022-01-141-0/+42
| | | | | | | | | * Parameters now can constrain static in type definitions resolved regression with generic procedures * Update compiler/sigmatch.nim Co-authored-by: Andreas Rumpf <rumpf_a@web.de>
* nrvo shouldn't touch bycopy object[backport:1.2] (#19385)flywind2022-01-142-0/+30
| | | fix nim-lang#19342
* fix stylecheck error with asyncdispatch (#19350)flywind2022-01-102-0/+34
| | | | | | | | | | | | | | | | | | | | | * stylecheck usages part two: stdlib cleanup typeinfo.nim: importCompilerProc => importcompilerproc nre.nim: newLineFlags => newlineFlags system.nim: JSRoot => JsRoot ref #19319 * prefer importCompilerProc * fix stylecheck error with asyncdispatch it is a partial regression since #12842 * add tests * don't use echo in tests
* Fix `remove` on last node of singly-linked list [backport:1.6] (#19353)gecko2022-01-101-0/+13
|
* style usages part one (openarray => openArray) (#19321)flywind2022-01-0449-76/+76
| | | | | * style usages (openArray) * revert doc changes
* Fix #19314 - fixing broken `DoublyLinkedList` after adding empty ↵rockcavera2022-01-031-0/+12
| | | | | | | `DoublyLinkedList` (#19315) [backport] * Update lists.nim * Update tlists.nim
* Add Week-Of-Year Implementation to Times Module (#17223)Carlo Capocasa2022-01-031-0/+95
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * initial * more tests * Apply suggestions from code review idiomatize Co-authored-by: Timothee Cour <timothee.cour2@gmail.com> * test iron age dates * add examples * fix typo * consistent param mention * add since pragrams * add changelog * Update lib/pure/times.nim Co-authored-by: Timothee Cour <timothee.cour2@gmail.com> * fix examples * fix negative years * add getWeeksInYear tests * add back fix dropped by rebase * week-year tuple api * add changelog * fix doc tags * add docstrings * fix typos 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>
* Allow full commands and blocks in type sections (#19181)hlaaftana2022-01-025-0/+368
| | | | | | | * allow full commands and blocks in type sections * update grammar * fix changelog [skip ci] * more tests * even more tests
* Update JS and nimscript import tests (#19306)hlaaftana2022-01-012-40/+53
| | | | | * add new modules, except experimental ones * remove deprecated modules mersenne and sharedlist * better describe why some modules fail and some modules don't
* Fix #19297 - fixing broken list after adding empty list (#19299)rockcavera2021-12-301-0/+12
| | | | | | | | | * Update lists.nim * Update tlists.nim * removed check `if b.tail != nil` The tail of the list being null it is still possible to retrieve its end by going through all nodes from the head. So checking for null from `b.tail` is unnecessary. However, setting `a.tail = b.tail` only if `a.head != nil`, so you don't break a good list with an already broken one.
* Fixed object field access of static objects in generics (#19283) [backport]Jason Beetham2021-12-231-0/+8
|
* Extract runnables that specify `doccmd` (#19275) [backport:1.6]Jake Leahy2021-12-201-0/+20
|
* fix #19244 - solves the problem of the InAddr object constructor in Windows. ↵rockcavera2021-12-171-0/+6
| | | | | | | (#19259) * Update winlean.nim * Update tnet_ll.nim
* [backport:1.0] json: limit recursion depth (#19252)Miran2021-12-141-0/+32
| | | | | * json: limit recursion depth * do not run this check for JS backend
* fix: fixes bug in CVerifyPeerUseEnvVars (#19247)Nick Wilburn2021-12-141-0/+16
| | | | | | Previously CVerifyPeerUseEnvVars was not being passed into scanSslCertificates, which meant that we weren't scanning additional certificate locations given via the SSL_CERT_FILE and SSL_CERT_DIR environment variables
* fix bug #14468 zero-width split (#19248)Carlo Capocasa2021-12-131-0/+6
|
* Various std net improvements (#19132)Jaremy Creechley2021-12-121-43/+45
| | | | | | | | | | | | | | | | | | | | | | | | | | | | * Variant of that works with raw IpAddresses. - Add doc tests for new net proc's. - Aadd recvFrom impl - Add recvFrom impl -- tweak handling data var - Update lib/pure/net.nim Co-authored-by: Dominik Picheta <dominikpicheta@googlemail.com> - cleaning up sendTo args - remove extra connect test - cleaning up sendTo args - fix inet_ntop test - fix test failing - byte len * fix test failing - byte len * debugging odd windows build failure * debugging odd windows build failure * more experiments to figure out the windows failure * try manual assigment on InAddr Co-authored-by: Jaremy Creechley <jaremy.creechley@panthalassa.com>
* fixes a possible 'javascript:' protocol exploit [backport:1.0] (#19134)Andreas Rumpf2021-12-101-4/+31
| | | | | | | | | | | | | * fixes a possible 'javascript:' protocol exploit [backport:1.0] * add tests * Update tests/stdlib/trstgen.nim * add the same logic for hyperlinks * move the logic into a proc Co-authored-by: narimiran <narimiran@disroot.org>
* nimRawSetjmp: support Windows (#19197)Ștefan Talpalaru2021-12-102-2/+134
| | | | | | | | | | | | * nimRawSetjmp: support Windows Using `_setjmp()` directly is required to avoid some rare (but very annoying) exception-related stack corruption leading to segfaults on Windows, with Mingw-w64 and SEH. More details: https://github.com/status-im/nimbus-eth2/issues/3121 Also add "nimBuiltinSetjmp" - mostly for benchmarking. * fix for Apple's Clang++
* fixes an old ARC bug: the produced copy/sink operations don't copy the ↵Andreas Rumpf2021-12-091-0/+15
| | | | hidden type field for objects with enabled inheritance; fixes #19205 [backport:1.6] (#19232)
* fixes a converter handling regression that caused private converters to leak ↵Andreas Rumpf2021-12-092-0/+13
| | | | into client modules; fixes #19213; [backport:1.6] (#19229)
* allow `HSlice` bounded by constants of distinct types (#19219) [backport:1.2]Etan Kissling2021-12-061-0/+2
| | | | | | | | | When creating heterogenous slices of distinct types, the compiler does not initialize the internal type's `size` before accessing it. This then leads to this crash message: ``` compiler/int128.nim(594, 11) `false` masking only implemented for 1, 2, 4 and 8 bytes [AssertionError] ``` This patch initializes the `size` properly, fixing the problem.
* treat do with pragmas but no parens as proc (#19191)hlaaftana2021-12-051-2/+17
| | | fixes #19188
* fixes #19159 [backport:1.6] (#19210)Andreas Rumpf2021-12-041-0/+12
|
* fixes #19198 [backport:1.6] (#19209)Andreas Rumpf2021-12-041-2/+21
| | | | | * fixes #19198 [backport:1.6] * added a test case
* fixes #19015 [backport:1.6] (#19204)Andreas Rumpf2021-12-041-0/+3
|
* accept object type node from macros (#19179)hlaaftana2021-11-241-0/+16
|
* parseExpr/parseStmt accept filename, fixes #13540 (#19182)hlaaftana2021-11-242-0/+15
|
* fix #12274 (#19180)hlaaftana2021-11-241-0/+9
|
* `caseStmtMacros` no longer experimental, experimental manual refactor (#19173)hlaaftana2021-11-231-2/+0
| | | | | | | | | | | * `caseStmtMacros` no longer experimental, experimental manual refactor * Update doc/manual.rst * apply review suggestions * apply review Co-authored-by: Andreas Rumpf <rumpf_a@web.de>
* implement RST & Markdown quote blocks (#19147)Andrey Makarov2021-11-231-0/+361
| | | | | | | * implement RST & Markdown quote blocks * compile with nim 1.0 * Fix indentation
* Accept nnkTypeSection from typedef macro pragmas (#19168)hlaaftana2021-11-221-0/+66
|
* fix marshal bugs in VM (#19161) [backport:1.6]flywind2021-11-171-4/+8
|
* Enable customizing PageShift to set PageSize for embedded targets (#19129)Jaremy Creechley2021-11-161-2/+5
| | | | | | | | | | | | | | | | * Enable customizing PageSize (via PageShift). This enables adjusting PageSize for embedded targets without abusing cpu16. * copy nimPageXYZ settings for mmpaptest * add docs for Nim manual * add docs for Nim manual * docs tweaks Co-authored-by: Jaremy Creechley <jaremy.creechley@panthalassa.com>
* Fix punycode.decode function (#19136)Christoph Krybus2021-11-121-1/+201
| | | | | | | | | | | | | | * Refactor: rename proc to func * Fix punycode.decode function This function could only properly decode punycodes containing a single encoded unicode character. As soon as there was more than one punycode character group to decode it produced invalid output - the number of characters was correct, but their position was not. * Update tpunycode.nim Co-authored-by: Clay Sweetser <Varriount@users.noreply.github.com>
* fixes #19051 [backport:1.6] (#19133)Andreas Rumpf2021-11-121-1/+8
|