summary refs log tree commit diff stats
Commit message (Collapse)AuthorAgeFilesLines
* [nimsuggest] fix def call on identifier 2 times on the line (#20228)Ivan Yonchovski2022-08-305-48/+76
| | | | | | | - apparently TLineInfo's implementation of `==` ignores the column. After I fixed the code to use exact TLineInfo comparison I fixed several other issues hidden by that issue. - Replaced `tuple[sym, info]` with `SymInfoPair`
* fix #19600 No error checking on fclose (#19836)Bung2022-08-292-2/+13
| | | | | * fix #19600 No error checking on fclose * add IOError to open
* Implement complex sgn (#20087)Dan Rose2022-08-281-0/+7
| | | Co-authored-by: Clay Sweetser <Varriount@users.noreply.github.com>
* fixes #17658; add cert dir for ssl ctx (#19920)ringabout2022-08-282-1/+11
| | | | | | | add cert dir for ssl ctx Co-authored-by: Paul Roberts <pmr@stelo.org.uk> Co-authored-by: sandytypical <43030857+xflywind@users.noreply.github.com> Co-authored-by: Clay Sweetser <Varriount@users.noreply.github.com>
* fix `nim md2tex` and `koch pdf` commands (#20280)Andrey Makarov2022-08-282-12/+13
| | | | | * fix `nim md2tex` and `koch pdf` commands * change rst2tex -> md2tex also
* minor updates on manual (#20258)Judd2022-08-271-11/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * minor updates on manual 1. statement -> keyword: 1. re-phase on the explanation of `import except`: maybe the newer version does not export some of the identifiers; 1. "The original module name is then not accessible" is moved up to the previous paragraph, since it is coupled with the previous paragraph, but not the current one. 1. re-phase on the explanation of _Disabling certain messages_. * Apply suggestions from code review Co-authored-by: konsumlamm <44230978+konsumlamm@users.noreply.github.com> * Apply suggestions from code review Co-authored-by: Clay Sweetser <Varriount@users.noreply.github.com> * Update manual.md do not use "()". * Update doc/manual.md Co-authored-by: Clay Sweetser <Varriount@users.noreply.github.com> Co-authored-by: konsumlamm <44230978+konsumlamm@users.noreply.github.com> Co-authored-by: ringabout <43030857+ringabout@users.noreply.github.com> Co-authored-by: Clay Sweetser <Varriount@users.noreply.github.com>
* Fix auto links to subheader when TOC is present (#20279)Andrey Makarov2022-08-276-104/+165
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Fix links to subheader when TOC is present It was observed (in https://github.com/nim-lang/Nim/pull/20112) that links to 2nd- (and subsequent) -level headings fail if TOC is present, e.g.: ```nim .. contents:: Type relations ============== Convertible relation -------------------- Ref. `Convertible relation`_ ``` The problem here is that links are resolved in `rst.nim` but later `rstgen.nim` fixes ("fixes") anchors to make them unique so that TOC always works (if e.g. there was another sub-section like "Convertible relation"). The solution implemented in this PR is to move that fix-up of anchors into `rst.nim`, so that link resolution could know final anchors. The bug seems to be added in https://github.com/nim-lang/Nim/pull/2332 in 2015, that is it is present in Nim 1.0.
* Update manual.md (#20277)Clay Sweetser2022-08-261-3/+2
|
* Add missing rand(var Rand, Ordinal) overload (#20124)Antonis Geralis2022-08-261-14/+32
| | | | | | | | | | | * Add missing rand(var Rand, Ordinal) overload * Corrected mistake, thanks @metagn Co-authored-by: metagn <metagngn@gmail.com> * Update random.nim Co-authored-by: metagn <metagngn@gmail.com>
* remove `var` for ref parameters in `std/tables` (#20175)ringabout2022-08-251-2/+2
| | | remove `var` from ref parameters; make it consistent
* std/options enables stricteffects (#19441)ringabout2022-08-251-4/+8
|
* provide better error messages for large set (#20207)ringabout2022-08-252-4/+8
| | | Co-authored-by: Andreas Rumpf <rumpf_a@web.de>
* remove unused sfProcvar, "procvar" mentions (#20204)metagn2022-08-245-8/+8
| | | refs #12975. doesn't close it because wProcvar isn't removed
* move formatfloat out of system (#20195)ringabout2022-08-2423-176/+201
| | | | | | | | | | | | | | | * move formatfloat out of system * fixes doc * Update changelog.md * careless * fixes * deprecate system/formatfloat * better handling
* fixes nimPreviewSlimSystem; register echoBinSafe for nimPreviewSlimSystem ↵ringabout2022-08-242-0/+8
| | | | | | | (#20194) * register echoBinSafe * add output
* fixes #20227; skip distinct types for genObjConstr [JS backend] (#20229)ringabout2022-08-242-1/+19
| | | fixes #20227; skip distinct types for genObjConstr
* test removing dollar for objects out of system (#20242)metagn2022-08-249-40/+84
| | | | | | | | | | | * test removing dollar for objects out of system * test & fixes * fix bootstrap * use nimPreviewSlimSystem, test stdlib category * fix test
* fixes #20219; ignore comment/empty node in stmtListExpr (#20249)ringabout2022-08-241-0/+4
|
* top-down type inference, implements rfc 149 (#20091)metagn2022-08-2417-199/+599
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * micro implementation of rfc 149 refs https://github.com/nim-lang/RFCs/issues/149 * number/array/seq literals, more statements * try fix number literal alias issue * renew expectedType with if/case/try branch types * fix (nerf) index type handling and float typed int * use typeAllowed * tweaks + const test (tested locally) [skip ci] * fill out more of the checklist * more literals, change @ order, type conversions Not copying the full call tree before the typedesc call check in `semIndirectOp` is also a small performance improvement. * disable self-conversion warning * revert type conversions (maybe separate op later) * deal with CI for now (seems unrelated), try enums * workaround CI different way * proper fix * again * see sizes * lol * overload selection, simplify int literal -> float * range, new @ solution, try use fitNode for nil * use new magic * try fix ranges, new magic, deal with #20193 * add documentation, support templates Co-authored-by: Andreas Rumpf <rumpf_a@web.de>
* Add OpenSSL 3 support (#19814)Federico Ceratto2022-08-235-140/+118
| | | | | | | | | | | | | | | | | | | | | | | | | | | | * Minor refactor * Add OpenSSL 3 support Remove symbols noOpenSSLHacksq and openssl10 * Drop loading of older openssl versions * Add library path * Use only versioned libssl soname os OSX * Update .github/workflows/ci_packages.yml Co-authored-by: Hein Thant <official.heinthanth@gmail.com> * On Mac OS X CI, link OpenSSL in /usr/local/lib/ * Install OpenSSL on Mac OS X on azure pipeline * Remove DYLD_LIBRARY_PATH Co-authored-by: Hein Thant <official.heinthanth@gmail.com> Co-authored-by: Andreas Rumpf <rumpf_a@web.de> Co-authored-by: Hein Thant <official.heinthanth@gmail.com>
* new .redefine pragma for templates, warn on redefinition without it (#20211)metagn2022-08-2319-25/+85
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * test CI for template redefinitions * adapt asyncmacro * fix quote * fix again * try something else * revert * fix ioselectors_select, disable packages CI * adapt more tests & simplify * more * more * more * rename to redefine, warn on implicit redefinition * basic documentation [skip ci] * Update compiler/lineinfos.nim Co-authored-by: konsumlamm <44230978+konsumlamm@users.noreply.github.com> Co-authored-by: konsumlamm <44230978+konsumlamm@users.noreply.github.com>
* Add `doctype: RST|Markdown|RstMarkdown` pragma (#20252)Andrey Makarov2022-08-237-4/+158
| | | | | | | | | | | | | | | | | | | | | | | | * Add `doctype: RST|Markdown|RstMarkdown` pragma Implements https://github.com/nim-lang/RFCs/issues/68 , see also discussion in https://github.com/nim-lang/Nim/issues/17987 The permitted values: * `markdown`, which is default. It still contains nearly all of the RST supported but it is assumed that in time we will give up most or all RST features in this mode * `rst`, without any extensions * `RstMarkdown` — compatibility with Nim 1.x. It's basically RST with those Markdown features enabled that don't conflict with RST. * Apply suggestions from code review Co-authored-by: Clay Sweetser <Varriount@users.noreply.github.com> * Additional fix in spirit of review * Fix test after #20188 Co-authored-by: Clay Sweetser <Varriount@users.noreply.github.com>
* remove some deprecated pre-1.0 stdlib modules (#20202)metagn2022-08-2313-980/+18
| | | | | | | | | | | | | | | * remove pre-1.0 stdlib deprecations notable exceptions: * ze, toU8 etc in system/arithmetics * potentially callsite * undo macros, ospaths, securehash, oswalkdir * add sets back * add back future, document deprecated versions * add to changelog [skip ci]
* fixes #18983 #5282 #13008; recursive types casue infinite type (#20172)ringabout2022-08-233-2/+39
| | | | | | | * fixes #18983 #5282 #13008; recursive types casue infinite type * re * add testcases
* remove {.this.} pragma, deprecated since 0.19 (#20201)metagn2022-08-2313-158/+28
| | | Co-authored-by: Andreas Rumpf <rumpf_a@web.de>
* remove echo statements in tests (part 1) (#20178)ringabout2022-08-239-47/+7
| | | | | | | | | | | * remove echo statements * Update tests/vm/triangle_array.nim * Update tests/vm/tyaytypedesc.nim Co-authored-by: konsumlamm <44230978+konsumlamm@users.noreply.github.com> Co-authored-by: konsumlamm <44230978+konsumlamm@users.noreply.github.com>
* remove a special case in sigmatch; distinct pointer types no longer match ↵ringabout2022-08-234-15/+30
| | | | | | | | | | | | | | | | `nil` type (#20251) * remove a special case in sigmatch; distinct pointer types no longer match `nil` type * add tests * fixes tests * Update changelog.md Co-authored-by: konsumlamm <44230978+konsumlamm@users.noreply.github.com> Co-authored-by: Andreas Rumpf <rumpf_a@web.de> Co-authored-by: konsumlamm <44230978+konsumlamm@users.noreply.github.com>
* remove unused nimfind defines (#20250)ringabout2022-08-231-23/+8
| | | remove unused nimfind
* fixes #19973; switch to poll on posix (#20212)ringabout2022-08-231-11/+28
| | | | | | | | | | | | | | | | | * fixes #19973; switch to poll on posix * it is fd * exclude lwip * fixes lwip * rename select to timeoutRead * refactor into timeoutRead/timeoutWrite * refactor common parts Co-authored-by: xflywind <43030857+xflywind@users.noreply.github.com>
* remove `shallow` usages for ORC (#20109)ringabout2022-08-233-4/+8
|
* fixes #19967; reset does not work on set [backport: 1.2] (#19968)ringabout2022-08-232-1/+41
| | | | | | | | | | | | | * fixes #19967 * use case * add testcase * fix typos * explictly specify other branches Co-authored-by: xflywind <43030857+xflywind@users.noreply.github.com>
* fixes doc building regression; trigger builds on markdown files (#20260)ringabout2022-08-231-2/+4
| | | fix doc building regression; trigger builds on markdown files
* fixes manual regression (#20259)ringabout2022-08-231-0/+2
| | | ref https://github.com/nim-lang/Nim/pull/20080
* fixes #20162; locals doesn't work with ORC [backport] (#20163)ringabout2022-08-232-1/+2
| | | fixes #20162; locals doesn't work with ORC
* document compiler procs regarding `&` (#20257)ringabout2022-08-223-2/+8
|
* add comments back (#20256)ringabout2022-08-211-0/+3
| | | My bad, I shouldn't have removed it in the precedent PR.
* remove the merge pragma and obsolete comments (#20254)ringabout2022-08-211-7/+4
| | | remove the merge pragma which has been deprecated for seven years
* Docs auto dark mode (#20188)Amjad Ben Hedhili2022-08-218-174/+136
| | | | | | | | | | | | | * Implement auto dark mode * Rename class * Fix borders cutout * Apply suggestions from code review * Apply suggestions from code review Co-authored-by: ringabout <43030857+ringabout@users.noreply.github.com>
* fixes #11953; jsondoc creates no files unless the htmldocs dir is created ↵ringabout2022-08-202-0/+18
| | | | | | | | | (#20198) * fixes #11953; jsondoc creates no files unless the htmldocs dir is created * target * fixes runner
* Remove string == nil/nil == string error (#20222)metagn2022-08-201-23/+0
| | | | | | | * Remove string == nil/nil == string error This was to help migration for `nil` strings being removed, but `nil` strings have been gone for a while now. * remove isNil too
* Add use of Windows Wide CRT API for env. vars (#20084)havardjohn2022-08-206-45/+263
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Add use of Windows Wide CRT API for env. vars Replaces use of CRT API `getenv` and `putenv` with respectively `_wgetenv` and `_wputenv`. Motivation is to reliably convert environment variables to UTF-8, and the wide API is best there, because it's reliably UTF-16. Changed the hack in `lib/std/private/win_setenv.nim` by switching the order of the Unicode and MBCS environment update; Unicode first, MBCS second. Because `_wgetenv`/`_wputenv` is now used, the Unicode environment will be initialized, so it should always be updated. Stop updating MBCS environment with the name of `getEnv`. It's not necessarily true that MBCS encoding and the `string` encoding is the same. Instead convert UTF-16 to current Windows code page with `wcstombs`, and use that string to update MBCS. Fixes regression in `6b3c77e` that caused `std/envvars.getEnv` or `std/os.getEnv` on Windows to return non-UTF-8 encoded strings. Add tests that test environment variables with Unicode characters in their name or value. * Fix test issues Fixes * `nim cpp` didn't compile the tests * Nimscript import of `tosenv.nim` from `test_nimscript.nims` failed with "cannot importc" * Fix missing error check on `wcstombs` * Fix ANSI testing errors * Separate ANSI-related testing to their own tests, and only executing them if running process has a specific code page * Setting locale with `setlocale` was not reliable and didn't work on certain machines * Add handling of a "no character representation" error in second `wcstombs` call * tests/newruntime_misc: Increment allocCount Increments overall allocations in `tnewruntime_misc` test. This is because `getEnv` now does an additional allocation: allocation of the UTF-16 string used as parameter to `c_wgetenv`. * Revert "tests/newruntime_misc: Increment allocCount" This reverts commit 4d4fe8bd3edb1bfc6d600f247af797c7552f5477. * tests/newruntime_misc: Increment allocCount on Windows Increments overall allocations in `tnewruntime_misc` test for Windows. This is because `getEnv` on Windows now does an additional allocation: allocation of the UTF-16 string used as parameter to `c_wgetenv`. * Refactor, adding suggestions from code review Co-authored-by: Clay Sweetser <Varriount@users.noreply.github.com> * Document, adding suggestions Co-authored-by: Clay Sweetser <Varriount@users.noreply.github.com> Co-authored-by: ringabout <43030857+ringabout@users.noreply.github.com> Co-authored-by: Clay Sweetser <Varriount@users.noreply.github.com>
* fixes #20149; fixes #16762; hintAsError and warningAsError now ignore ↵ringabout2022-08-194-8/+14
| | | | | | | | | | | | | | | | | | | foreign packages (#20151) * fixes #20149; hintAsError/warningAsError ignores foreign packages * add changelog * fixes the test * remove * fixes tests again * fix * I'm careless Co-authored-by: xflywind <43030857+xflywind@users.noreply.github.com>
* make sure tools/heapdumprepl.nim continues to compile (#20146)ringabout2022-08-191-4/+2
|
* make implicit cstring conversions explicit (#19488)ee72022-08-1914-63/+63
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The Nim manual says that an implicit conversion to cstring will eventually not be allowed [1]: A Nim `string` is implicitly convertible to `cstring` for convenience. [...] Even though the conversion is implicit, it is not *safe*: The garbage collector does not consider a `cstring` to be a root and may collect the underlying memory. For this reason, the implicit conversion will be removed in future releases of the Nim compiler. Certain idioms like conversion of a `const` string to `cstring` are safe and will remain to be allowed. And from Nim 1.6.0, such a conversion triggers a warning [2]: A dangerous implicit conversion to `cstring` now triggers a `[CStringConv]` warning. This warning will become an error in future versions! Use an explicit conversion like `cstring(x)` in order to silence the warning. However, some files in this repo produced such a warning. For example, before this commit, compiling `parsejson.nim` would produce: /foo/Nim/lib/pure/parsejson.nim(221, 37) Warning: implicit conversion to 'cstring' from a non-const location: my.buf; this will become a compile time error in the future [CStringConv] /foo/Nim/lib/pure/parsejson.nim(231, 39) Warning: implicit conversion to 'cstring' from a non-const location: my.buf; this will become a compile time error in the future [CStringConv] This commit resolves the most visible `CStringConv` warnings, making the cstring conversions explicit. [1] https://github.com/nim-lang/Nim/blob/d2318d9ccfe6/doc/manual.md#cstring-type [2] https://github.com/nim-lang/Nim/blob/d2318d9ccfe6/changelogs/changelog_1_6_0.md#type-system
* Adds missing SEEK_ POSIX constants for FreeRTOS (#20241)jgirvin-venturi2022-08-191-0/+4
|
* fixes #20107 (#20246) [backport]Andreas Rumpf2022-08-192-0/+38
|
* Markdown code blocks part 5 (#20236)Andrey Makarov2022-08-1721-413/+486
| | | No logic was added, just a few more `*.md` files have been migrated.
* fix comment in the Nim manual (#20234)Judd2022-08-171-1/+1
| | | | | fix comment there is no `y` in the example.
* Don't require blank line before Markdown code (#20215)Andrey Makarov2022-08-154-9/+53
| | | | Fixes bug reported in https://github.com/nim-lang/Nim/pull/20189 affecting nimforum.
* Pass check condition directly to if (#20217)Dan Rose2022-08-151-2/+6
| | | | | | | | | | | | | | | | | | When checking conditions, pass `check` untyped argument directly to if. This results in better error messages when the condition is malformed. Previously `check 1` would fail at compile time with `Error: type mismatch: got 'int literal(-2)' for '-2' but expected 'bool'` Now it fails with `Error: type mismatch: got 'int literal(1)' for '1' but expected 'bool'`. Similarly `check "foo"` would fail with ``` Error: type mismatch: got <string> but expected one of: proc `not`(a: typedesc): typedesc first type mismatch at position: 1 required type for a: typedesc but expression '"somestring"' is of type: string ... ``` Now it fails with `Error: type mismatch: got 'string' for '"somestring"' but expected 'bool'`