Commit Graph

8937 Commits

Author SHA1 Message Date
Andreas Rumpf
562dde624f fixes #18371 (#18617) 2021-07-30 12:05:14 +02:00
flywind
c6fadb1799 [minor] reduce substr (#18611)
* minor

* correct

* unify the type of addrLen

* Update lib/packages/docutils/rstgen.nim
2021-07-30 09:32:00 +02:00
Timothee Cour
6b3c77e7f4 Remove tracking of environment from osenv.nim v2 (#18575)
* Remove unnecessary environment tracking

* try to fix windows

* fix delEnv

* make putEnv work on windows even with empty values; improve tests: add tests, add js, vm testing

* [skip ci] fix changelog

Co-authored-by: Caden Haustein <code@brightlysalty.33mail.com>
2021-07-29 23:05:26 +02:00
Vindaar
7d3c3e00ef Allow nnkAccQuoted in genEnumCaseStmt (#18606)
* [enumutils] provide node kind for `Invalid node type` error

* [enumutils] add support for nnkAccQuoted in `genEnumCaseStmt`

For reasons unknown to me, when running `nim doc` on a file that uses
`parseEnum` with an enum that contains accented quotes errors at CT
with the `Invalid node for type` error. Further errors are raised,
probably because the enum parsing fails?
2021-07-29 07:47:34 +02:00
Miran
e616675c41 various small documentation improvements (#18602) 2021-07-28 14:31:13 +02:00
Timothee Cour
4c1202972a fix #17072: add times.dateTime with ISO 8601 order (#18590)
* fix #17072: add times.dateTime with ISO 8601 order

* address comments
2021-07-28 06:38:19 +02:00
Andreas Rumpf
4920b06973 fixes #18543 (#18601)
* fixes #18543

* make tests green again
2021-07-27 19:04:55 +02:00
Andreas Rumpf
6dc34757b6 fixes #18579 (#18600) 2021-07-27 14:32:56 +02:00
konsumlamm
22776c410a Update documentation for dynlib (#17356)
* Update documentation for dynlib

* Apply suggestions

* Improve error handling in example
2021-07-26 19:15:21 -04:00
Antonis Geralis
d4c3a09286 optimize for the non-throwing case (#18587) 2021-07-26 15:22:42 +02:00
Juan Carlos
e08ec0c674 Documentation only, Sugar arrow and semicolons (#18574)
* Document that sugar arrow do not support semicolon as argument separator
2021-07-25 18:07:43 +02:00
Timothee Cour
cc0f02d57d rename nimFpRoundtrips => nimPreviewFloatRoundtrip (#18566) 2021-07-23 14:57:47 -07:00
Timothee Cour
76f74fae88 std/random: fix overflow bugs; fixes #16360; fixes #16296; fixes #17670 (#18456) 2021-07-23 13:41:16 +02:00
Caden Haustein
f62f4159f8 Replace calls to putenv with setenv (#18530)
* Replace calls to C `putenv` with C `setenv` to remove possible memory leaks

* Add test of correct behaviour on invalid input

* Fix style in tests/stdlib/tos.nim

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

* Update tests/stdlib/tos.nim

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

* Update tests/stdlib/tos.nim

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

* Add comment with bug number to tests/stdlib/tos.nim

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

* Fix possible msvc arch issues

Co-authored-by: Timothee Cour <timothee.cour2@gmail.com>
2021-07-23 10:04:29 +02:00
Andreas Rumpf
01fc9e58ca fixes #18550 (#18553)
* fixes #18550

* update the manual to reflect reality
2021-07-21 16:55:50 +02:00
itsumura-h
58080525a1 add [1..2] for JArray (#18525)
* add [1..2] for JArray
* fix BackwardsIndex to int
* fix for BackwardsIndex
* fix for assert node kind check
* fix variable name
* Update lib/pure/json.nim
* fix for when x.a is BackwardsIndex

Co-authored-by: itsumura-h <dumblepy@mail.com>
Co-authored-by: Dominik Picheta <dominikpicheta@googlemail.com>
2021-07-21 15:03:48 +02:00
IterableTrucks
880353c0ad complement notes of two doc strings of tables module (#18527)
* complement notes of two doc strings warning the deprecated  procedure's side effect

* Update lib/pure/collections/tables.nim

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

* Update lib/pure/collections/tables.nim

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

Co-authored-by: BillyZee <billyzee@localhost.localdomain>
Co-authored-by: Andreas Rumpf <rumpf_a@web.de>
Co-authored-by: konsumlamm <44230978+konsumlamm@users.noreply.github.com>
2021-07-21 14:13:50 +02:00
flywind
6f34829ee5 clean unused imports on runnableExamples (#18551) 2021-07-21 13:46:17 +02:00
Andreas Rumpf
9c2442af94 unary slices get a deprecation period (#18549) 2021-07-21 09:46:18 +02:00
Timothee Cour
cf0cf32d27 make -d:nimFpRoundtrips work consistently in vm vs rt, fix #18400, etc (#18531)
* compiler/vmhooks: add getVar to allow vmops with var params
* addFloat vmops with var param
* cgen now renders float32 literals in c backend using roundtrip float to string
2021-07-20 22:13:52 +02:00
flywind
a8b3e7c059 follow up #18517 (#18537)
* follow up #18517

* Update lib/pure/os.nim

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

* Update lib/pure/os.nim

Co-authored-by: Timothee Cour <timothee.cour2@gmail.com>
2021-07-20 15:32:55 +02:00
flywind
dbf8d0b894 use more .} (#18542) 2021-07-20 20:12:15 +08:00
Paul Roberts
6286b5599c termux ssl (#18520) 2021-07-20 12:50:43 +02:00
Araq
e38388eb4e use .} instead of } for code highlighters 2021-07-20 08:36:02 +02:00
Andrey Makarov
8c7ee96457 rst: add missing line/column info for some warnings (#18383)
* rst: add missing line/column info for some warnings

* add workaround

* use TLineInfo/FileIndex for storing file names

* fix blank lines in include file (rm harmful strip)

* don't use ref TLineInfo

* return `hasToc` as output parameter for uniformity

* 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>

* address review - stylistic things

* Update compiler/docgen.nim

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

* unify RST warnings/errors names

* doAssert + minor name change

* fix a bug caught by doAssert

* apply strbasics.strip to final HTML/Latex

* rm redundant filename

* fix test after rebase

* delete `order` from rnFootnoteRef,

also display errors/warnings properly when footnote references are from
different files

* Update compiler/lineinfos.nim

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

* Update lib/packages/docutils/rstast.nim

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

* Update lib/packages/docutils/rstast.nim

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

* Update lib/packages/docutils/rstast.nim

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

* revert because of error:

Error: cannot prove that it's safe to initialize 'info' with the runtime value for the discriminator 'kind'

* Update lib/packages/docutils/rstgen.nim

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

* apply suggestion

* Update lib/packages/docutils/rst.nim

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

* add Table for string->file name mapping

* do not import compiler/lineinfos

* fix ambiguous calls

Co-authored-by: Timothee Cour <timothee.cour2@gmail.com>
Co-authored-by: narimiran <narimiran@disroot.org>
2021-07-20 08:32:22 +02:00
flywind
44c5afe448 [std/os]document checkDir and use runnableExamples (#18517)
Co-authored-by: Timothee Cour <timothee.cour2@gmail.com>
2021-07-19 20:14:04 -07:00
konsumlamm
73ce40aaf7 Revert #17321 (#18521)
Use better names in example
2021-07-19 12:45:13 +02:00
Andreas Rumpf
99c4b69097 fixed system.delete (#18507) 2021-07-18 15:16:26 +02:00
Timothee Cour
adba5eb45e deprecate strutils.delete and add an overload with saner semantics consistent with sequtils.delete; follows #18487 (#18510) 2021-07-18 11:10:08 +02:00
Timothee Cour
3723140044 add NIM_STATIC_ASSERT(CHAR_BIT == 8, "") to fail-fast where assumption is violated (#18512) 2021-07-18 11:05:35 +02:00
Miran
8091545f95 Revert #17398 and #17402 (#18480)
* Revert "followup #17398: `getTempDir`, `getConfigDir` now do not have trailing DirSep (#17402)"

This reverts commit 2356d0603f.

* Revert "fix #17393 getHomeDir and expandTilde should not include trailing `/` (#17398)"

This reverts commit bebf2ce24a.

* fix test
2021-07-18 11:04:19 +02:00
Timothee Cour
923a1c6ea7 fix nativeToUnixPath (#18501) 2021-07-17 07:54:47 +02:00
Andreas Rumpf
25efb53862 make dragonbox opt-in via -d:nimFpRoundtrips (#18504)
* make dragonbox opt-in via -d:nimFpRoundtrips

* make tests green again

* make tests green again
2021-07-16 18:29:49 +02:00
Andreas Rumpf
96a7f9b31c deprecate cuchar, don't redefine it (#18505) 2021-07-16 15:50:02 +02:00
Ivan Bobev
5e6680406f Add changes required by Nimble lock file support (#12104)
Implemented support for Nimble local cache with package directories with
a checksum of the package at the end of their names. Now the compiler
supports package paths in the form:

 * /path_to_nimble_cache_dir/pkgs/package_name-1.2.3-
FEBADEAEA2345E777F0F6F8433F7F0A52EDD5D1B

 * /path_to_nimble_cache_dir/pkgs/package_name-#head-
042D4BE2B90ED0672E717D71850ABDB0A2D19CD2

 * /path_to_nimble_cache_dir/pkgs/package_name-#branch-name-
DBC1F902CB79946E990E38AF51F0BAD36ACFABD9

Related to nim-lang/nimble#127
2021-07-15 22:13:01 +02:00
Timothee Cour
1d6863a789 deprecate sequtils.delete and add an overload with saner semantics consistent with system.delete (#18487)
* deprecate sequtils.delete and add an overload with saner semantics
* AssertionDefect => IndexDefect
* improve tsequtils
* add tests; use splice in js for optimization
2021-07-15 20:54:07 +02:00
Andreas Rumpf
af3d2d8ad9 added nimAllocPagesViaMalloc switch (#18490)
* added  switch

* alloc.nim needs page aligned memory blocks
2021-07-15 17:58:47 +02:00
flywind
15fdcd0c4d workaround #18481 (#18482) 2021-07-13 09:22:33 +02:00
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