Commit Graph

20429 Commits

Author SHA1 Message Date
ringabout
c651817ffd fixes devel CI (#20512) 2022-10-07 15:00:15 +02:00
ringabout
079363bfc3 remove implicit let/var default initialization (#20508) 2022-10-07 07:49:27 +02:00
Andreas Rumpf
0d23419e68 DAA and 'out' parameters (#20506)
* DAA and 'out' parameters

* progress

* documented strictDefs and out parameters

* docs, tests and a bugfix

* fixes silly regression
2022-10-06 17:08:41 +02:00
ringabout
e323b91a32 correct grammar (ref #20199) and add check for grammar.txt (#20494)
* correct grammar; ref #20199

* add check for keeping grammar.txt up-to-date

* add nimTestGrammar
2022-10-06 16:36:32 +02:00
ringabout
114acff98d closes #9401; add testcase (#20507) 2022-10-06 13:51:42 +08:00
Juan Carlos
c273496d18 Add no-math-errno for GCC when build for Release (#20503)
* gcc matherrno
* changelog
2022-10-06 07:19:41 +02:00
Ivan Yonchovski
7caa037936 Fix/improve handling of forward declarations in nimsuggest (#20493)
* Fix/improve handling of forward declarations in nimsuggest

- ideUse now works fine when invoked on the implementation
- implemented ideDeclaration to make cover lsp feature textDocument/declaration
- fixed performance issue related to deduplicating symbols. Now the
deduplication happens after the symbols are filtered. As a alternative we might
change the way cached symbols are stored(e. g. use set).
- I also fixed the way globalSymbols work. Now it will sort the responses based
on the match location to make sure that the results are sorted in user friendly way.

* Update nimsuggest/nimsuggest.nim

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

Co-authored-by: Andreas Rumpf <rumpf_a@web.de>
2022-10-06 07:18:46 +02:00
ringabout
723a71bd22 follow up #20109; remove shallow seqs/strings for ORC (#20502)
* remove `shallow` seqs/strings for ORC

* add a changelog item

* change url of DelaunayNim
2022-10-06 07:16:50 +02:00
Matt Haggard
964afd3050 Make output assertion deterministic for test for #7172 (#20495)
Co-authored-by: Clay Sweetser <Varriount@users.noreply.github.com>
2022-10-05 20:14:22 -04:00
ringabout
a600dfa5b7 closes #11267; closes #11259; closes #11085; add testcases (#20505)
* closes #11267; add testcase

* closes #11259

* closes #11085
2022-10-06 02:30:10 +08:00
Andrey Makarov
6505bd347d Markdown indented code blocks (#20473)
* Implement Markdown indented code blocks

Additional indentation of 4 spaces makes a block an "indented code block"
(monospaced text without syntax highlighting).
Also `::` RST syntax for code blocks is disabled.

So instead of
```rst
see::

  Some code
```

the code block should be written as
```markdown
see:

    Some code
```

* Migrate RST literal blocks :: to Markdown's ones
2022-10-05 14:03:10 -04:00
Matt Haggard
594e93a66b macOS use SecRandomCopyBytes instead of getentropy (#20466)
* On macOS use SecRandomCopyBytes instead of getentropy (which is only available on macOS 10.12+)

* Change passL to passl
2022-10-05 13:59:10 -04:00
ee7
10355cb48a strutils, rstgen: avoid deprecated strutils.delete (#20488)
The strutils `delete` func with signature

    func delete*(s: var string, first, last: int)

was deprecated in adba5eb45e, in favor of one with signature

    func delete*(s: var string, slice: Slice[int])

However, a few procedures still used the deprecated form. This commit
updates them, resolving these deprecation warnings:

    rstgen.nim(766, 12) Warning: use `delete(s, first..last)`; delete is deprecated [Deprecated]
    strutils.nim(1651, 19) Warning: use `delete(s, first..last)`; delete is deprecated [Deprecated]
    strutils.nim(1679, 7) Warning: use `delete(s, first..last)`; delete is deprecated [Deprecated]
    strutils.nim(2472, 7) Warning: use `delete(s, first..last)`; delete is deprecated [Deprecated]

Before this commit:

- `trimZeros` called `s.delete(i+1, i)` for an input that lacks a
  trailing zero (like "1.23").

- `removePrefix*(s: var string, prefix: string)` called
  `s.delete(0, -1)` when the prefix was the empty string.

which did not modify `s`, nor raise an error. But the newer slice
`delete` raises an `IndexDefect` when the start of the slice is greater
than the end, so we avoid calling the new `delete` for such a case.

Recall that exceptions inheriting from `system.Defect` are not tracked
with the `.raises: []` exception tracking mechanism [1], so this commit
does not break existing code like:

    proc foo {.raises: [].} =
      var s = "abc1.20"
      s.removePrefix("abc")
      s.trimZeros()
      doAssert s == "1.2"

The `strutils.delete` deprecation was motivated by a problem with
`system.delete` [2][3]:

    `system.delete` had surprising behavior when the index passed to it
    was out of bounds (it would delete the last entry then). Compile
    with `-d:nimStrictDelete` so that an index error is produced
    instead.

    Be aware however that your code might depend on this quirky behavior
    so a review process is required on your part before you can use
    `-d:nimStrictDelete`. To make this review easier, use the
    `-d:nimAuditDelete` switch, which pretends that `system.delete` is
    deprecated so that it is easier to see where it was used in your
    code.

    `-d:nimStrictDelete` will become the default in upcoming versions.

A similar deprecation happened with `sequtils.delete` [4], but that
deprecated form is already not used in this repo.

[1] https://github.com/nim-lang/Nim/blob/2dec69fe5aa6/doc/manual.md#exception-tracking
[2] https://github.com/nim-lang/Nim/blob/2dec69fe5aa6/changelogs/changelog_1_6_0.md#system
[3] https://github.com/nim-lang/Nim/commit/92cb76571432
[4] https://github.com/nim-lang/Nim/commit/1d6863a7899f
2022-10-05 13:57:17 -04:00
TerrorTrace
28c879c8bb Add proxy basic auth documentation (#20498) 2022-10-05 13:50:27 -04:00
ringabout
de3b438db4 enable important packages which pass tests (#20501) 2022-10-05 23:27:33 +08:00
Andreas Rumpf
9d858a29fc cleanup nfFirstWrite flags (#20500) 2022-10-05 11:50:16 +02:00
ringabout
3e2b30879c fixes #19231; newFinalize doesn't work with ORC (#20291)
* fixes #19231; newFinalize doesn't work with ORC

first make it pass tests

* remove the tables dep

creates a binding for finalized procs in order to handle the same symbols. It used to wrongly generat a new symbol id for the same symbol as the encountered one before

* refactor and revert #14257

* de indentation

* fixes tests; uses instantiated types
2022-10-05 10:35:40 +02:00
ringabout
2dec69fe5a enable ORC tests for nimsl (#20497) 2022-10-04 23:31:32 +08:00
ringabout
827971dab2 remove deprecation messages for unsafeAddr; add warnings to docs (#20496) 2022-10-04 17:05:11 +02:00
ringabout
f89ba2c951 add default field support for object in ARC/ORC (#20480)
* fresh start

* add cpp target

* add result support

* add nimPreviewRangeDefault

* reduce

* use orc

* refactor common parts

* add tuple support

* add testcase for tuple

* cleanup; fixes nimsuggest tests

* there is something wrong with cpp

* remove

* add support for seqs

* fixes style

* addd initial distinct support

* remove links

* typo

* fixes tuple defaults

* add rangedefault

* add cpp support

* fixes one more bugs

* add more hasDefaults

* fixes ordinal types

* add testcase for #16744

* add testcase for #3608

* fixes docgen

* small fix

* recursive

* fixes

* cleanup and remove tuple support

* fixes nimsuggest

* fixes generics procs

* refactor

* increases timeout

* refactor hasDefault

* zero default; disable i386

* add tuples back

* fixes bugs

* fixes tuple

* add more tests

* fix one more bug regarding tuples

* more tests and cleanup

* remove messy distinct types which must be initialized by original types

* add tests

* fixes zero default

* fixes grammar

* fixes tests

* fixes tests

* fixes tests

* fixes comments

* fixes and add testcase

* undo default values for results

Co-authored-by: flywind <43030857+xflywind@users.noreply.github.com>
2022-10-04 12:45:10 +02:00
Bung
6cf0727192 decrease iteration count of btree test (#20491)
disable btree test
2022-10-04 12:32:07 +02:00
Andreas Rumpf
7aaeb75ebd allocator: disable unnecessary stuff for ORC [backport] (#20489) 2022-10-03 18:33:45 +02:00
ringabout
0f5ad49971 [ARC] fixes #18645; C Compiler error when initializing {.global.} with a block (#19953)
* fixes #18645; C Compiler error when initializing {.global.} with a block:

* arguably cleaner solution

Co-authored-by: xflywind <43030857+xflywind@users.noreply.github.com>
Co-authored-by: Araq <rumpf_a@web.de>
2022-10-03 16:12:23 +02:00
ringabout
852a7c4919 close #11415; add testcase (#20486) 2022-10-03 10:37:27 +02:00
metagn
2cca38d33c pragma for sfCallsite instead of name check + better semantics, test (#20464)
* pragma for sfCallsite instead of name check at every template definition

Not documented because it seems to be for internal use?

Should also make it possible to make comparisons and setops imports, but this doesn't have to be done.

I can reuse a name like `cursor` for the pragma as well, added a new name just to be safe.

* make sfCallsite recursive, add tests
2022-10-03 06:07:55 +02:00
ringabout
81e7811e01 fixes nim check with orc (#20456)
* fixes nim check with orc

* fixes tests

* add tests

* fixes tests

* Update tests/arc/t20456.nim
2022-10-02 06:44:10 +02:00
Bung
0769b160c5 less test time costs (#20479) 2022-10-02 06:42:41 +02:00
ringabout
1737bb9f9e disable threads when booting the compiler (#20478) 2022-10-02 06:42:09 +02:00
Bung
567c3f055d Fix #19224 For loops over a hardcoded empty array crash the compiler (#20476)
* Fix #11684 For loops over a hardcoded empty array crash the compiler

* Update t19224.nim
2022-10-01 23:19:07 +02:00
metagn
0b1650576c move widestrs out of system (#20462)
* move widestrs out of system

* fix osproc
2022-10-01 22:35:09 +02:00
Bung
cbd9fee22a fix #19678 Broken behavior with string ranges in case labels (#20475)
* fix #19678 Broken behavior with string ranges in case labels

* Update compiler/semtypes.nim

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

Co-authored-by: Andreas Rumpf <rumpf_a@web.de>
2022-10-01 18:17:07 +02:00
Andreas Rumpf
8d47bf1822 new move analyser2 (#20471)
* produce better code for closure environment creation
* new 'first write' analysis; 
* scope based move analyser
* code cleanup

Co-authored-by: ringabout <43030857+ringabout@users.noreply.github.com>
2022-10-01 16:46:51 +02:00
metagn
cfff454cf9 closed ambiguous enum defaults to first overload (#20457)
* closed ambiguous enum defaults to first overload

* add warning

* turn to hint

* work around config
2022-10-01 13:30:23 +02:00
metagn
24b81e9df6 remove hack for deprecated csize in compiler (#20463)
* remove hack for deprecated csize in compiler

* remove test
2022-10-01 09:07:52 +02:00
ringabout
96c5586d03 add plausibleAnalytics support for koch docs[backport:1.6] (#20454)
add plausibleAnalytics to koch docs[backport:1.6]
2022-09-30 12:39:28 +02:00
ringabout
ae050b05e9 koch boot compiler with orc (#20467)
* koch boot compiler with orc

* use orc

* workaround bugs

* move it

* move the data
2022-09-30 12:38:25 +02:00
ringabout
3e43ea3384 make koch and tools work with nimPreviewSlimSystem (#20459) 2022-09-30 08:09:40 +08:00
ringabout
716d68cb24 fixes postgres with nimPreviewSlimSystem (#20455) 2022-09-29 23:54:45 +08:00
Juan Carlos
1e635bb539 Undeprecate isvalidfilename (#19643)
* Remove deprecated isvalidfilename
* https://github.com/nim-lang/Nim/pull/19643#issuecomment-1235102314
* https://github.com/nim-lang/Nim/pull/19643#issuecomment-1235102314
* https://github.com/nim-lang/Nim/pull/19643#issuecomment-1235102314
* Add unittests
* Add more

Co-authored-by: Andreas Rumpf <rumpf_a@web.de>
2022-09-29 12:22:29 +02:00
ringabout
f56085f21e refactor dbFormat (#19746)
* refactor dbFormat

* add simple tests
2022-09-29 12:16:42 +02:00
Andreas Rumpf
77a65d3c33 fixed tstrimpl (#20452) 2022-09-29 09:41:00 +02:00
ringabout
a8cc5d1379 Unicode Operators are no longer experimental (#20444)
* Unicode Operators are no longer experimental

* fixes tests

* Update doc/manual.md

Co-authored-by: Andreas Rumpf <rumpf_a@web.de>
2022-09-28 22:37:26 +02:00
ringabout
65c2518d5c fix #19500; remove find optimization [backport: 1.6] (#19714)
* remove find optimization

close #19500

* save find to std

* add simple tests

* Apply suggestions from code review

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

Co-authored-by: sandytypical <43030857+xflywind@users.noreply.github.com>
Co-authored-by: konsumlamm <44230978+konsumlamm@users.noreply.github.com>
2022-09-28 16:05:41 -04:00
metagn
919a889ba8 moderate system cleanup & refactor (#20355)
* system refactor, move out 600 lines

* compilation, slice, backwardsindex, misc_num moved out of system
* some procs/types moved into arithmetics, basic_types
* system no longer depends on syncio
* some procs moved around to fit with their surroundings

* make exceptions an import, old ops to misc_num

* move instantiationInfo back

* move back nim version, fix windows echo

* include compilation

* better docs for imported modules, fix unsigned ops

also remove ze, ze64, toU8, toU16, toU32 with nimPreviewSlimSystem

* fix terminal

* workaround IC test & weird csize bug, changelog

* move NimMajor etc back to compilation, rebase for CI

* try ic fix

* form single `indices`, slim out TaintedString, try fix IC

* fix CI, update changelog, addQuitProc

* fix CI

* try fix CI

* actually fix CI finally hopefully

* Update lib/system/compilation.nim

Co-authored-by: ringabout <43030857+ringabout@users.noreply.github.com>

* update kochdocs

* hopefully fix csize uses for slimsystem

* fix tquit

Co-authored-by: ringabout <43030857+ringabout@users.noreply.github.com>
2022-09-28 15:28:45 -04:00
ringabout
b463c8aedf fixes changelog links (#20446) 2022-09-28 19:40:14 +02:00
Tomohiro
92a0f191bf Use vccexe when generating static lib with vcc (#19843) 2022-09-28 15:07:41 +02:00
metagn
de4b0346bd store full definition AST for consts, fix noRewrite (#20115)
* continue #9582 for consts, close #9331, fix #20114

also move extractPragma to ast to pave the way for things like {.strdefine: "abc".} etc

* changelog correctly

* fix jsgen

* update tgetimpl

* fix sighashes

* fix #19766, add comment about postfix

* fix noRewrite LOL

refs #16620

* fix changelog

* fix destructors
2022-09-28 15:05:01 +02:00
ringabout
fdc6b0fb6e fixes #19986; mutable view from immutable location (#20134)
* fixes #19986; mutable view from immutable location

* fixes the tests
2022-09-28 14:02:07 +02:00
konsumlamm
18cea8e9bd Update message for checking cast (#20145)
* Update message for checking `cast`

* Update error messages in tests
2022-09-28 13:59:27 +02:00
ringabout
e33e9e4a32 fixes #20141; dereferencing pointer to incomplete type error with cast (#20147)
Co-authored-by: xflywind <43030857+xflywind@users.noreply.github.com>
2022-09-28 13:57:47 +02:00