Commit Graph

6663 Commits

Author SHA1 Message Date
Araq
647066e378 make the stdlib work with the changed docgen 2019-01-11 22:17:43 +01:00
Araq
56b804a283 RST parser: fixes #8158 2019-01-11 22:17:43 +01:00
Araq
ee7f2d97cc docgen: support markdown headings too 2019-01-11 22:17:43 +01:00
Araq
5ef5dc86c5 docgen: support markdown link syntax; enable markdown extensions 2019-01-11 22:17:43 +01:00
Araq
c3d80647ae docgen: render 'interpreted text' the same as inline literals for markdown compat 2019-01-11 22:17:43 +01:00
Jörg Wollenschläger
ceabbeadd7 Fixes new atomics for C + vcc (#10267) 2019-01-11 12:07:46 +01:00
narimiran
0a2f711b9e revert moving oids and smtp to graveyard 2019-01-11 08:51:19 +01:00
Timothee Cour
540d102d87 fix #10261 unittest now returns 1 on error instead of buggy behavior (#10264) 2019-01-11 07:59:20 +01:00
Jörg Wollenschläger
ab425d793a [RFC] Better atomics (#8620)
* Initial version of C++11 style atomics
* Make Atomic[T] always concrete
2019-01-10 19:18:00 +01:00
Vindaar
8e600b78ca add unsetControlCHook to remove a Ctrl-C hook after it was set (#7267)
* add unsetControlCHook to remove a Ctrl-C hook after it was set

Adds the inverse proc to setControlCHook in order to lift a Ctrl-C
hook after it has been set.

* remove check for noSignalHandler in system/excpt.nim
2019-01-10 13:44:44 +01:00
Neelesh Chandola
d998cb58dd void object fields are now ignored by codegen and fields/fieldPairs iterator (#10144)
* Codegen now ignores object fields of type void
* Fix `$` bug for objects/tuples where it does not add a comma
* fields/fieldPairs iterators now ignore void types
* Use `isEmptyType` instead of checking for `tyVoid` directly
2019-01-10 12:49:35 +01:00
Miran
6389271d1c Merge pull request #10248 from narimiran/graveyard
Move four modules to graveyard
2019-01-10 11:17:06 +01:00
Oscar Nihlgård
b3435d22dc Times cosmetic changes (#10237)
* Add more Date wrappers to jscore

* Times cosmetic changes
- Improved docs
- Code wrapped at 80 chars
- Formatting fixes using nimpretty
- Remove some old deprecated procs
2019-01-10 10:56:12 +01:00
Oscar Nihlgård
3ed5f83704 Fix exception tracking for system.open (#10253) 2019-01-10 09:28:09 +01:00
narimiran
be958d60c9 remove oids 2019-01-10 09:17:12 +01:00
narimiran
1a3763fe13 remove smtp 2019-01-10 09:17:12 +01:00
narimiran
8d9b093440 remove scgi 2019-01-10 09:17:12 +01:00
narimiran
da57c0ab99 remove subexes 2019-01-10 09:17:12 +01:00
Oscar Nihlgård
87232a38e4 ValueError now inherits from CatchableError (#10246) 2019-01-10 08:49:57 +01:00
Notkea
11050d1104 make Stream.{read,peek} procs public (#9806)
Those are useful in generic code, and `proc write*[T](s: Stream, x: T)` was already public.
2019-01-09 08:06:40 -06:00
Ico Doornekamp
0229dfd199 epoll selector starts with reasonable fd set size (1024) and increases in powers of two when needed. This prevents the selector to allocate large amounts of memory at startup on systems with a high RLIMIT_NOFILE setting (#10194) 2019-01-09 10:46:22 +01:00
genotrance
def477acb7 Merge pull request #10236 from treeform/passSSLPath
Fix libssl order. Newest one is 1.1
2019-01-08 23:24:45 -06:00
Timothee Cour
6ce3949c8a add isNamedTuple; make $(1, 2) be (1, 2) instead of (Field0: 1, Field1: 2) which leaked implementation detail (#10070)
* add `isNamedTuple`; make $(1, 2) be (1, 2) instead of leaking implementation detail (Field0: 1, Field1: 2)
  fixes this: #8670 (comment) /cc @alehander42 @Vindaar @mratsim

* Note: isNamedTuple is useful in other places, eg #10010 (comment)

* move isNamedTuple to helpers.nim to avoid exposing new symbol to system.nim

* remove workaround in tests/vm/tissues.nim failing test now that #10218 was makes it work
2019-01-08 18:37:25 -08:00
Andre von Houck
21078798ea Fix libssl order. Newest one is 1.1 2019-01-08 10:30:22 -08:00
alaviss
6737634d88 os.execShellCmd: fixes #10231 (#10232)
Darwin has long deprecated the wait union, but their macros still assume
it unless you define _POSIX_C_SOURCE. This trips up C++ compilers.

This commit duplicates the behavior of WEXITSTATUS when _POSIX_C_SOURCE
is defined.
2019-01-08 12:41:15 +01:00
treeform
3ed833198b Better LibSSL search order. (#10230) 2019-01-08 09:50:25 +01:00
alaviss
20402579a2 system/strmantle: avoid leaking docs to system.nim [ci skip] (#10233)
thanks @timotheecour for spotting this
2019-01-08 08:42:10 +01:00
jcosborn
044cef152f add custom pragma support for var and let symbols (#9582)
* add custom pragma support for var and let symbols
* updated changelog for custom pragmas on var and let symbols
* add oldast switch for backwards compatibility
2019-01-07 12:36:06 +01:00
alaviss
139fa396e8 os.execShellCmd: use WEXITSTATUS to retrieve exit code (#10222)
According to POSIX, system() shall returns the termination status in the
format specified by waitpid(), which means WEXITSTATUS should be used to
retrieve the exit code portably.

This fixes execShellCmd on Haiku.
2019-01-07 12:27:07 +01:00
Miran
5345c5b130 remove deprecated modules (#10215)
* removed from `compiler`:
    * lists (deprecated 2 years ago)

* removed from `lib` (all deprecated 3 years ago):
    * ssl
    * matchers
    * httpserver

* removed from `lib/deprecated`:
    * unsigned
    * actors (and three accompanying tests)
    * parseurl

* moved to `lib/deprecated`:
    * securehash (the reason for not directly removing - it was deprecated (only) one year ago)
2019-01-07 10:37:49 +01:00
Ico Doornekamp
be9d1280ae Added examples to strtabs module (#10160) 2019-01-07 00:52:19 +01:00
Leonardo Cecchi
b7be67349b Fix ODBC SQL Error string decoding (#10207) [backport]
ODBC Errors were presented to the users as a sequence of characters.
I.e.:

    >test_oracle.exe

    Error: ['H', 'Y', '0', '0', '0', '\x00', '\x00', ...]

    test_oracle.nim(15)      test_oracle
    test_oracle.nim(8)       test_oracle
    db_odbc.nim(534)         open
    db_odbc.nim(168)         dbError
    Error: unhandled exception: ODBC Error [DbError]

This patch fix the string decoding, creating a real string:

    >test_oracle.exe

    Error: HY000 [Oracle][ODBC][Ora]ORA-12541: TNS:no listener

    test_oracle.nim(15)      test_oracle
    test_oracle.nim(8)       test_oracle
    db_odbc.nim(534)         open
    db_odbc.nim(168)         dbError
    Error: unhandled exception: ODBC Error [DbError]
2019-01-07 00:48:55 +01:00
c-blake
ea3e32c224 Remove totally unneeded import of hashes. (#10221) 2019-01-07 00:42:49 +01:00
Federico Ceratto
2fa35126b0 Fix getAddrInfo, add IPPROTO_ICMPV6 Closes #10198 2019-01-06 20:23:44 +00:00
Timothee Cour
ffea3fbfae * move up runnableExamples definition so can be used more in system.nim (#10196)
* document that toInt, toBiggestInt round towards 0 and add runnableExamples
* minor doc fixes
2019-01-05 16:01:10 +01:00
Hugo Locurcio
e5ca57d85c Fix the tuple returned by os.splitFile() in documentation (#10197) 2019-01-05 01:00:38 +01:00
alaviss
be0a4d1342 fix system.nim documentations (#10168)
* system: fix nimGC_getStackBottom doc
* system/helpers: avoid leaking docs to system
2019-01-04 15:13:07 +01:00
Neelesh Chandola
e9a192c36f expandFilename on windows is now consistent with other platforms (#10154) 2019-01-04 15:11:48 +01:00
rec
ba7d33b4e4 Guard against null exception (#10162) 2019-01-04 15:05:03 +01:00
Timothee Cour
319b46230c fix bug in doAssertRaises when exception==Exception (#10172)
* fix bug in doAssertRaises when exception==Exception
* add testcase for doAssertRaises
2019-01-04 13:54:02 +01:00
Miran
69149a0e92 [backport] improve unicode docs, fixes #2353 (#10174)
* as instructed in #2353, provides a short description why
there are no specialized procs for seq[Rune]
* adds several examples to better explain what some functions do
* small fixes (double backticks, add missing dots, etc.)
* use `rune` instead of "unicode characer"
2019-01-04 13:20:12 +01:00
Miran
77166ba795 [backport] correctly document toInt, fixes #2764 [ci skip] (#10176) 2019-01-04 09:25:58 +01:00
Oscar Nihlgård
9fb8c3d965 Add {.noReturn.} to system.raiseAssert (#10161) 2019-01-02 17:39:53 +01:00
jiro
e7fa8f3443 Add Example code to Documentation comment of wordWrap proc. (#10146) 2019-01-01 09:56:59 +01:00
c-blake
7ac1fc81fd Resolve things raised in https://github.com/nim-lang/Nim/issues/10081 ? (#10084)
* Resolve things raised in https://github.com/nim-lang/Nim/issues/10081 ?
CDF is a standard ident in all things related to random numbers/sampling,
and full words "cumulativeDistributionFunction" would be silly long, in
this case, IMO.  We use lowercase `cdf` to make it not look like a type,
remove all looping from `sample` letting callers do it.  Besides just
side-stepping any `sampleSize` name choice, callers may want to filter
out samples anyway which this makes slightly simpler.

Also add two variants of `cumsum`, value return and in-place update
distinguished by the var-ness of the first argument.  Add tests for
`int` and `float` for both `cumsum` and the new `sample`.  (The sample
tests exercise the value return mode of `cumsum`.)

Functionality pre-this-PR `sample(a, w)` is now the almost as simple
`for i in 0..<n: sample(a, w.cumsum)`, but this new code factoring is
almost surely better.  The statistical tests pass, as before.

* Address Araq comment in https://github.com/nim-lang/Nim/pull/10084
We can always add in some `var` version later if desired to save
memory, but this change now at least firms up the `sample` interface.

* Rename `cumsum` -> `cumsummed` to honor NEP1 style.  Re-instate `cumsum` as
the in-place transformation.  Test both in `tests/stdlib/tmath.nim` and use
`cumsummed` in the example code for sample since that's a simpler example.

* Fix requests from https://github.com/nim-lang/Nim/pull/10084 :
  example in lib/pure/math.nim and comment whitespace in lib/pure/random.nim
2018-12-31 14:52:51 +01:00
Andreas Rumpf
2ee2022c29 help Nim optimize intsets.initIntSet 2018-12-30 11:45:16 +01:00
cooldome
82c009a2cb Dead code elimination for entire modules and their init procs if empty (#10032)
* fixes #9798
* Change order of write modules
* Move datInit calls ahead of initStackBottom
2018-12-30 11:28:12 +01:00
Timothee Cour
a6633b9658 fix typetraits.$ regression https://github.com/c-blake/cligen/issues/84 (#10131)
* fix typetraits.`$` regression https://github.com/c-blake/cligen/issues/84
* add test
2018-12-30 09:40:21 +01:00
Alexander Ivanov
aadbdd6b06 Support undefined in isNil (#9960) 2018-12-30 02:48:37 +01:00
Timothee Cour
dd33f41877 refs #10121 (#10124) 2018-12-30 02:06:15 +01:00