Commit Graph

8899 Commits

Author SHA1 Message Date
sivchari
980a9ed523 fix comment (#18473) 2021-07-11 02:19:20 -04:00
Antonis Geralis
48ef832cf3 sync with the same template from locks module (#18414) 2021-07-10 08:41:07 +02:00
Andreas Rumpf
4ec2f74246 ORC: support for custom =trace procs (#18459)
* ORC: support custom =trace procs (WIP)
* Update tests/arc/tcustomtrace.nim

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

* =trace is now documented and seems to work
* make test green

Co-authored-by: Clyybber <darkmine956@gmail.com>
2021-07-09 15:15:49 +02:00
flywind
6869157cd1 [docs] improve std/encodings (#18458)
* [docs] improve std/encodings

* tiny

* shrink

* Apply suggestions from code review

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

* Apply suggestions from code review

* Update lib/pure/encodings.nim

Co-authored-by: Varriount <Varriount@users.noreply.github.com>

Co-authored-by: konsumlamm <44230978+konsumlamm@users.noreply.github.com>
Co-authored-by: Varriount <Varriount@users.noreply.github.com>
2021-07-09 07:44:38 +02:00
Ivan Bobev
86f5a56fcd Fix a bug with starting of asynchronous processes (#18464)
The asynchronous process completion handler callback should be called
only once. This is achieved by passing `WT_EXECUTEONLYONCE` flag to the
`registerWaitForSingleObject` Windows API procedure.

Related to cheatfate/asynctools#35
2021-07-08 20:26:49 -04:00
Andrey Makarov
0e44d137f9 rm redundant blank lines before literal blocks (#18465) 2021-07-08 20:24:57 -04:00
Miran
0d74f60742 Revert "Make 'echo' raise IOErrors when appropriate (#16367)" (#18460)
This reverts commit 23d23ecb08.
2021-07-08 16:09:56 +02:00
Timothee Cour
ffce6de84c improve rendering of newOSError.additionalInfo (#18443)
* improve rendering of newOSError.additionalInfo

* fixup
2021-07-07 09:43:16 +02:00
Andreas Rumpf
3eb3e6b9a3 ORC: use =destroy instead of =dispose (#18440)
* ORC refactoring in preparation for further changes (=dispose must die)
* ORC: embrace =destroy, avoid =dispose
* ORC: no need for =dispose
* closes #18421
2021-07-07 09:39:01 +02:00
Timothee Cour
d1447fe25d major improvements to std/wrapnils: optimal codegen, case objects, lvalue semantics (#18435)
* wrapnils now generates optimal code; also handles case objects
* changelog
* unsafeAddr => addr
2021-07-07 06:04:36 +02:00
Timothee Cour
b72ecaf639 fix shebangs #! /xxx => #!/xxx (#18444) 2021-07-07 06:00:59 +02:00
Antonis Geralis
36654fd577 Cleanup interval and timeout procs (#18431)
clear/setTimeout procs were using ref ref Timeout. Added more interval overloads. Corrections.
2021-07-05 19:55:46 +01:00
pyautogui
927a832dde deprecate std/mersenne (#18395)
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>
2021-07-05 10:12:58 -07:00
Andreas Rumpf
1bed777314 fixes #18411 (#18432) [backport:1.4] 2021-07-05 18:04:07 +02:00
Timothee Cour
ffa638ed50 std/net: show addr+port on address already in use error; code-block => runnableExamples (#18428)
* std/net: show addr+port on address already in use error; code-block => runnableExamples

* var=>let
2021-07-05 14:26:40 +02:00
Antonis Geralis
d1d2498c7b Add lent annotation to avoid extra copies in sample (#18404)
* Add lent annotation to avoid extra copies in sample

* Remove lent

* Update random.nim
2021-07-02 23:20:59 +02:00
Timothee Cour
779b4e307b don't use {.rtl.} for generics, otherwise -d:useNimRtl gives ambiguous identifier nimrtl error (#18406) 2021-07-01 11:14:01 +02:00
Endeg
28a4814019 Missing spaces when compiling testament and nim_dbg. (#18403) 2021-06-30 10:19:22 -07:00
Andreas Rumpf
19263f2775 fixes #18400 (#18402) 2021-06-30 12:36:24 +02:00
Bung
16f0b55664 remove isKeywordIgnoreCase from highlite, not used , can't even compile with -d:useNimRtl (#18399) 2021-06-30 07:28:41 +02:00
Elliot Waite
afe5eb569b Add commas to docs for clarity (#18398) 2021-06-29 19:21:30 -07:00
Timothee Cour
36d24846b6 typo: enmRange => enumElementsAsSet (#18394) 2021-06-29 18:08:50 -07:00
Timothee Cour
6387e28963 simplify rdstdin (#18382) 2021-06-28 13:09:14 -07:00
Clyybber
808db3b284 Fix unused warning for $ on empty object (#18381) 2021-06-28 22:01:06 +02:00
Clyybber
6e74fecb42 Simplify addInt, remove digits10 (#18356)
* Simplify addInt, remove digits10

Co-authored-by: Charles Blake <charlechaud@gmail.com>

* Fix bootstrapping

* Add noInit to tmp array

* noInit -> noinit

Co-authored-by: Charles Blake <charlechaud@gmail.com>
2021-06-28 15:00:14 +02:00
gemath
e720bbdd76 Peg captures get stack-like behavior (#18369)
* Implements reverse capture indexing.
* Now works for modified backrefs too.
* Changed reverse indexing syntax prefix for back-references to '$^'.
2021-06-28 12:33:20 +02:00
Andrey Makarov
1b9b806007 rst: fix bug 20 from #17340 (#18360)
and a leftover bug: priority of option list inside definition list
2021-06-26 18:10:46 +02:00
Timothee Cour
b8f761b7e2 even lighter version of #17938: fix most issues with UnusedImport, XDeclaredButNotUsed, etc; fix #17511, #17510, #14246 (without realModule) (#18362)
* {.used: symbol}

* add tests

* fix tests with --import

* --import works without giving spurious unused warnings

* new warning warnDuplicateModuleImport for `import foo; import foo`

* fix test, add resolveModuleAlias, use proper line info for module aliases

* fix spurious warnings

* fix deprecation msg for deprecated modules even with `import foo as bar`

* disable a test for i386 pending sorting XDeclaredButNotUsed errors

* UnusedImport now works with re-exported symbols

* fix typo [skip ci]

* ic support

* add genPNode to allow writing PNode-based compiler code similarly to `genAst`

* fix DuplicateModuleImport warning

* adjust test

* fixup

* fixup

* fixup

* fix after rebase

* fix for IC

* keep the proc inline, move the const out

* [skip ci] fix changelog

* experiment: remove calls to resolveModuleAlias

* followup

* fixup

* fix tests/modules/tselfimport.nim

* workaround tests/deprecated/tmodule1.nim

* fix properly

* simplify
2021-06-26 15:21:46 +02:00
tomc1998
f6bea08eac Add sink annotation to option some() (#18358) 2021-06-25 22:06:24 +02:00
Timothee Cour
8535b26a75 docs now show nimExperimentalX APIs (#18345)
* docs now show nimExperimentalX APIs

* fix for windows
2021-06-25 16:47:10 +02:00
Smooth Operator
6be8a66833 couple tiny typo fixes (#18344) 2021-06-24 18:48:57 +01:00
Timothee Cour
565e07a993 enable VM tracing in user code via {.define(nimVmTrace).} (#18244)
* enable VM tracing in user code via  `{.define(nimVmTrace).}`

* add vmutils.vmTrace

* add vmTrace
2021-06-24 11:55:31 +02:00
Andrey Makarov
0c8d3ae985 rst: allow comment to continue on second line (#18338) 2021-06-24 10:28:28 +02:00
flywind
496bd790e1 [std/times]getTime now uses high resolution API on windows (#17901) 2021-06-23 12:33:19 -07:00
Andreas Rumpf
0eee7f5727 OS.nim: style changes (#18331) 2021-06-23 14:39:10 +02:00
Andrey Makarov
9c43f05099 Markdown: allow to end URL with balanced parenthesis (#18321)
* Markdown: allow to end URL with balanced parenthesis

* Update lib/packages/docutils/rst.nim

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

* apply suggestion

* remove unnecessary if

Co-authored-by: Timothee Cour <timothee.cour2@gmail.com>
2021-06-23 07:50:05 +02:00
Timothee Cour
5badeea170 followup #18318: simplify dollarImpl and add a test (#18330) 2021-06-22 21:42:39 -07:00
flywind
9a81e91fa5 merge similar procs regarding digits (#18318) 2021-06-22 17:02:32 +02:00
mantielero
d8488e41e8 readAsText supports both Blob and File (fixes #18187) (#18189) 2021-06-21 21:19:11 -07:00
xioren
9d3a813fb9 convert code-blocks to runnableExamples in io (#18315)
Co-authored-by: konsumlamm <44230978+konsumlamm@users.noreply.github.com>
2021-06-21 18:56:16 -07:00
flywind
2deb7011f5 fixes #17768 [backport:1.4] (#18317)
* fixes #17768 [backport:1.4]

* tiny
2021-06-21 12:50:47 +02:00
Andrey Makarov
1b3c0f142d validate rst field for :number-lines:, :status: (#18304) 2021-06-20 20:00:42 +02:00
Heiko Nickerl
92cb765714 Raise IndexDefect when deleting element at out of bounds index (#17821)
Co-authored-by: Timothee Cour <timothee.cour2@gmail.com>
Co-authored-by: Heiko Nickerl <mail@hnicke.de>
Co-authored-by: Heiko Nickerl <heiko.nickerl@flipapp.de>
2021-06-20 08:56:33 -07:00
flywind
e45b858f04 [std/terminal] improve docs a bit (#18296)
* Revert "add missing import to asynchttpserver's example"

This reverts commit 7ef364a402.

* alternative to #18185

* add std/mutexes

* cvlose #17696

* Revert "add std/mutexes"

This reverts commit 69abc8b649.

* tiny

* test

* improve terminal docs

* follow advice
2021-06-20 09:57:59 +02:00
Timothee Cour
6030e139b5 move {.injectStmt.} to experimental; add a test (#18300)
* move {.injectStmt.} to experimental; add a test

* undocument and deprecat `.injectStmt` but keep its implementation until we have a replacement
2021-06-20 09:51:07 +02:00
Andrey Makarov
590d457631 docgen: move to shared RST state (fix #16990) (#18256)
* docgen: move to shared RST state (fix #16990)

* Update lib/packages/docutils/rst.nim

Co-authored-by: Andreas Rumpf <rumpf_a@web.de>

* Update lib/packages/docutils/rst.nim

Co-authored-by: Andreas Rumpf <rumpf_a@web.de>

* Update lib/packages/docutils/rst.nim

Co-authored-by: Andreas Rumpf <rumpf_a@web.de>

* Update compiler/docgen.nim

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

* Update compiler/docgen.nim

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

* Update compiler/docgen.nim

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

* Update lib/packages/docutils/rst.nim

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

* rename `cmdDoc2` to `cmdDoc`

* fix (P)RstSharedState convention

* new style of initialization

* misc suggestions

* 1 more rename

* fix a regression

Co-authored-by: Andreas Rumpf <rumpf_a@web.de>
Co-authored-by: Timothee Cour <timothee.cour2@gmail.com>
2021-06-20 09:50:03 +02:00
Timothee Cour
128d21be1c add typetraits.pointerBase to return T in ref T|ptr T (#18293)
* add typetraits.deref to return T in ref T|ptr T

* deref => refBase

* refBase=>pointerBase

* [skip ci] address comment
2021-06-20 09:49:18 +02:00
Timothee Cour
7714ab468a make privateAccess work with generic types and generic instantiations; fix a SIGSEGV (#18260)
Co-authored-by: Andreas Rumpf <rumpf_a@web.de>
2021-06-19 11:24:46 -07:00
Timothee Cour
5600a62229 strformat.fmt now supports non-literal const strings (#18274)
Co-authored-by: Andreas Rumpf <rumpf_a@web.de>
2021-06-18 08:57:51 -07:00
Adrian Veith
5a3456d220 fix for #18284 int32 should be int (#18285)
the var exp was typed as int32 - it should be int since frep expects an int
2021-06-17 11:23:38 +02:00