Commit Graph

725 Commits

Author SHA1 Message Date
Timothee Cour
0a10af5a2c privateAccess now works with ref | ptr (#17760) 2021-04-19 00:15:58 +02:00
Timothee Cour
42c6eec4ef fix #17749 ignore SIGPIPE signals, fix nim CI #17748 (#17752)
* fix #17749 SIGPIPE

* fix for windows
2021-04-18 15:34:29 +02:00
flywind
5c5f356347 replace defer with try ... finally (#17753) 2021-04-17 11:48:22 +02:00
Timothee Cour
201ac2b9c9 fix nim CI following #17455 (same postmortem as #17721) (#17740) 2021-04-16 11:26:05 -07:00
Timothee Cour
1b65b9cc19 refs #17292 fix repr: (discard) now does't render as discard which gave illegal code (#17455)
* refs #17292 fix `repr` with (discard)
* add tests
* add more tests
2021-04-16 14:55: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
Andrey Makarov
f8dce493d3 rst indentation fixes (ref #17340) (#17715) 2021-04-15 08:12:44 +02:00
Timothee Cour
e92c78a9ac add number literal jsbigints.big (#17707) 2021-04-13 09:33:28 +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
Andrey Makarov
2150cd1826 restyle RST option lists (#17637)
* WIP: restyle RST option lists

* apply similar style to Latex

* fix tests

* minor visual tweaks

* update tests

* remove leftover comments
2021-04-10 09:49:01 +02:00
flywind
f25243140b add std/tasks (#17447) 2021-04-09 11:51:51 +02:00
Timothee Cour
877cc5e4ff make repr handle setters foo= (#17683) 2021-04-09 09:37:10 +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
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
c7b4639460 ref #14873 (#17644)
* ref #14873

* comment

* Update lib/core/locks.nim
2021-04-06 16:21:58 +02:00
Andrey Makarov
ca405167ed fix :number-lines: regression (#17639) 2021-04-05 08:33:06 +02:00
flywind
70a30317f7 fix #16693: testament spec nimout too lax (#16698)
Co-authored-by: Timothee Cour <timothee.cour2@gmail.com>
2021-04-04 13:47:28 -07:00
Andrey Makarov
f02e159b56 fix rst option list at EOF (follow-up #17442) (#17638) 2021-04-04 11:54:26 -07:00
Timothee Cour
4a11a04fba fix #14850: repr now correctly renders do (#17623)
* fix #14850: `repr` now correctly renders `do`

* add tests

* fix test
2021-04-03 16:05:37 +02:00
Timothee Cour
fe7a76f62f repr: fix rendering of 'big, =destroy etc (#17624) 2021-04-03 08:19:17 +02:00
Andrey Makarov
e35946f306 enable syntax highlighting for inline code (#17585)
* 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>
2021-04-02 22:11:44 +02:00
Timothee Cour
9abd383a2a new genAst as replacement for quote do (#17426)
* 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
2021-04-02 13:11:03 +02: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
Timothee Cour
9b67e5c61b jsonutils: support cstring (including as Table key); improve docs (#16062)
* jsonutils: support cstring (including as Table key); improve docs
* changelog
* un-disable a test now that #16061 was fixed
2021-03-31 18:24:39 +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
flywind
1f1ef85eb0 [std/uri]fix #17481 (#17568) 2021-03-29 11:48:06 -07:00
Andrey Makarov
861c42c258 RST: enable parsing of prefix roles (ref #17340) (#17514) 2021-03-29 18:32: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
flywind
085580a2c8 fix #14010(fix std/registry + arc) (#17551)
* fix nim js cmp fails at CT

* fix #14010

* Update tests/stdlib/tregistry.nim

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

* Update tregistry.nim

Co-authored-by: Timothee Cour <timothee.cour2@gmail.com>
2021-03-29 10:50:58 +02:00
Ardek Romak
207bcabdf2 Add a getter for all defined Sections in parsecfg (#15450) 2021-03-28 09:57:40 -07:00
Timothee Cour
8ed6de4fe6 fix flaky tnetconnect which sometimes failed with: No route to host [OSError] (#17526) 2021-03-27 10:22:42 +01:00
Clyybber
bb3769975b Fix #17199 (#17348)
* don't zero out in a move in the VM

* Add testcases for #17199

* Update tests/arc/tarcmisc.nim

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

* Update tests/vm/tissues.nim

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

* Fix test failures

* Fix test

* Fix tests

Co-authored-by: Andreas Rumpf <rumpf_a@web.de>
Co-authored-by: Timothee Cour <timothee.cour2@gmail.com>
2021-03-26 13:05:51 +01:00
Andrey Makarov
46364e63cd fix RST parsing after option lists (#17442) 2021-03-25 08:15:05 +01:00
Timothee Cour
1590d14575 fix #17260 render \ properly in nim doc, rst2html (#17315) 2021-03-24 10:58:29 +01:00
Timothee Cour
e94aec20da fix #17325 linux 32bit CI; fix #17085 flaky test (#17469) 2021-03-24 10:36:15 +01:00
flywind
465a41c308 [isolation]fix empty ref object bug (#17471)
* fix nim js cmp fails at CT

* [Minor]fix empty ref object for isolation

* Update compiler/isolation_check.nim

* Update compiler/isolation_check.nim

Co-authored-by: Clyybber <darkmine956@gmail.com>

Co-authored-by: Clyybber <darkmine956@gmail.com>
2021-03-24 09:44:24 +01:00
flywind
c015ecdc37 fix #17490 (#17491) 2021-03-24 08:16:41 +01:00
flywind
c719d79d23 add algorithm.merge (#16182)
* add merge to algorithm
* Apply suggestions from code review
* Update lib/pure/algorithm.nim
* Apply suggestions from code review
* Update changelog.md

Co-authored-by: ee7 <45465154+ee7@users.noreply.github.com>
2021-03-23 10:49:02 +01:00
Timothee Cour
1d19cd660f fix #17458 tnetconnect.nim flaky (#17459)
* fix tests

* fix #17458
2021-03-23 08:37:15 +01:00
Timothee Cour
f3a6427109 refs #17292 fix repr with do: (#17449)
* refs #17292 fix `repr` with `do:`

* address comment
2021-03-23 08:34:04 +01:00
Timothee Cour
d78ebe4a0e fix #17454 (#17461) 2021-03-23 08:33:09 +01:00
flywind
83e002a318 follow up #17391 add testcase (#17404)
* Revert "make system random work in VM"

* fix #17380

* attempt to fix bug

* fix

* better

* fix

* a bit

* fix the leaks

* revert

* fix

* better

* follow up #17391

* fix

* Update tchannels.nim

* Update tests/stdlib/tchannels.nim

* Update tchannels.nim
2021-03-19 14:48:31 +08:00
Timothee Cour
2356d0603f followup #17398: getTempDir, getConfigDir now do not have trailing DirSep (#17402)
* followup #17398: `getTempDir`, `getConfigDir` now do not have trailing DirSep

* fix test
2021-03-18 13:25:56 +01:00
Andrey Makarov
4bfc5a9551 Rst test check messages (fix #17280) (#17338) 2021-03-17 20:13:04 +01:00
Andrey Makarov
144e338abb allow short-style rst references with symbols (#17372) 2021-03-17 18:08:13 +01:00
flywind
e9b5543bd5 [std/channels]fix recv leaks(Part One) (#17394) 2021-03-17 10:08:54 +01:00
Timothee Cour
895a40d1ac fix #17383: json.%,to and jsonutils.formJson,toJson now works with uint|uint64 (#17389) [backport:1.2]
* fix #17383: json.%,to and jsonutils.formJson,toJson now works with uint|uint64
* fixup
* fix for js
2021-03-16 21:44:54 +01:00
flywind
84cf3e5fca Revert "make system random work in VM" (#17378) 2021-03-15 10:21:25 +01:00
flywind
a0b8a3d920 New channels implementation for ORC (#17305)
* Update lib/std/channels.nim
* Rename tchannel_pthread.nim to tchannels_pthread.nim
* Rename tchannel_simple.nim to tchannels_simple.nim

Co-authored-by: Mamy Ratsimbazafy <mamy_github@numforge.co>
2021-03-12 13:33:47 +01:00