Commit Graph

20215 Commits

Author SHA1 Message Date
ringabout
714eb65866 remove annoying dropdowns from the bug form (#20154)
* Update bug_report.yml

* Update bug_report.yml

* Update bug_report.yml
2022-08-05 02:56:08 +08:00
Sojin
0641df33aa Two broken links found (#20121)
Updated the two broken internal links: rebuilding the compiler, reproducible builds
2022-08-04 12:53:42 -04:00
Juan Carlos
2f3980f491 Add bug form (#19913)
* Add Bug Form

* Add Bug Form

* Add Bug Form

* Add Bug Form

* https://github.com/nim-lang/Nim/pull/19913#issuecomment-1160663243

* https://github.com/nim-lang/Nim/pull/19913#issuecomment-1160663243

* Update .github/ISSUE_TEMPLATE/bug_report.yml

Co-authored-by: Yardanico <tiberiumk12@gmail.com>

* Update .github/ISSUE_TEMPLATE/bug_report.yml

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

* Update .github/ISSUE_TEMPLATE/bug_report.yml

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

* Update .github/ISSUE_TEMPLATE/bug_report.yml

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

* Update .github/ISSUE_TEMPLATE/feature_request.yml

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

* Update .github/ISSUE_TEMPLATE/feature_request.yml

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

* Do not Star Nim on Github

* No backwards compat problems

* Typo

Co-authored-by: Yardanico <tiberiumk12@gmail.com>
Co-authored-by: konsumlamm <44230978+konsumlamm@users.noreply.github.com>
2022-08-04 11:15:22 +02:00
Andrey Makarov
a34dd3d77a Markdown code blocks part 3 (#20117)
No logic was added, just 4 more files migrated.
2022-08-04 09:32:23 +02:00
ringabout
2aeb0d516b fixes #20132; fixes the broken jsondoc comand [backport] (#20135)
* fixes #20132; fixes the broken jsondoc comand

* add testcase
2022-08-04 08:49:51 +02:00
gecko
7af484da94 Add client.close() in httpclient examples. (#20118)
Without this, the httpclient examples are essentially setting you up for failure. I was bitten by this when my app became unable to open any more sockets.

I'm not entirely sure how long this will relevant, as I hope destructors will be added to an upcoming version of the stdlib. But figured it was worth submitting anyways!
2022-08-04 06:46:08 +02:00
ringabout
09840c09e4 closes #20123; remove builds.sr.ht (#20131) 2022-08-03 16:05:57 -04:00
ringabout
c08c455016 Revert "enable nimPreviewDotLikeOps" (#19919)
* Revert "enable nimPreviewDotLikeOps (#19598)"

This reverts commit 6773ffa63d.

* add deprecated message

Co-authored-by: flywind <43030857+xflywind@users.noreply.github.com>
2022-08-03 22:39:14 +08:00
Yuriy Glukhov
0d734d7966 Fixed compilation of void closureiters with try stmt (#20138) [backport] 2022-08-03 08:46:36 +02:00
random-bites
02cbd7dc53 Edits to sections 'Open arrays' and 'varargs'. (#20140) 2022-08-03 08:44:14 +02:00
Sultan Al Isaiee
da267911ec [Changelog] Add Wider Ascii Chars sets string formatting in strutils.nim (#20137)
* Add Wider Ascii Chars sets string formatting in strutils.nim

Add Wider Ascii Chars sets for string formatting (#19994) (#20120):
- Added `UppercaseLetters`, `LowercaseLetters` The set of UppercaseLetters and lowercase ASCII letters.
- Added `PunctuationChars` The set of all ASCII punctuation characters.
- Added `PrintableChars` The set of all printable ASCII characters (letters, digits, whitespace, and punctuation characters).

* Update changelog.md

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

* Update changelog.md

Co-authored-by: konsumlamm <44230978+konsumlamm@users.noreply.github.com>
Co-authored-by: ringabout <43030857+ringabout@users.noreply.github.com>
2022-08-02 19:50:42 +08:00
ringabout
59befed8ee prevent cache thrashing (#20129)
* prevent cache thrash

Co-authored-by: Charles Blake <cb@cblake.net>

* Update lib/pure/random.nim

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

Co-authored-by: Charles Blake <cb@cblake.net>
Co-authored-by: konsumlamm <44230978+konsumlamm@users.noreply.github.com>
2022-08-02 00:06:27 +08:00
Clay Sweetser
77891cedae Fix "Add Wider Ascii Chars sets and func for string formatting" (#20120) 2022-07-31 23:24:14 -04:00
Sultan Al Isaiee
3987a3bf97 Add Wider Ascii Chars sets and func for string formatting (#19994)
* Add more Ascii Chars sets

- add UpperCaseLetters set
- add LowerCaseLetters set
- add Punctuations set
- add PrintablesNoWhiteSpace set
- add Printables set
- add isPunctuationAscii func
- add isPrintableAscii func

* Omit isPunctuationAscii and isPrintableAscii procs

* Apply suggestions for adding Wider Ascii Chars sets

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

* Update strutils.nim

Co-authored-by: Clay Sweetser <Varriount@users.noreply.github.com>
2022-07-31 20:20:25 -04:00
quantimnot
313ce91533 [Doc] Fix some minor markup errors in manual (#20112)
* Fix header level for noalias pragma section.
* Fix code snippet outside of code block that raised an error with `rst2html`.
* Fix broken 'Convertible relation' links that were raising warnings.

Co-authored-by: quantimnot <quantimnot@users.noreply.github.com>
2022-07-31 20:08:01 -04:00
ringabout
a8590d6707 [ORC] replace threadpool with createThread in the runnableExamples (#20106)
replace threadpool with createThreads in the runnableExamples
2022-07-31 20:02:23 -04:00
ringabout
86fc78a9c0 replace the broken link for ORC implementation with a working one (#20105) 2022-07-31 20:01:36 -04:00
Andrey Makarov
40e0048a50 Highlight Nim default in Markdown code in .nim (#20110)
Highlight Nim by default in Markdown code in .nim
2022-07-31 15:38:00 +02:00
Sojin
99dd588d6b The internal link to koch.rst docs was broken (#20113)
Broken Link found for koch.rst docs

The Current internal link was broken. Updated with a new link to the same path
2022-07-31 11:07:06 +02:00
konsumlamm
528b6d1c3f Warn when casting to a larger type (#20103)
* Warn when casting to a larger type

* Revert change to error message to fix CI
2022-07-28 15:09:58 +02:00
Yuriy Glukhov
424e87fd09 Fixed noinit pragma for closure variables (#20101) 2022-07-28 18:43:41 +08:00
ringabout
8ef509b85b fixes broken CI; bump macOS version to macos-11 (#20098)
* bump macOS image on Azure CI to macos-11

##[warning]The macOS-10.15 environment is deprecated, consider switching to macos-11(macos-latest), macos-12 instead. For more details see https://github.com/actions/virtual-environments/issues/5583

* fix CI error
2022-07-27 21:06:34 +08:00
ringabout
5bbc5edf43 fixes #20031; uint64 is an ordinal type since 1.0 (#20094)
* fixes #20031; uint64 is an ordinal type since 1.0

* Update compiler/semstmts.nim
2022-07-27 11:15:51 +02:00
ringabout
4c46358db1 remove shallowCopy for ARC/ORC (#20070)
* remove shallowCopy for ARC/ORC

* use move

* fix

* more fixes

* typo

* Update lib/system.nim

* follow

* add nodestroy

* move

* copy string

* add a changelog entry

Co-authored-by: xflywind <43030857+xflywind@users.noreply.github.com>
Co-authored-by: Andreas Rumpf <rumpf_a@web.de>
2022-07-26 16:51:01 +02:00
ringabout
1c39af3389 fixes #20089; remove setPointer since strings/seqs are not pointers with ORC (#20090)
fixes #20089; remove setPointer since strings/seqs are not pointers anymore
2022-07-26 16:48:01 +02:00
metagn
3d5f10f0d0 clean up and clarify changelog [skip ci] (#20093) 2022-07-26 16:44:13 +02:00
Lancer11211
efd5c571bf .forbids pragma: defining forbidden tags (#20050)
* .forbids pragma: defining illegal effects for proc types

This patch intends to define the opposite of the .tags pragma: a way to define effects which are not allowed in a proc.

* updated documentation and changelogs for the forbids pragma

* renamed notTagEffects to forbiddenEffects

* corrected issues of forbids pragma

the forbids pragma didn't handle simple restrictions properly and it also had issues with subtyping

* removed incorrect character from changelog

* added test to cover the interaction of methods and the forbids pragma

* covering the interaction of the tags and forbids pragmas

* updated manual about the forbids pragma

* removed useless statement

* corrected the subtyping of proc types using the forbids pragma

* updated manual for the forbids pragma

* updated documentations for forbids pragma

* updated nim docs

* updated docs with rsttester.nim

* regenerated documentation

* updated rst docs

* Update changelog.md

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

* updated changelog

* corrected typo

Co-authored-by: ringabout <43030857+ringabout@users.noreply.github.com>
2022-07-26 07:40:49 +02:00
Andrey Makarov
62b81d7f10 Markdown code blocks part 2; migrate Nim Manual (#20080)
* Change headings underscored by `~~~` to `###`

* Markdown code blocks part 2; migrate Nim Manual
2022-07-25 18:29:52 +02:00
metagn
685bf944aa fix #20067, fix #18976 [backport] (#20069) 2022-07-22 15:04:07 +08:00
tersec
1a9123eb90 Use passc and passl consistently with compiler checking (#20068) 2022-07-21 09:41:33 +02:00
kraptor
efcb89fa70 Correctly detect major version of GCC (#20059)
We were doing a very poor job detecting the major version of GCC by
parsing the output of --version.

This patches uses -dumpversion to make this parsing straightforward and
it also fixes a bunch of compiling issues on different platforms with
custom output for --version switches. For example, openSUSE first line
of the output includes the revision number and the parsing that was
being done did mix that number with the major version and breaks
building the nim compiler (as it doesn't find the 3 dots for an X.Y.Z semver
format, hence returning "false").

In this patch, we simply use -dumpversion (which has been at least from
1993, so we are safe :)
2022-07-18 21:24:39 +02:00
flywind
d934ba9326 replace shallowcopy with move in ARC/ORC (#20061) 2022-07-18 21:23:39 +02:00
Anna
2549d398a9 niminst: support DESTDIR and quote variables (#20051)
* niminst: support DESTDIR (fix #9788)

* niminst: quote variables
2022-07-18 21:22:53 +02:00
Antonis Geralis
f34734ffb4 Improve rand(bool) (#20045)
* Improve rand(bool)

* Use sign test instead of mod 2

* Use mod 2 again, as it works for js

* Use right shift as suggested by the authors of xoroshiro

* Update random.nim

* General case doesn't need any right shift it was correct to begin with

* Update random.nim

* add comment

Co-authored-by: flywind <43030857+xflywind@users.noreply.github.com>
2022-07-18 21:18:12 +02:00
Jacek Sieka
f2e4407306 epoll: correct mapping [backport] (#20058)
* epoll: correct mapping

`epoll_data` is a union and `epoll_event` is packed on `amd64`

* names
2022-07-18 21:03:25 +02:00
LetThereBeLemons
f443bece06 Fixed typo in std/os doc (#20054)
Fixed typo
2022-07-18 14:20:30 +08:00
Jacek Sieka
c6264ed847 fix pthread_mutex_t size (#20055) 2022-07-18 06:44:47 +02:00
Don-Duong Quach
efdcc00169 Fixed errors in Nim Backend integration docs. (#20046)
Fixed errors in Nim Backend integration.
Section "Nim invocation example from C"
NimMain needs a declaration and function declarations have external
linkage by default.
Also with the order of arguments to gcc with a static lib,
maths.c needs to come before the static lib.
2022-07-17 09:32:33 +02:00
flywind
01ad0cdc52 defines the gcRefc symbol which allows writing specific code for refc (#20009)
* define gcRefc symbols

* add comments

* add a changelog item

* Update changelog.md

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

* Update changelog.md

Co-authored-by: Yardanico <tiberiumk12@gmail.com>

Co-authored-by: konsumlamm <44230978+konsumlamm@users.noreply.github.com>
Co-authored-by: Yardanico <tiberiumk12@gmail.com>
2022-07-17 09:24:40 +02:00
Peter Guld Leth
0d8bec6956 Fix typo in line 456 (#20047) 2022-07-17 00:00:28 +02:00
kraptor
8679464e49 Display protocol name in exceptions raised by getProtoByName() (#19808) 2022-07-16 17:44:14 -04:00
Jake Leahy
c43a377057 Make imports/exports not be a dropdown in sidebar (#19907)
* Don't make a section be a dropdown if it has no child links

* - Cleaned up code

- Updated tests

* Document what the 'if' is checking
2022-07-16 17:41:18 -04:00
Jacek Sieka
094d86f997 testament: use full test name in skips [backport] (#19937)
testament: use full test name in skips
2022-07-16 16:56:54 -04:00
Amjad Ben Hedhili
cf78c02b70 Make random.rand work with Ordinal (#20043)
* Make `random.rand` work with `Ordinal`

* Add changelog entry

* It's fine to cast to char
2022-07-16 16:51:27 -04:00
David Krause
60dd38c502 make AsyncSocket.getPeerAddr work ; fix #15022 (#20038)
Signed-off-by: David Krause <enthus1ast@users.noreply.github.com>
2022-07-16 10:59:58 +01:00
Ivan Yonchovski
b0b9a3e5fa Use module actual file instead of PSym.info (#19956)
After this you can do goto module from module import
2022-07-15 19:56:33 +02:00
Ivan Yonchovski
e636c211b0 Implement type command (#19944)
* Implement type command

- this will be mapped to textDocument/typeDefinition in LSP protocol. It will be
very useful for `nim` in particular because typically most of the time the type
is inferred.

* Update nimsuggest/nimsuggest.nim

Co-authored-by: Andreas Rumpf <rumpf_a@web.de>
2022-07-15 19:56:05 +02:00
Andrey Makarov
417b90a7e5 Improve Markdown code blocks & start moving docs to Markdown style (#19954)
- add additional parameters parsing (other implementations will just
  ignore them). E.g. if in RST we have:

  .. code:: nim
     :test: "nim c $1"

     ...

  then in Markdown that will be:

  ```nim test="nim c $1"
  ...
  ```

- implement Markdown interpretation of additional indentation which is
  less than 4 spaces (>=4 spaces is a code block but it's not
implemented yet). RST interpretes it as quoted block, for Markdown it's
just normal paragraphs.
- add separate `md2html` and `md2tex` commands. This is to separate
  Markdown behavior in cases when it diverges w.r.t. RST significantly —
most conspicously like in the case of additional indentation above, and
also currently the contradicting inline rule of Markdown is also turned
on only in `md2html` and `md2tex`. **Rationale:** mixing Markdown and
RST arbitrarily is a way to nowhere, we need to provide a way to fix the
particular behavior. Note that still all commands have **both** Markdown
and RST features **enabled**. In this PR `*.nim` files can be processed
only in Markdown mode, while `md2html` is for `*.md` files and
`rst2html` for `*.rst` files.
- rename `*.rst` files to `.*md` as our current default behavior is
  already Markdown-ish
- convert code blocks in `docgen.rst` to Markdown style as an example.
  Other code blocks will be converted in the follow-up PRs
- fix indentation inside Markdown code blocks — additional indentation
  is preserved there
- allow more than 3 backticks open/close blocks (tildas \~ are still not
  allowed to avoid conflict with RST adornment headings) see also
https://github.com/nim-lang/RFCs/issues/355
- better error messages
- (other) fix a bug that admonitions cannot be used in sandbox mode; fix
  annoying warning on line 2711
2022-07-15 19:27:54 +02:00
metagn
f35c9cf73d fix #20002 (#20004)
While this fix seems innocent,
this unlocks the hidden behavior of
method calls not being able to call
gensym'ed routines inside templates.
2022-07-15 12:37:08 +02:00
flywind
286fcef68e [Orc] fixes "streams.readDataStr segafaults" when accepting a string literal (#20019) [backport]
fixes streams.readDataStr accept a string literal
2022-07-15 09:42:54 +02:00