Commit Graph

1649 Commits

Author SHA1 Message Date
Miran
1ad7e4f30b fix #16047 (#16066) 2020-11-20 03:31:06 -08:00
Timothee Cour
44442520bc fix numbering in contributing.rst (#16042) 2020-11-18 19:41:01 -08:00
Timothee Cour
bf8421a2fc contributing docs: always mentioned referenced issues in PR body (#16038) 2020-11-18 23:29:32 +01:00
Timothee Cour
50d035b789 defer: improve manual, clarify difference wrt try/finally (#16010) 2020-11-17 08:40:17 +01:00
Juan Carlos
1b9f37c6dc https://github.com/nim-lang/Nim/pull/15968/files#r523468677 2020-11-14 19:57:06 -03:00
Juan Carlos
c56a6133bb Fix #15806 2020-11-14 15:45:13 -03:00
Juan Carlos
9ab1a86b5b Fix #15806 2020-11-14 15:43:31 -03:00
Juan Carlos
3cebae492e Fix #15806 2020-11-14 15:39:03 -03:00
Juan Carlos
d0dda9efab Fix #15806 2020-11-14 15:31:59 -03:00
Andreas Rumpf
1978b91202 [docs minor]add some tips to intern.rst (#15967)
* [docs minor]add some tips yo intern.rst

* minor
2020-11-14 13:00:06 +01:00
flywind
bfa387d384 minor 2020-11-14 18:51:05 +08:00
flywind
5af798c21b [docs minor]add some tips yo intern.rst 2020-11-14 18:47:17 +08:00
Timothee Cour
96930b9cae targets: use cpp instead of c++ everywhere (was by far the most common) (#15961) 2020-11-14 10:08:15 +01:00
flywind
4663319bf5 follow #8463 #14157 and document cstring literals modification is not allowed (#15878)
* follow #8463 #14157 and document cstring literals
* Update doc/manual.rst

Co-authored-by: Juan Carlos <juancarlospaco@gmail.com>
Co-authored-by: Andreas Rumpf <rumpf_a@web.de>
2020-11-12 15:28:45 +01:00
narimiran
f02c7542fc nimdoc: items of ordered lists now have numbers instead of circles 2020-11-11 15:59:41 +01:00
narimiran
b831033db6 remove codeowners [ci skip] 2020-11-11 14:02:35 +01:00
Timothee Cour
c1664f93b0 new: nim -e:cmd to run a command directly; also fixes #15731 (#15687)
* new: `nim -i cmd`
* rename -i to -e (for eval); consistent with majority of other programing languages
* `nim e -e:cmd` now works; bugfix: `echo cmd | nim e -` now works
* honor --betterRun
* address comments
* --eval alias for -e (replaces undocumented --eval which was a noop)
* --eval now defaults to e (nimscript) instead of r
* address comment: remove -e, only keep --eval
* address comment
* fixup
* Update compiler/nimconf.nim

Co-authored-by: Andreas Rumpf <rumpf_a@web.de>
2020-11-09 16:07:22 +01:00
Aethylia
53eca459f1 Added [:T] syntax explanation to generics tutorial. (#15890)
* Added [:T] syntax explanation to generics tutorial.

* Update doc/tut2.rst

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

* Update doc/tut2.rst

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

* Made second generics example runnable and added test line.

* Update doc/tut2.rst

* Update doc/tut2.rst

* Update doc/tut2.rst

Co-authored-by: flywind <43030857+xflywind@users.noreply.github.com>
Co-authored-by: Andreas Rumpf <rumpf_a@web.de>
2020-11-09 14:14:06 +01:00
n5m
3bff12b966 improve Testament docs (#15881)
* fix mentions of recursive test discovery

* document that {.fatal.} pragmas cannot be caught
2020-11-09 12:20:55 +01:00
n5m
3be404af04 include example of error-marked copy proc (#15886)
* include example of error-marked copy proc

* Update destructors.rst
2020-11-09 11:45:43 +01:00
flywind
5828620d47 uint and uint64 is Ordinal type since nim 1.0.0 (#15873) 2020-11-07 07:58:52 +00:00
Ivan Bobev
3c85aa9e53 Make {.requiresInit.} to work for distinct types (#15869)
Make `requiresInit` pragma to work for distinct types in addition to
objects. Tagging of distinct types with `requiresInit` pragma was
already supported, but its impact wasn't applied. Now its behavior when
applied on distinct types is as follows.

Given the following distinct type definitions:

  ```nim
  type
    DistinctObject {.requiresInit, borrow: `.`.} = distinct MyObject
    DistinctString {.requiresInit.} = distinct string
  ```

The following code blocks will fail to compile:

  ```nim
  var foo: DistinctFoo
  foo.x = "test"
  doAssert foo.x == "test"
  ```

  ```nim
  var s: DistinctString
  s = "test"
  doAssert s == "test"
  ```

But these ones will compile successfully:

  ```nim
  let foo = DistinctFoo(Foo(x: "test"))
  doAssert foo.x == "test"
  ```

  ```nim
  let s = "test"
  doAssert s == "test"
  ```
2020-11-06 18:56:09 +00:00
Andreas Rumpf
3aab6a409d micro improvements (#15849) 2020-11-05 14:56:44 +01:00
c-blake
f17555770e Clarify the sense in which Nim supports recursive iterators in the (#15834)
manual, the tutorial, and the `tbintree` test.
2020-11-04 16:56:22 +01:00
flywind
b0e26d8fbf remove iup from stdlib in contrast to #15828 (#15830)
* remove iup from stdlib

* Update changelog.md
2020-11-03 20:43:51 +01:00
Clyybber
1eb4a38a50 Typos 2020-10-31 17:47:09 +01:00
n5m
bcb30566fc improve public Testament docs (#15710)
* improve glob docs

* punctuation

* move spec descriptions above example

notably, change the description of timeout to reference seconds, not microseconds

* document nimout

* document sortoutput

* explain the action options
2020-10-31 17:45:14 +01:00
Yanis Zafirópulos
0cae8ef2ca Massive documentation fixes + copy editing (#15747) 2020-10-29 10:33:47 +01:00
Tim Smith
485d4ff802 Spelling and Grammer fixes (#15719)
Co-authored-by: Tim Smith <tim.smith.hdg@gmail.com>
Co-authored-by: Miran <narimiran@disroot.org>
2020-10-28 17:56:56 +01:00
Xavier Noria
25955440df Document implicit return values from procedures (#15738) 2020-10-27 07:27:02 +01:00
Yanis Zafirópulos
ae8eb1ec3d Copy editing (#15733)
* Minor fixes

* Minor fixes

* Minor fixes

* Minor fixes
2020-10-26 13:47:33 -04:00
Miran
d8a6b0b04e [backport: 1.4] Better linebreaks (#15658) 2020-10-22 12:16:19 +02:00
Gampol T
b2f51e2950 Fix #13609 (#15567)
* add documentation that discardable pragma cannot use on template

* Update doc/manual.rst

Co-authored-by: Euan <euantorano@users.noreply.github.com>

* Update doc/manual.rst

Co-authored-by: Euan <euantorano@users.noreply.github.com>

Co-authored-by: Euan <euantorano@users.noreply.github.com>
2020-10-21 23:40:45 -04:00
Timothee Cour
ec6a1125a0 --declaredlocs => --declaredLocs (#15672) 2020-10-21 10:33:19 -07:00
Timothee Cour
05752cd5d0 add --declaredlocs (#15666) 2020-10-21 15:37:29 +02:00
Timothee Cour
94a4b57280 make patchFile more discoverable (#15659) 2020-10-20 20:21:10 +02:00
Araq
877d520616 gc.rst: updated the docs to reflect reality 2020-10-20 15:00:36 +02:00
Tomáš Hübelbauer
725c7caa02 Remove bit about opening files not raising (#15654)
Resolved #473 

I am removing this bit because this advice to not throw on recoverable-from cases like a file failing to open is actually not respected by Nim standard library. `readFile` and `readLines` both throw and exceptions must be used as a method of control flow for the recovery from that. There are alternatives, like opening a file handle instead of using these helpers, but that's less convenient than these helper methods for cases where you really want to just slurp up a file to memory and use a fallback value if it doesn't exist or is for whatever reason not readable.
2020-10-20 13:36:19 +02:00
narimiran
5e9dd81baa more "eg" fixes 2020-10-20 10:51:50 +02:00
narimiran
0a686659d2 it is not "eg", it is "e.g." 2020-10-20 10:47:43 +02:00
n5m
436e1fa5b1 fix #15631 (#15632)
* trigger valgrind failure on memory leak

* remove non-malloc tests

* remove ORC test

is redundant because we already have an ARC test

* only run valgrind tests on 64-bit Linux

* disable freebsd and openbsd

* Remove tleak_refc

As to not test implementation details (or bug)

* Fix test failures by removing redundant test

Since this tests/shoulfail/tvalgrind.nim was specified here to fail this test
itself fails since it will be skipped on non-linux CI

* Remove test, reason detailed in the previous commit

* Remove redundant disables

* Revert removing disables

* Add and use valgrind: leaks

* Fix

Co-authored-by: Clyybber <darkmine956@gmail.com>
Co-authored-by: n5m
2020-10-19 22:25:43 +02:00
Timothee Cour
67afe72e9c contributing docs: add instructions for economically restarting failed CI jobs, debugging failed CI (#15576)
* contributing docs: add instructions for economically restarting failed CI jobs, debugging failed CI

* fixup
2020-10-19 14:49:06 +02:00
Timothee Cour
7526472a6e add a section on naming new stdlib module names (#15590) 2020-10-19 14:14:43 +02:00
n5m
b16b2eb06f document that Nim executable must be included (#15611) 2020-10-17 20:30:12 +02:00
n5m
b50a0ee95c fix option formatting (#15591) 2020-10-15 16:43:20 -07:00
Andreas Rumpf
da4aa2e1fb renamed '=' to '=copy' [backport:1.2] (#15585)
* Assign hook name changed to `=copy`
* Adapt destructors.rst
* [nobackport] Duplicate tests for =copy hook
* Fix tests
* added a changelog entry

Co-authored-by: Clyybber <darkmine956@gmail.com>
2020-10-15 12:52:30 +02:00
Andreas Rumpf
51e3e0c7c4 implements https://github.com/nim-lang/RFCs/issues/260 (#15505)
* implements https://github.com/nim-lang/RFCs/issues/260

* added a test case
2020-10-07 00:09:28 +02:00
Andreas Rumpf
92163fa330 implements https://github.com/nim-lang/RFCs/issues/258 (#15503)
* implements https://github.com/nim-lang/RFCs/issues/258

* don't be too strict with custom pragma blocks

* cast pragmas: documentation

* added most missing inference query procs to effecttraits.nim
2020-10-06 16:47:15 +02:00
David Krause
f25ca0d304 added testament documentation link to tools.rst (#15481) 2020-10-05 17:04:47 +02:00
Miran
112b11c154 group procs of the same name in TOC (#15487)
* group procs of the same name in TOC

* correctly show `sink` parameters in TOC

* no need to reinvent the wheel - `mgetorPut` exists

* better setting of text color [ci skip]

* fix CSS for better alignment
2020-10-05 17:03:14 +02:00