Commit Graph

19964 Commits

Author SHA1 Message Date
Regis Caillaud
486cb09ec2 Clonkk fix2 11923 (#19451)
* fix nnkBracketExpr not compiling for getImpl on customPragmaNode

* fix test import

* fix alias not working with hasCustomPragmas
2022-02-02 09:44:51 +01:00
Jason Beetham
1830a3b505 No longer segfault when using a typeclass with a self referencing type (#19467) 2022-02-02 09:38:21 +01:00
tandy1000
22ae0bef63 Update jsfetch with latest API and fix missing bindings (#19473)
* Update with latest API and fix missing bindings

remove deprecated `Body`
remove implicit `cstring` convs
add `Headers` to `FetchOptions`
add `Request` init proc which takes `FetchOptions`

* Update lib/std/jsfetch.nim

Co-authored-by: Juan Carlos <juancarlospaco@gmail.com>

* Update lib/std/jsfetch.nim

Co-authored-by: Juan Carlos <juancarlospaco@gmail.com>

* remove experimental flag

Co-authored-by: Juan Carlos <juancarlospaco@gmail.com>
2022-02-01 12:12:55 +01:00
flywind
56a901f9e1 fix broken CI (#19472)
* fix broken CI

* fix

* fix tests
2022-01-31 13:49:20 +01:00
flywind
33cd883e27 [add testcase] NRVO does not occur with init procedures (#19462)
* [add testcase] NRVO does not occur with init procedures

close #19094

* Update tests/ccgbugs2/tcodegen.nim
2022-01-29 14:06:54 +01:00
Dominik Picheta
cb894c7094 Merge pull request from GHSA-ggrq-h43f-3w7m
This fixes a CVE (currently
https://github.com/nim-lang/Nim/security/advisories/GHSA-ggrq-h43f-3w7m)
2022-01-29 14:03:01 +01:00
flywind
520881af9a update outdated link (#19465)
Ref https://github.com/nim-lang/Nim/issues/19463
2022-01-28 21:08:38 -05:00
flywind
0c3892c3c7 nvro don't touch cdecl types [backport: 1.6] (#19461)
* nvro don't touch cdecl types; fix #19342 again
2022-01-28 09:53:42 +01:00
flywind
6319b00ef7 support set other GCs after mm = orc or mm = arc is set in the global config (#19455)
* support set other GCs after arc/orc in global config

fix #15535

* set before
2022-01-27 15:23:34 +01:00
Hugo Granström
4b723c0f53 change run command for numericalnim (#19448)
Now it makes runs the custom `nimCI` task that installs the external dependencies
2022-01-25 17:31:24 +08:00
Andreas Rumpf
6ea6225523 bugfix: varargs count as open arrays (#19447) 2022-01-25 08:08:22 +01:00
ehmry
f7c4fb0014 os: faster getFileSize (#19438)
Use "stat" rather than "open", "seek", and "close" system calls.
The Windows implementation remains the same.
2022-01-24 20:57:37 +01:00
Andreas Rumpf
15f54de5c4 RST: allow empty number-lines directives just like it was done for a decade; all my documents rely on this feature [backport (#19431) 2022-01-22 20:33:55 +01:00
metagn
2bd1aa186e New/better macro pragmas, mark some as experimental (#19406)
* 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
2022-01-20 20:57:50 +01:00
Regis Caillaud
1563cb2f6e Fix #11923 (#19427)
* Apply commit 5da931fe81 that was never merged (was part of a bigger PR). Should fix issue #11932

* add a generic object for custom pragma
2022-01-20 20:50:36 +01:00
flywind
927fa890ec enable weave (#19363) [backport:1.6]
* enable weave
* workaround CI
2022-01-20 13:59:36 +01:00
James
851e515bba Resolve cross file resolution errors in atomics (#19422) [backport:1.6]
* Resolve call undeclared routine testAndSet

* Fix undeclared field atomicType
2022-01-20 13:58:59 +01:00
flywind
4a38092ac1 Added std/envvars for env vars handling (#19421) 2022-01-20 13:55:19 +01:00
Tom
ce44cf03cc Add noQuit option (#19419) [backport:1.6]
* Add noQuit option

* Add nim prefix in case of conflicts

Co-authored-by: flywind <xzsflywind@gmail.com>

Co-authored-by: flywind <xzsflywind@gmail.com>
2022-01-19 17:41:11 +01:00
metagn
08261cb9e3 Don't reject types directly on AST (#19407)
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.
2022-01-19 12:38:14 +01:00
flywind
5d34e81f23 fix term rewriting with sideeffect (#19410)
* fix term rewriting with sideeffect

fix #6217

* add tests

* Update tests/template/template_various.nim
2022-01-19 12:37:30 +01:00
nblaxall
23c4bbedcb add an example to setControlCHook (#19416)
* add an example to setControlCHook

* [skip CI] format example for setControlCHook

Co-authored-by: Nathan Blaxall <nathan.blaxall@actionstep.com>
2022-01-19 12:25:21 +01:00
flywind
b3c178c202 suppress deprecated warnings (#19408)
* suppress deprecated warnings

once bump version to 1.7.3 enable deprecated messages

* deprecate later
2022-01-19 08:39:22 +01:00
flywind
aac54b9c7f fix stricteffects (nimsuggest/sexp) (#19405)
* fix stricteffects (nimsuggest/sexp)

* Update tstrict_effects3.nim

* Update tests/effects/tstrict_effects3.nim
2022-01-18 16:02:35 -05:00
Andrey Makarov
d7869a8009 Improve Zshell completion (#19354) 2022-01-18 15:58:18 -05:00
Hamid Bluri
5d303762f1 update deprecated example (#19415)
`toNimIdent` proc is deprecated, so I replaced it with `ident` proc
2022-01-18 15:55:39 -05:00
flywind
bc3bee5469 Added std/oserrors for OS error reporting (#19390)
* Added 'std/oserrors' for OS error reporting

* add a simple test

* New code should not support -d:useWinAnsi anymore

thanks to @Araq
2022-01-17 13:06:31 +01:00
hlaaftana
07c7a8a526 Optimize lent in JS [backport:1.6] (#19393)
* 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
2022-01-17 13:03:40 +01:00
Jaremy Creechley
dc8ac66873 fix no net compilation on zephyr (#19399)
Co-authored-by: Jaremy J. Creechley <jaremy.creechley@panthalassa.com>
2022-01-17 13:02:31 +01:00
flywind
4f6b59de96 mangle names in nimbase.h using cppDefine (#19395) [backport]
mangle names in nimbase.h
fix comments
2022-01-17 11:14:13 +01:00
flywind
2c5b367001 improve changelog a bit (#19400) 2022-01-17 11:54:27 +08:00
flywind
15e3813d96 add mm to compilesettings; deprecate gc (#19394) 2022-01-16 21:10:35 +01:00
flywind
d102b2f54c deprecate unsafeAddr; extend addr (#19373)
* 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 ab83c99c50.

* 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>
2022-01-16 11:08:38 +01:00
hlaaftana
a95399143f Use openarray of bytes in md5 (#19307)
* 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
2022-01-15 13:19:05 +01:00
flywind
342b74ef70 move type operation section and remove deepcopy document (#19389)
ref #19173; because deepcopy is not fit for ORC/ARC which was used for spawn and spawn will be removed from compiler
2022-01-15 11:25:09 +01:00
Jason Beetham
7bdfeb7819 Fixed concept constraints for static types (#19391) 2022-01-15 09:24:23 +01:00
Jason Beetham
a93f6e7acc Generic parameters now can constrain statics in type definitions (#19362)
* 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>
2022-01-14 00:39:55 +08:00
flywind
9b9ae8a487 nrvo shouldn't touch bycopy object[backport:1.2] (#19385)
fix nim-lang#19342
2022-01-14 00:39:17 +08:00
Leon
5853303be0 docs: Fix broken cross references to rfind in strutils (#19382) [backport]
Fixes three broken cross references to `rfind` in strutils.
Breakage due to signature changes of the `rfind` methods.

Co-authored-by: adigitoleo <adigitoleo@dissimulo.com>
2022-01-13 14:45:47 +01:00
flywind
40a9c33eff update copyright year (#19381) 2022-01-13 14:43:35 +01:00
Leon
a9135095f0 docs: Mention import foo {.all.} syntax (#19377)
Mention the `import foo {.all.}` syntax in the manual,
with a caveat about private imports.
Also link to the experimental importutils module.

Co-authored-by: adigitoleo <adigitoleo@dissimulo.com>
2022-01-13 14:40:27 +01:00
flywind
ada815e459 make rst thread safe (#19369)
split for the convenience of review
2022-01-13 08:03:14 +01:00
flywind
9a32905d89 nimscript ignore the threads option (#19370)
because nimscript doesn't support threads and causes troubles when the threads option is on
2022-01-13 08:02:41 +01:00
Andreas Rumpf
9888a29c3d bitsets.nim: cleanup (#19361) 2022-01-11 10:16:51 +01:00
flywind
bcbeff3632 remove spaces between an identifier and a star (#19355)
It makes search easier by searching `+`* instead of `+` which filter lots of unexported versions.

Follow https://github.com/nim-lang/Nim/pull/18681
2022-01-10 11:59:44 +01:00
flywind
92e5573b20 fix stylecheck error with asyncdispatch (#19350)
* 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
2022-01-10 10:29:04 +01:00
gecko
955040f0f1 Fix remove on last node of singly-linked list [backport:1.6] (#19353) 2022-01-10 10:27:59 +01:00
Smarcy
b098546da0 added filemode docs (#19346) 2022-01-09 14:02:08 +01:00
flywind
ae92eac060 stylecheck usages part two: stdlib cleanup (#19338)
* stylecheck usages part two: stdlib cleanup

typeinfo.nim: importCompilerProc => importcompilerproc

nre.nim: newLineFlags => newlineFlags

system.nim: JSRoot => JsRoot

ref #19319

* prefer importCompilerProc
2022-01-08 21:34:22 +01:00
Zachary Marquez
58656aa5bb fix nim-lang#19343 (#19344) [backport]
Ensure HttpClient onProgress is called once per second
Ensure that reported speed is accurate
2022-01-08 10:22:56 +01:00