Commit Graph

756 Commits

Author SHA1 Message Date
Timothee Cour
d217888e56 close #18009 parseJson JInt vs JFloat; preserve -0.0 as JFloat to distinguish from 0.0 (#18067) 2021-05-23 23:06:14 +02:00
Andrey Makarov
9f7e2e3057 docs: make inline markup more compatible with Markdown (#18053)
fixes https://github.com/timotheecour/Nim/issues/739
2021-05-21 06:54:20 +02:00
Timothee Cour
7f077a76fe jsonutils: add customization for toJson via ToJsonOptions; generalize symbolName; add symbolRank (#18029)
* jsonutils: add customization for toJson via `ToJsonOptions`

* add enumutils.symbolRank

* lookup table implementation for HoleyEnum

* cleanup

* changelog

* fixup

* Update lib/std/jsonutils.nim

Co-authored-by: Andreas Rumpf <rumpf_a@web.de>
2021-05-18 15:10:19 +02:00
Andrey Makarov
2096490b59 follow-up #17930 - inline syntax highlighting (#18013)
* follow-up #17930 - inline syntax highlighting

* make closure->nimcall
2021-05-16 23:55:14 +02:00
Timothee Cour
d83b25db1e fix #18007: std/json now serializes nan,inf,-inf as strings instead of invalid json (#18026)
* fix #18007: std/json now serializes nan,inf,-inf as raw strings instead of invalid json

* fix roundtrip

* fix tests

* fix changelog

* simplify

* add runnableExamples

* fix typo [skip ci]
2021-05-16 23:54:10 +02:00
Andrey Makarov
3824fd3f9a RST opt.list to have priority over def.list (#17845) 2021-05-15 08:12:26 +02:00
Andreas Rumpf
4857c462d5 Revert "fix #14873 properly by skipping abi field in importc type (#17944)" (#17992)
This reverts commit 98c29c01eb.
2021-05-15 06:50:39 +02:00
Timothee Cour
2ce592a209 refs #18011 disable some newly failing tests on cpp windows; refs #17946 increase timeout for tchannels (#18012) 2021-05-14 15:33:17 -07:00
Timothee Cour
1e080eb9b4 jsonutils: handle holey enum as regular enum, via ord (#17995) 2021-05-11 22:49:47 +02:00
Timothee Cour
a770c98e27 jsonutils: support set (#17994) 2021-05-11 21:09:17 +02:00
Timothee Cour
e60672141a improve std/tempfiles (#17920)
* improve std/tempfiles
* fixup
* fix windows
* improve test
* improve runnableExamples and tests
* address comment
2021-05-11 16:35:43 +02:00
Timothee Cour
45490497e3 fix #17467 1st call to rand is now non-skewed; allow seed == 0 (#17468)
* fix #17467 1st call to rand is now non-skewed; allow passing 0 as seed

* changelog + fallback

* document behavior for seed == 0

* address comments

* _

* fix tests, disable kdtree

* re-enable kdtree with -d:nimLegacyRandomInitRand
2021-05-11 11:04:59 +02:00
Andreas Rumpf
983a2aa11c Revert "Fix parseUri to sanitize urls containing ASCII newline or tab (#17967)" (#17984)
This reverts commit f4dd95f3be.
2021-05-09 23:33:31 +02:00
Beshr Kayali
f4dd95f3be Fix parseUri to sanitize urls containing ASCII newline or tab (#17967)
* Fix parseUri to sanitize urls containing ASCII newline or tab

* Fix ups based on review

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

* Additional fix ups based on review

- Avoid unnecessary `removeUnsafeBytesFromUri` call if parseUri is strict
- Move some parseUri tests to uri module test file

Co-authored-by: Dominik Picheta <dominikpicheta@googlemail.com>

* Update changelog

Co-authored-by: Timothee Cour <timothee.cour2@gmail.com>
Co-authored-by: Dominik Picheta <dominikpicheta@googlemail.com>
2021-05-09 19:24:00 +01:00
Timothee Cour
4e0f38fbb1 testament :show duration also for failed tests; improve tshould_not_work; mitigate #17946 tchannels timeouts (#17947)
* refs #17946; refactor testament test summary, show test duration for failures; increase timeout tchannels

* revert workarounds from https://github.com/nim-lang/Nim/pull/16698 and add allowPrefixMatch optional param to greedyOrderedSubsetLines

* add test

* workaround for yet another testament bug
2021-05-08 17:13:47 +02:00
Timothee Cour
9ca3218a6d improve tbase64.nim (#17964) 2021-05-07 17:40:16 -07:00
Timothee Cour
98c29c01eb fix #14873 properly by skipping abi field in importc type (#17944)
* fix #14873 properly by skipping `abi` field in importc type

* add test

* fix test for windows
2021-05-07 19:36:41 +02:00
Andrey Makarov
436af88d8c follow-up #17837: add Console for interactive sessions (#17930)
* follow-up #17837: add `Console` for interactive sessions

* fix Latex
2021-05-06 10:58:01 +02:00
Andrey Makarov
287f1170ba highlite: fix #17890 - tokenize Nim escape seq-s (#17919)
* highlite: fix #17890 - tokenize Nim escape seq-s

* Update tests/stdlib/thighlite.nim

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

Co-authored-by: Timothee Cour <timothee.cour2@gmail.com>
2021-05-03 10:21:36 +02:00
Timothee Cour
78e2d299df typo: nonexistant => nonexistent (#17918)
* typo: nonexistant => nonexistent

* fix test (ordering differs because of https://github.com/nim-lang/Nim/issues/17910)
2021-05-02 00:26:41 +02:00
Timothee Cour
ee6d56141c fix #17911 rawProc for cpp (#17912) 2021-05-01 11:12:13 +02:00
Andrey Makarov
abb8a73134 Fix nim-lang/nimforum#285 - punctuation after URL (#17908)
* Fix nim-lang/nimforum#285 - punctuation after URL
* keep only one leaf in a rnStandaloneHyperlink
* add more complex URL
2021-05-01 07:20:33 +02:00
Timothee Cour
3192995ac9 close #16646; since now works with bootstrap nim post csources_v1 (#17895)
* revive #16627 now that csources_v1 was merged

* use dedent in rst.nim, refs https://github.com/nim-lang/Nim/pull/17257#discussion_r589025683

* fix test and improve rendering of a rst warning
2021-04-30 18:54:47 +02:00
Andrey Makarov
1640508348 more strict RST inline markup parsing (#17827)
* more strict RST inline markup parsing
* add test for unexpected bonus
* introduce `roPreferMarkdown`
2021-04-29 17:31:15 +02:00
flywind
016a8ccd7a [std/encodings]move to tests (#17866) 2021-04-29 09:51:54 +02:00
flywind
66022423aa [std/pegs] increase test coverage (#17871) 2021-04-27 11:09:58 +02:00
flywind
01bca8cd4f fix gbk encodings on windows (#17843) 2021-04-26 14:48:25 +02:00
Timothee Cour
b667e288e2 move travis, appveyor, ci.yml.disabled to unmaintained/ (#17828)
* move travis, appveyor, ci.yml.disabled to unmaintained

* update some mentions of travis, appevyor

* fix test
2021-04-24 07:54:31 +02:00
Sivchari
fb32fff8dc js generates spurious >>> on shr (#17767)
* js generates spurious >>> on shr
* Add shr arithmetic test
* fix variables from const to let during testing
2021-04-21 19:47:01 +02:00
Andrey Makarov
8f79bc5f3d add RST highlighting for command line / shells (also fixes #16858) (#17789) 2021-04-21 16:57:54 +02:00
flywind
c631648cb3 close #9372 add std/tempfiles (#17361)
* close #9372 add std/tempfile
2021-04-21 15:07:36 +02:00
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