20129 Commits

Author SHA1 Message Date
xflywind
d274b56256 ignore noinit pragma 2022-06-29 18:43:13 +08:00
xflywind
dd6833297f add warnings if noinit is ignored 2022-06-29 15:54:45 +08:00
xflywind
e885d89f63 FIX AGAIN 2022-06-29 10:48:00 +08:00
xflywind
2b53216152 initial commit for #16253 2022-06-28 19:20:47 +08:00
Tanguy
d33e112766 Better range error messages (#19867)
* Better range error messages

* Revert to old behavior for arrays

* Small corrections
2022-06-15 16:38:12 +02:00
JJ
e7e8f437c4 Keep the doc sidebar on the screen while scrolling (#19851)
* [docgen] Group sidebar sections into <details> (open by default)

* [docgen] Consistent indentation in generated HTML

(this is a boon for working on docgen's html/css output)

* [docgen] Move Source/Edit buttons inside main div

This makes styling the documentation significantly easier.

* [docgen] Somewhat consistent CSS formatting

* [docgen] Keep the sidebar onscreen while scrolling

* [docgen] Tweak CSS for the sticky sidebar

* [docgen] search type=text ==> type=search

* [docgen] Update expected doc output

* [docgen] Fix Group by Type sidebar placement bug

* [docgen] Curse you, whitespace (fix tests)

* [docgen] Fix rst2html tests

Co-authored-by: sandytypical <43030857+xflywind@users.noreply.github.com>
2022-06-15 15:40:56 +02:00
Don-Duong Quach
789b1bcbb6 Fixes #19883 so genscript works with vcc (#19893) 2022-06-15 08:20:34 +02:00
Tanguy
251bdc1d5a Windows: enable nimRawSetjmp by default [backport] (#19891)
* Windows: enable nimRawSetjmp by default

See #19197. The default setjmp can randomly segfault on windows

* Attempt to disable the flag for bootstraping

* Disable styleCheck for c_setjmp
2022-06-14 12:37:31 +02:00
Ivan Yonchovski
b41226001c Initial implementation of nimsuggest v3 (#19826)
* Initial implementation of nimsuggest v3

Rework `nimsuggest` to use caching to make usage of ide commands more efficient.
Previously, all commands no matter what the state of the process is were causing
clean build. In the context of Language Server Protocol(LSP) and lsp clients
this was causing perf issues and overall instability. Overall, the goal of v3 is
to fit to LSP Server needs

- added two new commands:
  - `recompile` to do clean compilation
  - `changed` which can be used by the IDEs to notify that a particular file has been changed.
The later can be utilized when using LSP file watches.
  - `globalSymbols` - searching global references

- added `segfaults` dependency to allow fallback to clean build when incremental
fails. I wish the error to be propagated to the client so we can work on fixing
the incremental build failures (typically hitting pointer)

- more efficient rebuild flow. ATM incremental rebuild is triggered when the
command needs that(i. e. it is global) while the commands that work on the
current source rebuild only it

Things missing in this PR:

- Documentation
- Extensive unit testing.

Although functional I still see this more as a POC that this approach can work.

Next steps:
- Implement `sug` request.
- Rework/extend the protocol to allow better client/server communication.
Ideally we will need push events, diagnostics should be restructored to allow
per file notifications, etc.
- implement v3 test suite.
- better logging

* Add tests for v3 and implement ideSug

* Remove typeInstCache/procInstCache cleanup

* Add ideChkFile command

* Avoid contains call when adding symbol info

* Remove log

* Remove segfaults
2022-06-13 11:33:44 +02:00
Ardek Romak
a4fdaa88cc Correctly import libcrypto functions using dynlib (#19881) 2022-06-13 09:22:20 +02:00
flywind
ab47707586 [semfold] fix #19199; properly fold uint to float conversion (#19890) [backport]
fix #19199; properly fold float conversion
2022-06-13 09:01:40 +02:00
flywind
2f4900615a [cleanup] remove unnecessary procs in vm (#19888)
remove unused procs
2022-06-13 08:10:40 +02:00
Jake Leahy
8fa2c0b532 Pass headers and body correctly to FetchOptions (#19884) [backport]
* Pass headers to FetchOptions

Don't pass body if method is HttpGet or HttpHead

* Syntax fixes

* Restart CI
2022-06-13 08:03:40 +02:00
Carlo Capocasa
e2e663a143 Friendlier error message with solution (#19880)
* Add helpful suggestion, should always apply

* mention var param limitation in async docs

* Update compiler/lambdalifting.nim

whoops thanks

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

Co-authored-by: flywind <43030857+xflywind@users.noreply.github.com>
2022-06-11 18:23:31 +02:00
Bung
ac89eead8a test for #19046 (#19839)
* test for #19046

* add threads flag
2022-06-10 20:40:34 +02:00
quantimnot
6f4bacff67 Extend and document compiler debugging utilities (#19841)
* Add two debugutils procs that native debuggers can break on use to
  execute commands when code of interest is being compiled.
* Add GDB and LLDB programs to disable and enable breakpoints and
  watchpoints when code of interest is being compiled.
* Extend the `intern.rst` docs regarding debugging the compiler.

Co-authored-by: quantimnot <quantimnot@users.noreply.github.com>
2022-06-10 20:40:08 +02:00
flywind
1e5dd9022b [js] add testcase for array indexDefect and remove todo (#19838)
* remove unused opcSubstr

* [js] add testcase for array indexDefect

* Revert "remove unused opcSubstr"

This reverts commit cb461f2545.
2022-06-10 20:33:44 +02:00
flywind
8cde6ba6bc remove noop option gc:v2 (#19810)
* remove noop option gc:v2

* changelog
2022-06-10 20:32:27 +02:00
flywind
eefca1b81f not generate initStackBottomWith in arc/orc [backport] (#19875)
not generate initStackBottomWith in arc/orc
2022-06-10 21:24:28 +08:00
flywind
1972005439 fix #19862; make widestrs consistent between refc and orc (#19874) [backport]
fix #19862; make widestrs consistent in refc and orc
2022-06-09 16:51:17 +02:00
Andreas Rumpf
25d89269eb give a better error message for some template expansions (#19871) 2022-06-09 14:21:18 +02:00
Antonis Geralis
836b95c896 Deprecate std/sums (#18439)
* Deprecate sums

* Update changelog.md

* Update lib/std/sums.nim

* log

* format

* remove

* Update changelog.md

Co-authored-by: sandytypical <43030857+xflywind@users.noreply.github.com>
2022-06-09 08:27:31 +02:00
flywind
415689323c clarify how to restart CI (#19845) 2022-06-08 18:17:25 +02:00
Zoom
e1702ae1e6 changelog.md: Add strutils.find changes (#19868)
Added `strutils.find` changes

Standard library section restructured to group by `changed/added/deprecated/removed` with paragraphs marked by markdown comments.
2022-06-08 16:11:22 +02:00
Juan Carlos
f2b16c490d Add Microtasks docs (#19870)
* Add Microtasks

* Add Microtasks

* Workaround to build js docs in older NodeJS versions
2022-06-08 16:10:52 +02:00
Zoom
b024a45163 Fix find routines' api to default to last=-1 (#19761)
This changes the default for the `last` parameter of various `find`
routines from `0` to `-1`. Previous default prevents limiting the search
to the first character. This is a logic error, as full text search was
performed for 2 *valid* values of `last`: `0` and `last.high()`.

Adds an overload for `initSkipTable` which returns a newly initialized
table. This encapsulates every single usage of a `var`-acting original
func in this module.

Co-authored-by: flywind <xzsflywind@gmail.com>
2022-06-07 10:35:06 +02:00
Juan Carlos
d0232f0e5b Add Microtasks (#19860)
* Add Microtasks

* Add Microtasks
2022-06-04 07:03:25 +02:00
Andrey Makarov
4341b06f65 RST: improve simple tables (#19859)
* RST: improve simple tables

* nim 1.0 gotchas

* Still allow legacy boundaries like `----`
2022-06-04 07:03:03 +02:00
quantimnot
f7a13f62d6 Stop type aliases from inheriting sfUsed (#19861)
Fixes #18201

Co-authored-by: quantimnot <quantimnot@users.noreply.github.com>
2022-06-04 06:25:21 +02:00
flywind
68aeb4c1a6 change the type of mangleJsName; fixes CStringConv warnings (#19852)
change the type of mangleJsName

since mangleJsName is used in macros, there is no need to use cstring. Using cstring may increase conversions and cause warnings.
2022-06-01 15:01:17 +02:00
flywind
4e3eb7414c [Minor] remove unused and unnecessary local variable (#19853) 2022-06-01 14:44:26 +02:00
quantimnot
d30c6419a0 Refactor and doc package handling, module name mangling (#19821)
* Refactor and doc package handling, module name mangling

* Consolidate, de-duplicate and extend package handling
* Alter how duplicate module names of a package are handled
* Alter how module names are mangled
* Fix crash when another package is named 'stdlib' (test case added)
* Doc what defines a package in the manual

Modules with duplicate names within a package used to be given 'fake'
packages to resolve conflicts. That prevented the ability to discern if
a module belonged to the current project package or a foreign package.
They now have the proper package owner and the names are mangled in a
consistent manner to prevent codegen clashes.

All module names are now mangled the same. Stdlib was treated special
before, but now it is same as any other package. This fixes a crash
when a foreign package is named 'stdlib'.

Module mangling is altered for both file paths and symbols used by the
backends.

Removed an unused module name to package mapping that may have been
intended for IC. The mapping was removed because it wasn't being used
and was complicating the issue of package modules with duplicate names
not having the proper package owner assigned.

* Fix some tests

* Refactor `packagehandling`

* Remove `packagehandling.withPackageName` and its uses
* Move module path mangling from `packagehandling` to `modulepaths`
* Move `options.toRodFile` to `ic` to break import cycle

* Changed import style to match preferred style

Co-authored-by: quantimnot <quantimnot@users.noreply.github.com>
2022-05-30 18:52:19 +02:00
Alfred Morgan
15f0b48676 Zectbumo fixes 19824 (#19825)
* borrowed `$` to make Time string friendly

* added sep character parameter

* Revert "added sep character parameter"

This reverts commit 45f4b019a4.

* added sep character parameter

* Revert "borrowed `$` to make Time string friendly"

This reverts commit 10e2e44c9a.

* added uri tests and made changelong entry

* Update lib/pure/uri.nim

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

* Update lib/pure/uri.nim

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

* Update tests/stdlib/turi.nim

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

* Update tests/stdlib/turi.nim

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

Co-authored-by: konsumlamm <44230978+konsumlamm@users.noreply.github.com>
2022-05-30 12:09:18 +02:00
quantimnot
497af2c0d9 Doc preferred import style in compiler (#19832)
Doc prefered import style in compiler

Co-authored-by: quantimnot <quantimnot@users.noreply.github.com>
2022-05-30 11:07:47 +02:00
flywind
004fc23a3f [vm] remove unused opcSubstr opcode (#19834)
remove unused opcSubstr
2022-05-30 10:41:24 +02:00
Michael New
14960fa754 Fix typo and incorrect pragma name (#19847) 2022-05-30 10:40:15 +08:00
flywind
d81edcacc6 Add link to std/tempfiles in the docs; fix #19155 (#19807) 2022-05-24 17:53:01 +02:00
tandy1000
ec0cec3170 Add document.hidden and document.visibilityState properties (#19817) 2022-05-24 17:37:39 +02:00
Juan Carlos
b1b5e3ab10 Add Array.shift (#19811)
* Add Array.shift for JavaScript targets

* Add Array.shift for JavaScript targets
2022-05-24 17:37:19 +02:00
quantimnot
05c0419658 Fix global destructor injection for JS backend (#19797)
* Fix global destructor injection for JS backend

* Moved global destructors injection before the final call to transform and
  generate JS code. It had previously been after and thus not no JS was
  generated for them.
* Added some internal documentation of `jsgen`.
* Enable a current destructor test to cover the JS backend as well.
* Fixes the JS aspect of #17237.

* Fixed global destructor injection order for JS backend

Co-authored-by: quantimnot <quantimnot@users.noreply.github.com>
2022-05-23 06:17:32 +02:00
quantimnot
a8426fc789 Fix default testament target in docs and cli help (#19796)
Co-authored-by: quantimnot <quantimnot@users.noreply.github.com>
2022-05-23 06:12:34 +02:00
Jacek Sieka
63cca93ea9 testament: include extra options in test name (#19801)
there's currently no (simple) way to disambiguate which option failed
2022-05-19 17:11:53 +02:00
Yardanico
06f02bb771 Always use httpclient in nimgrab (#19767) 2022-05-17 09:56:39 +02:00
flywind
33888a7384 [manual] TLock => Lock (#19785)
* [manual] TLock => Lock

* minor
2022-05-17 07:37:26 +02:00
Anthony Dario
19001c070b Fix typo in sequtils documentation (#19789)
Found another small typo.
2022-05-13 11:19:42 +08:00
flywind
c61eb5df32 disable polypbren (#19787)
* disable polypbren

* Update important_packages.nim
2022-05-13 01:03:30 +08:00
Alfred Morgan
b9f243eb2a string is missing formatting when calling fmt (#19780)
it appears the documentation intends to compare & with .fmt but there is no formatting in the string. even though the assert is true it doesn't quite prove that .fmt is an equivalent formatter.
2022-05-10 17:45:57 +02:00
Alfred Morgan
85bc8326ac varargs example erroneously transformed "abc" to "def" (#19781) 2022-05-10 20:21:35 +08:00
Juan Carlos
b2b878f4d6 Remove deprecated posix proc (#19774)
* Remove deprecated posix proc that takes wrong argument types

* Remove deprecated posix proc that takes wrong argument types
2022-05-08 11:56:46 +02:00
huantian
61c1142667 Update nimscript withDir doc example (#19776) 2022-05-08 11:54:25 +02:00