Commit Graph

5108 Commits

Author SHA1 Message Date
Timothee Cour
e4db733d80 fix #17888: remove undefined behavior for posix.open; fix tempfiles.createTempFile (#17889)
* fix #17888: remove undefined behavior for posix.open; fix tempfiles.createTempFile

* fix for tests/async/tasyncfile.nim

* hide mode for now

* add notice regarding stability
2021-04-29 13:42:56 +02:00
flywind
5edddd68d0 improve cache line size (#17885)
* improve cache line size

- 64bit system tend to use cache line of 64 bytes
- add align

https://trishagee.com/2011/07/22/dissecting_the_disruptor_why_its_so_fast_part_two__magic_cache_line_padding


Though I'm not sure, what do you think? @timotheecour

* Update lib/pure/concurrency/threadpool.nim
2021-04-29 13:39:36 +02:00
flywind
016a8ccd7a [std/encodings]move to tests (#17866) 2021-04-29 09:51:54 +02:00
Michael Krieger
7637cff9cf Fix documentation of strutils.stripLineEnd (#17883)
It does not return anything.
2021-04-28 11:33:08 -07:00
flywind
d881a05bf6 [std/encodings] fix iconv headers on OpenBSD (#17872) 2021-04-27 10:14:26 -07:00
flywind
66022423aa [std/pegs] increase test coverage (#17871) 2021-04-27 11:09:58 +02:00
flywind
b1c7c994b0 [std/parsecfg]use runnableExamples (#17868)
* [std/parsecfg]use runnableExamples
* Apply suggestions from code review

Co-authored-by: Timothee Cour <timothee.cour2@gmail.com>
2021-04-27 10:24:59 +02:00
Timothee Cour
3f58b7face add -d:nimLegacyNoHashRef for a transition period which avoids defining hash(ref) (#17858) 2021-04-27 08:23:01 +02:00
flywind
01bca8cd4f fix gbk encodings on windows (#17843) 2021-04-26 14:48:25 +02:00
flywind
68e522ecec Remove confusing <//> (#17830) 2021-04-26 09:04:52 +02:00
flywind
6e8f0f8cfc add colon (#17834) 2021-04-24 18:33:29 +01:00
Joey
f1ce173283 Fix Httpclient headers from being modified accidentally (#17808) 2021-04-21 07:42:04 +02:00
Andreas Rumpf
a9b62de895 CIs: attempt to use csources_v1 (#16282)
* CIs: attempt to use csources_v1
* also updated the BSDs
* also updated azure pipelines
* std modules should not itself use the 'std/' import dir...
* compiler has to be careful with std/ for v1 booting
2021-04-21 07:41:33 +02:00
flywind
eb221dcc27 [std/deques] move data instead of copy + destroy (#17800) 2021-04-20 19:00:44 +02:00
shirleyquirk
fdd4391534 Fix buffer-overrun bug in net (#17728) [backport:1.0] 2021-04-16 14:22:51 +02:00
Timothee Cour
d19e4310dc std/hashes: hash(ref|ptr|pointer) + other improvements (#17731) 2021-04-16 14:21:26 +02:00
Timothee Cour
611b88763f start using import {.all.} (#17736) 2021-04-16 12:54:49 +02:00
Timothee Cour
d6242d7fe1 simplify asyncfutures, asyncmacro (#17633) 2021-04-14 21:22:22 +02:00
flywind
8b5769133c remove unnecessary assignment (#17702) 2021-04-12 08:58:46 +02:00
shirleyquirk
0bc943ad54 followup strformat PR. backslash escapes, tests, docs (#17700)
* 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>
2021-04-12 07:32:37 +02:00
shirleyquirk
a5b30c94c2 [feature] add arbitrary code execution to strformat (#17694)
* 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>
2021-04-11 13:07:23 +02:00
Emery Hemingway
8aa5991bea Genode platform fixes (#17521)
* 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
2021-04-09 16:29:10 +02:00
Andreas Rumpf
86a1dcf928 hashes: Made the runnableExample easier to understand (#17689) 2021-04-09 15:36:06 +02:00
Andrey Makarov
42687457b0 further progress on rst roles & directives (fix #17646) (#17659)
* further progress on rst roles & dir-s (fix #17646)

* fix documents according to the messages

* fix bug 17 from #17340
2021-04-08 19:00:14 +02:00
konsumlamm
1b03accac7 Improve endians module (#17674)
Extend documentation
Add runnableExamples
2021-04-08 14:08:58 +02:00
Andreas Rumpf
643dbc743b use strstr for a faster find implementation (#17672)
* use strstr for a faster find implementation
* stress the -d:release and -d:danger switches
2021-04-08 00:54:47 +02:00
flywind
834d5641e8 use sink and lent in deques (#17661)
* 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>
2021-04-07 14:17:48 +02:00
flywind
34c1c631bb close #4451 (#17627) 2021-04-06 22:08:59 +02:00
Miran
020c0a3344 don't run one example on 32-bit machines (#17655)
This example seems to break our 32-bit nightlies builds.

This is just a temporary solution (TM) until we figure out a better one.
2021-04-06 18:52:12 +02:00
Timothee Cour
97764c8dc9 remove un-needed {.push hint[ConvFromXtoItselfNotNeeded]: off.} in asyncfutures, asyncmacro (#17631) 2021-04-03 15:24:01 -07:00
flywind
a807233aeb fix #17615(runnableExamples silently ignored if placed after some code) (#17619)
Co-authored-by: Timothee Cour <timothee.cour2@gmail.com>
2021-04-02 18:26:30 -07:00
flywind
07991d902e [docs minor] close #17618 (#17620)
* [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>
2021-04-02 22:06:29 +02:00
flywind
792a03b756 [docs minor] close #16553 (#17612)
Co-authored-by: Timothee Cour <timothee.cour2@gmail.com>
2021-04-02 00:18:40 -07:00
konsumlamm
f0587e02e2 Fix #17017 (math edge cases) (#17588)
* Fix #17017

Add more test cases

* USe signbit in example
2021-04-01 12:47:56 +02:00
Dominik Picheta
65efa727ff Removes asynchttpserver.getSocket. (#17587) 2021-03-31 18:20:42 +02:00
Timothee Cour
72988509ba add getPort to resolve Port(0) (#17559)
* add getPort to resolve Port(0)

* fixup

* use getPort in examples + tests

* address comments: do not re-export Port
2021-03-30 20:14:39 +02:00
rockcavera
af2a7e8cbc Rotation right and left refactored to generics. Continuation of #16622 (#17578)
* Rotation right and left refactored to generics

Continuation of [16622](https://github.com/nim-lang/Nim/pull/16622)

* add runnableExamples
2021-03-30 12:24:21 +02:00
Ardek Romak
9e88425d7c Fix void async in templates (#17562)
* Fix https://github.com/nim-lang/Nim/issues/16159
* Add test for async in template
* Shorten the expression
* Even shorter

Co-authored-by: Clyybber <darkmine956@gmail.com>
2021-03-30 08:07:45 +02:00
Dylan Modesitt
35655cd189 Add hasDataBuffered to asyncnet (#16000)
Co-authored-by: flywind <xzsflywind@gmail.com>
Co-authored-by: Timothee Cour <timothee.cour2@gmail.com>
2021-03-29 16:12:58 -07:00
flywind
1f1ef85eb0 [std/uri]fix #17481 (#17568) 2021-03-29 11:48:06 -07:00
flywind
e2269f9216 [docs]fix #17473 (#17565)
* fix nim js cmp fails at CT

* Add `hasClosure` to `std/effecttraits`

* type

* Update changelog.md

Co-authored-by: Timothee Cour <timothee.cour2@gmail.com>

* fix #14011

* Delete ttypetraits.nim

* Apply suggestions from code review

* fix #17473

* Revert "fix #14011"

This reverts commit 0eed97a84b.

* Update lib/system.nim

Co-authored-by: konsumlamm <44230978+konsumlamm@users.noreply.github.com>

Co-authored-by: Timothee Cour <timothee.cour2@gmail.com>
Co-authored-by: Andreas Rumpf <rumpf_a@web.de>
Co-authored-by: konsumlamm <44230978+konsumlamm@users.noreply.github.com>
2021-03-29 14:39:49 +02:00
flywind
81e54c1d30 Add hasClosure to std/typetraits (#17501)
* fix nim js cmp fails at CT

* Add `hasClosure` to `std/effecttraits`

* type

* Update changelog.md

Co-authored-by: Timothee Cour <timothee.cour2@gmail.com>

* Update lib/std/effecttraits.nim

Co-authored-by: Timothee Cour <timothee.cour2@gmail.com>
Co-authored-by: Andreas Rumpf <rumpf_a@web.de>
2021-03-29 14:22:29 +02:00
Danil Yarantsev
89e0e0f27f Small doc fixes in net (#17566) 2021-03-29 13:06:23 +02:00
ben
e45b1e3f36 Fix net.readLine infine loop #17534 (#17535)
* Fix net.readLine infine loop #17534

* fix #17534 add return to template
2021-03-29 11:24:15 +02:00
Danil Yarantsev
b36182b0a4 Free the certificate after checking in checkCertName (#17558) [backport:1.2]
* Fix small leak in checkCertName
* Size is not needed either
* Free the certificate after checking
2021-03-29 10:49:19 +02:00
flywind
a36816fc04 follow up #17539 (#17548)
* fix nim js cmp fails at CT

* follow up #17539
2021-03-29 09:11:07 +08:00
Ardek Romak
207bcabdf2 Add a getter for all defined Sections in parsecfg (#15450) 2021-03-28 09:57:40 -07:00
Timothee Cour
a65189a739 nnkArglist => nnkArgList + special case stylecheck:error (#17529)
* nnkArglist => nnkArgList

* special case stylecheck:error
2021-03-27 10:28:11 +01:00
flywind
8573160a44 lent support for tables (#17505) 2021-03-25 14:05:50 +01:00
Timothee Cour
e94aec20da fix #17325 linux 32bit CI; fix #17085 flaky test (#17469) 2021-03-24 10:36:15 +01:00