Commit Graph

7770 Commits

Author SHA1 Message Date
slangmgh
b447ff7860 Fix #14201 (#14202) 2020-05-03 09:46:42 +02:00
hlaaftana
fbc97e712a move since from inclrtl to std/private/since (#14188)
* move since from inclrtl to std/private/since
* move since import in system below for HCR
2020-05-02 23:51:59 +02:00
Kaushal Modi
0880f118d3 Document that proc named fooTask is created for every foo task [backport] (#14187)
Ref: https://irclogs.nim-lang.org/01-05-2020.html#15:18:03
2020-05-02 17:50:27 +02:00
Miran
9c33bcac5c change 'iff' to 'if' to stop "corrections" once and for all (#14182) 2020-05-01 15:54:03 +02:00
hlaaftana
9b01c6cf48 discardable async procs are now an error (#14176)
* add discard warning in manual
2020-05-01 09:49:13 +02:00
rockcavera
33e9ac7cd3 fix sendTo and recvFrom in asyncnet (#14154)
* added high level sendTo and recvFrom to std/asyncnet; tests were also added.

* add .since annotation, a changelog entry and fixed to standard library style guide.

* Improved asserts msgs and added notes for use with UDP sockets

* pointers removed in parameters and fixes

* added .since annotation

* minor fixes
2020-04-30 22:50:37 +02:00
Andreas Rumpf
89be5be03e fixes #13698 [backport:1.2] (#14175) 2020-04-30 22:45:02 +02:00
Araq
3d2459bdc0 fixes the regression #12860 caused; hotfix 2020-04-30 20:23:53 +02:00
hlaaftana
0aefebb728 JS unittest stacktrace fix, cleanup js repr and inclrtl includes (#14168) 2020-04-30 17:04:53 +01:00
Andreas Rumpf
cc60caedb3 fixes #14054 [backport:1.2] (#14061)
* fixes #14054

* make tests green again

* more tests are green

* maybe now
2020-04-30 06:48:57 +02:00
Andreas Rumpf
d9e907c0e2 fixes #14079 [backport:1.2] (#14163) 2020-04-29 21:58:59 +02:00
hlaaftana
707367e1ca many bugfixes for js (#14158)
* many bugfixes for js

fixes #12672, fixes #14153, closes #14123, closes #11331, fixes #11783, fixes #13966, fixes #14087, fixes #14117, closes #12256.

mostly fixes the fact that it was allowed to assign to newly created temp variables. additionally attempts to get rid of null initialized seqs/strings (though they might pop up here and there); this simplifies a lot of things and makes code size smaller. even if null seqs/strings pop up here and there it's still better than all those bugs existing.

* formatting fixes

* CI fixes

* more CI fixes
2020-04-29 20:55:09 +02:00
cooldome
3b5a504692 parseEnum_regression (#14150)
Co-authored-by: cooldome <ariabushenko@bk.ru>
2020-04-28 19:56:50 +02:00
Jacek Sieka
7d6cbf290a Error -> Defect for defects (#13908)
* Error -> Defect for defects

The distinction between Error and Defect is subjective,
context-dependent and somewhat arbitrary, so when looking at an
exception, it's hard to guess what it is - this happens often when
looking at a `raises` list _without_ opening the corresponding
definition and digging through layers of inheritance.

With the help of a little consistency in naming, it's at least possible
to start disentangling the two error types and the standard lib can set
a good example here.
2020-04-28 19:56:01 +02:00
hlaaftana
cd9af6b804 StringStream & more stdlib modules support for JS/NimScript (#14095)
* StringStream & more stdlib modules support for JS/NimScript

* change back pegs test in line with #14134
2020-04-28 19:44:52 +02:00
cooldome
289d48e5fe bug fix (#14149) [backport:1.2]
Co-authored-by: cooldome <ariabushenko@bk.ru>
2020-04-28 18:02:14 +02:00
PMunch
2f1aad0264 Add RSA key reading and encrypt/decrypt to openssl (#14137)
This adds the procedures to read RSA keys and encrypt/decrypt messages
with both public and private keys.
2020-04-27 21:01:56 +02:00
Neelesh Chandola
d38853c504 Undefine paramCount & paramStr in nimscript.nim for *.nims (#12860)
* Remove `paramStr` and `paramCount` from implicitly imported nimscript.nim
* Update changelog.md
* Update stable nimble commit hash

Co-authored-by: Andreas Rumpf <rumpf_a@web.de>
2020-04-27 19:16:40 +02:00
Timothee Cour
a3a317b76d $ now works for unsigned intergers with nim js (#14122)
* $(unsigned) now works for js
* move NimMajor+friends closer to NimVersion according as per reviewer feedback
2020-04-27 19:15:17 +02:00
Timothee Cour
bb982c644b $(a: float) now works consistently in nim js, avoiding printing floats as ints (#14134)
* fix https://github.com/timotheecour/Nim/issues/133; $(a: float) works in nim js like in other backends

* fix tests

* fix test for windows that prints 1.1e17 differently than other OS
2020-04-27 17:33:03 +02:00
Oscar Nihlgård
664cb2c0be Remove some deprecated procs from std/times (#14129) 2020-04-27 14:42:29 +02:00
Andreas Rumpf
dedb04fa9e new implementations for --gc:orc (#14121)
* cycle collector: new implementation
* cycle collector: make self-adaptive based on its previous effectiveness
* cycle collector: added Lins's jump stack to improve traversal from 3*N to 2*N
* cycle collector: make tests green
* API extensions and bugfixes
* code cleanup and use --gc:orc for tasyncawait
2020-04-27 11:57:26 +02:00
cooldome
eaedd0cb94 add FileReader Web API to js dom (#14105)
* add FileReader to js dom
* minor improvement
Co-authored-by: cooldome <ariabushenko@bk.ru>
2020-04-27 00:08:11 +02:00
Timothee Cour
9384f7ad35 since now takes an optional patch, eg: since: (1, 3, 1) (#14124)
add tests for tinclrtl
2020-04-26 14:55:25 +02:00
rockcavera
d23446c6ba added high level sendTo and recvFrom to std/asyncnet (UDP functionality) (#14109)
* added high level sendTo and recvFrom to std/asyncnet; tests were also added.

* add .since annotation, a changelog entry and fixed to standard library style guide.

* Improved asserts msgs and added notes for use with UDP sockets
2020-04-26 10:16:10 +02:00
hlaaftana
31ba27590c small docs fix in typetraits (#14108) 2020-04-25 20:35:20 +02:00
Alexander Ivanov
56584414f3 Make await a template (#12085)
* Make await a template
* Generate await inside async/multisync
2020-04-25 20:27:03 +02:00
Christopher Dunn
caf30e7cb5 Faster readStr() (#14099)
* Faster readStr()

* https://github.com/nim-lang/Nim/issues/13857

* Add .since annotation and add to changelog

* Private, un-sinced proc for csource bootstrapping
2020-04-25 20:19:11 +02:00
Jae Yang
362c8964bf Fixes #14110 (#14111)
Fixes jsffi usage example in doc
2020-04-25 20:00:24 +02:00
Phil Krylov
d5d3594457 Add critbits.commonPrefixLen (#14072)
* Add critbits.commonPrefixLen

* add inline and since annotations, as well as a changelog entry

Co-authored-by: Andreas Rumpf <rumpf_a@web.de>
2020-04-24 09:31:30 +02:00
hlaaftana
b2141fc2a1 changed type() to typeof() in docs and error messages (#14084) 2020-04-24 09:22:12 +02:00
Timothee Cour
66db9de714 CT sizeof(+friends) for {.importc, completeStruct.} types, enable ABI static checks (#13926)
* -d:checkabi obsolete (ABI check now enforced); add `addTypeHeader` helper
* cleanups
* import sizeof at CT for {.completeType.}
* address comments; revert default enabling of -d:checkAbi for now
* mimportc_size_check.nim => msizeof5.nim; merge mabi_check.nim into msizeof5.nim; refactor
* all pragmas in errmsgs should be written: '.importc' (un-ambiguous and less verbose than {.importc.})
2020-04-23 11:24:09 +02:00
Hiroki Noda
6cfe2e0c3d Set O_NONBLOCK flag atomically (#13934)
These flags were added in Linux 2.6.27, I'm not sure Nim's minimal
support Linux version.
2020-04-22 20:24:45 +02:00
Bung
e1cc0219de fix #14064 xmltree should allow create text node with raw text(non-es… (#14070)
* fix #14064 xmltree should allow create text node with raw text(non-escaped) eg. html style element's text

* change xnRawText to VerbatimText,newRawText to newVerbatimText ,add since anotation

* change changelog_1_2_0.md latest date

* move change log

Co-authored-by: bung87 <crc32@qq.com>
2020-04-22 19:46:55 +02:00
Chris Heller
6c0c882509 Make debugSend/debugRecv procs public. Fixes #12189 (#12190)
* Make debugSend/debugRecv procs public. Fixes #12189

* Make checkReply proc public. Part of #12189

* Add doc comments for debugSend,debugRecv and checkReply
2020-04-22 17:45:31 +02:00
wonderix
5571d48c32 Add the ability to pass title case headers to an HTTP server (#13968)
* Add the ability to pass title case headers to an HTTP server

* Remove unnecessary type spec of titleCase

* Replace convert member proc by isTitleCase

Co-authored-by: wonderix <wonderix@googlemail.com>
2020-04-22 17:43:39 +02:00
Andreas Rumpf
269a458d74 cycle collector (#14071)
* figured out the wrong cycle trace proc problem
* cycle collector/break refactorings and minor improvements
2020-04-22 17:34:35 +02:00
hlaaftana
01523b2b58 change some Exceptions to CatchableError or Defect, fixes #10288 (#14069) 2020-04-22 16:49:41 +02:00
Vindaar
d42c5a575d base parseEnum on a case statement, fixes #14030 (#14046)
* base `parseEnum` on a case statement, fixes #14030

* apply simplifactions / clean up, remove `norm` node, use strVal

* export `normalize` in json.nim

* cmp using nimIdentNormalize, error at CT if ambiguous enum found

`nimIdentNormalize` provided by @cooldome.

We track all names of the branches we have created so far and error if
a duplicate is found.

Dummy change to make github react...

* fix docstring of `nimIdentNormalize`

* make `typ` arg `typedesc`, add lineinfo, call norm. only once
2020-04-22 09:41:56 +01:00
Hessam Mehr
c3f4b93060 Treat zig like clang/gcc wrt integer arithmetic. (#13957) 2020-04-22 08:31:24 +02:00
Arnaud Moura
dc40fb805f Fix OS detection in a docker container (#13172)
* Support detection in docker container.
* Get only ID information in os-release.
* Add test to distros module.
* Fix Linux OS detection in Windows.
* Fix OS detection for FreeBSD and OpenBSD.
2020-04-22 07:49:42 +02:00
Timothee Cour
7ce0358351 fix #13222: make relativePath more robust and flexible (#13451)
* * relativePath(foo) now works
* relativePath(rel, abs) and relativePath(abs, rel) now work (fixes #13222)
* relativePath, absolutePath, getCurrentDir now available in more targets (eg: vm, nodejs etc)
* fix bug: isAbsolutePath now works with -d:js; add tests
* workaround https://github.com/nim-lang/Nim/issues/13469
* remove `relativePath(path)` overload for now
* add back changelog after rebase
2020-04-21 23:53:55 +02:00
hlaaftana
5608a4e57b Add deques.peekFirst/Last(var Deque[T]) -> var T (#13542)
* Add deques.peekFirst/Last(var Deque[T]) -> var T
* Add changelog entry for deques.peekFirst/Last var T overloads
* Add since annotation to peekFirst/peekLast

Co-authored-by: Andreas Rumpf <rumpf_a@web.de>
2020-04-21 22:09:19 +02:00
Arnaud Moura
cb2b9bd797 Add package install command for FreeBSD and OpenBSD. (#14051) 2020-04-21 22:07:19 +02:00
Oscar Nihlgård
218cbf0e09 Times refactorings (#13949) 2020-04-21 17:07:37 +02:00
Euan
7828199827 #12103 - CI for OpenBSD (#12105)
* Working on OpenBSD CI
* Condense steps into 2 steps to make output easier to follow.
* Move up one directory after csources build.
* Remove FreeBSD build manifest and add OpenBSD test ignores for coroutines and hot code reloading.
* If runCI fails, run the test results script.
* Add email trigger for build failure
* Remove .git from repository URL
* Disable SFML test on OpenBSD
* Disable tgetaddrinfo on OpenBSD as only UDP and TCP protocols are supported.
* Remove getFilePermissions as it causes CI test failures with NimScript.
* Set clang as cc in nim.cfg and use gmake to build csources.
* Add getCurrentDir to nimscript.
* Remove duplicate getCurrentDir and check for not weirdTarget.
* Add CI badge for OpenBSD.
* Disable tests which allocate lots of memory for OpenBSD.
* Use `CORO_BACKEND_SETJMP` on OpenBSD rather than ucontext.
* Simplify building of koch
* Disable t8657 on OpenBSD. See issue #13760.
* Fix #12142 - tarray_of_channels fails on OpenBSD
* Disable thhtpclient_ssl and tosprocterminate on OpenBSD. These tests can be enabled at a later date after fixing them.
* Install libffi.
* Set path to libc for openbsd.
* Disable tevalffi for now.
* Remove tevalffi.nim.
* Use ncpuonline sysctl rather than ncpu.
* Disable tacceptcloserace and tasynchttpserver on OpenBSD.
* Enable tacceptcloserace and tasynchttpserver.
* Fix #13775 as suggested by @alaviss - use /bin/cat on OpenBSD rather than /bin/sh.
* Enable test on OpenBSD.
* Disable tflowvar on OpenBSD.
2020-04-21 15:05:21 +02:00
treeform
89e6a7ab48 Fix the getSelection method. (#13632) 2020-04-21 14:57:19 +02:00
Judd
04c326569b fix mapIt issues #12625 & #12639 (#14041)
* fix mapIt issues #12625 & #12639:

1. fallback to call `map` when the result of `op` is a closure;
2. use `items(s)` in the for loop.

* fix test errors.

* add comments and InType is moved.

* fix ident.
2020-04-21 14:50:16 +02:00
Tristram Oaten
1a44b7e3ce New runnableExample for newAsyncHttpClient() (#14045) 2020-04-21 14:47:06 +02:00
alaviss
7beed44fc9 asyncdispatch: export Callback (#14042) [backport]
This let us see the definition of `Callback` in docs, which is required
to even make use of asyncdispatch.

Ref #13539.
2020-04-21 11:21:36 +02:00