Commit Graph

5566 Commits

Author SHA1 Message Date
Oscar Nihlgård
c344fb311d Allow timezone procs to be closures 2018-01-05 10:07:46 +01:00
Araq
9abbd6c880 Merge branch 'devel' of github.com:nim-lang/Nim into devel 2018-01-03 13:24:44 +01:00
Araq
e593fef320 memfiles: better error checking for Windows; refs #6361 2018-01-03 13:24:20 +01:00
Eduardo Bart
bbfe6e81ad Add newSeqUninitialized, closes #6401 (#6402) 2018-01-03 12:56:35 +01:00
Dominik Picheta
22cc7c62e5 Fixes times module compilation on cpp backend. (#7004) 2018-01-03 12:46:55 +01:00
Sergey Avseyev
8941f5bd9c Use safe limit for toRational(float, int) (#7021)
Current limit `high(int32)` is not safe for 32-bit platforms
and it will overflow (even when running its own test suite).
Similar behaviour would be when try to set limit to `high(int64)`
on 64-bit platforms.

This change selects safe maximum value based on platform
size of int. Safe maximum considered half of int size (for
backward compatiblity).
2018-01-03 12:41:10 +01:00
GULPF
74fb3e6e6e Improve deprecation comments in times module 2017-12-31 14:40:46 +01:00
Yuriy Glukhov
d1e10f9aa3 Fixed mutex usage in SharedList and SharedTable. Closes #6988 (#6990) 2017-12-31 09:28:51 +01:00
Daniil Yarancev
a521f98392 Add warnings about deprecation to times module (#7001)
* Add warnings about deprecation to times module

I've added warnings about some procedures being deprecated.
Also I can't find what is the replacement for `getTimezone` proc, please help with that

* Update times.nim

* Update times.nim
2017-12-30 15:15:15 +00:00
Ruslan Mustakov
3073f08e48 Add hasPendingOperations check to asyncdispatch.drain 2017-12-30 10:27:31 +01:00
Andreas Rumpf
5e8ac0792e Merge branch 'devel' of github.com:nim-lang/Nim into devel 2017-12-28 19:55:04 +01:00
Andreas Rumpf
0a3cd6d9ba fixes a serious poll() regression that caused poll() to ignore the timeout parameter 2017-12-28 19:54:55 +01:00
Dominik Picheta
7e6dc3679a Simplify async traceback processing. 2017-12-28 09:21:22 +01:00
Andreas Rumpf
3593a4bdd1 made the logic correct 2017-12-28 09:21:22 +01:00
Araq
1c2dee18d0 attempt to get the stack trace logic right; fix boundaries 2017-12-28 09:21:22 +01:00
Araq
b3055d8735 attempt to get the stack trace logic right 2017-12-28 09:21:22 +01:00
Araq
6cf2fcaaf1 optimized friendly stack traces 2017-12-28 09:21:22 +01:00
Dominik Picheta
383c80971c No need to recurse now that mergeEntries doesn't do any pattern matching. 2017-12-28 09:21:22 +01:00
Dominik Picheta
6301e33543 Show only detailed async tracebacks. 2017-12-28 09:21:22 +01:00
Dominik Picheta
391f877e6c Attempt to provide simplified and detailed tracebacks 2017-12-28 09:21:22 +01:00
Dominik Picheta
3a790c9c72 Rename cb0 to asyncProcName_continue + other improvements to async tracebacks. 2017-12-28 09:21:22 +01:00
Dominik Picheta
a9a13e470b Go through the re-raise stacks for more detailed tracebacks. 2017-12-28 09:21:22 +01:00
Dominik Picheta
9ca6afe73a Refine the async tracebacks. 2017-12-28 09:21:22 +01:00
Dominik Picheta
f73015ad9e Implement some simple pattern-based transformation for async tracebacks. 2017-12-28 09:21:22 +01:00
Yuriy Glukhov
e49f18801c Fixed compilation error (#6979) 2017-12-27 17:35:57 +01:00
Konstantin Molchanov
b592f069bb Tables: toCountTable: Update docs. 2017-12-27 13:44:47 +04:00
Konstantin Molchanov
c36d7ffc7c Tables: make toCountTable actually count the elements of the input openArray. 2017-12-27 13:30:32 +04:00
cooldome
2b3ec0a7c6 Implement language feature #6885 (#6954) 2017-12-24 22:22:03 +01:00
Mathias Stearn
6bd3a2826f cmp(x, y: string) now uses memcmp rather than strcmp (#6869) (#6968) 2017-12-24 15:23:17 +01:00
Dominik Picheta
89b6f0318b Merge pull request #6957 from cheatfate/fix6906
Fix #6906
2017-12-22 15:33:22 +00:00
Dominik Picheta
8d992c4176 Merge pull request #6725 from FedericoCeratto/unittest-5114
Add unittest suite/test name filters
2017-12-22 15:26:45 +00:00
skilchen
a89b81eb96 fixes #6353 (#6951) 2017-12-21 16:32:26 +01:00
cheatfate
b22d9e4339 Fix #6906 2017-12-21 16:45:42 +02:00
Dominik Picheta
8c0e73479e Merge pull request #6944 from alehander42/fix-discardable
Make asyncjs Future[void] play nicely with last line discardable calls & forward declaration
2017-12-21 12:25:29 +00:00
Araq
e0e1241a54 move securehash back into the stdlib 2017-12-21 12:34:38 +01:00
Dmitry Atamanov
63403b31ad Modified behavior of walkDirRec (#6952) 2017-12-21 11:15:19 +01:00
Araq
77d56aaff6 cleanup times.nim 2017-12-21 10:11:45 +01:00
Araq
218679fc95 Merge branch 'devel' of github.com:nim-lang/Nim into devel 2017-12-21 10:03:56 +01:00
Araq
ee67a67ac4 first steps in adding template/macro calls to stack traces 2017-12-21 10:03:33 +01:00
Mathias Stearn
af1404c85d Minor fixes to strformat docs (#6953) 2017-12-21 09:58:24 +01:00
skilchen
47d00eb397 add missing math.trunc for js backend (#6950) 2017-12-20 22:26:22 +01:00
Alexander Ivanov
eba544996d Fix docs! 2017-12-20 14:11:22 +02:00
Alexander Ivanov
b3dfc93bee Fix forward 2017-12-19 20:50:37 +02:00
Alexander Ivanov
7f6afa9e9b Make asyncjs Future[void] play nicely with last line discardable calls 2017-12-19 13:57:37 +02:00
Andreas Rumpf
85ac3130aa make asyncdispatch.poll completing all opterations that can be comple… (#6911)
introduce asyncdispatch.drain that completes all operations that can be completed immediately; implements #6523
2017-12-19 12:39:50 +01:00
Yuriy Glukhov
3de81af44d Added a couple of procs for RSA verification (#6942) 2017-12-19 11:04:42 +01:00
Alexander Ivanov
a9ba02e8c9 added asyncjs standard library module (#6841) 2017-12-19 00:34:54 +01:00
GULPF
a879973081 Better times module (#6552)
* First work on better timezones

* Update tests to new api.
Removed tests for checking that `isDst` was included when formatting, since `isDst` no longer affects utc offset (the entire utc offset is stored directly in `utcOffset` instead).

* Deprecate getLocaltime & getGmTime
* Add `now()` as a shorthand for GetTIme().inZone(Local)
* Add FedericoCeratto's timezone tests (#6548)
* Run more tests in all timezones

* Make month enum start at 1 instead of 0
* Deprecate getDayOfWeekJulian
* Fix issues with gc safety
* Rename TimeInfo => DateTime
* Fixes #6465
* Improve isLeapYear
* FIx handling negative adjTime

* Cleanup:
- deprecated toSeconds and fromSeconds, added fromUnix and toUnix instead (that returns int64 instead of float)
- added missing doc comments
- removed some unnecessary JS specific implementations

* Fix misstake in JS `-` for Time

* Update usage of TimeEffect
* Removed unecessary use of `difftime`
* JS fix for local tz
* Fix subtraction of months
* Fix `days` field in `toTimeInterval`
* Style and docs
* Fix getDayOfYear for real this time...
* Fix handling of adding/subtracting time across dst transitions
* Fix some bad usage of the times module in the stdlib
* Revert to use proper time resoultion for seeding in random.nim
* Move deprecated procs to bottom of file
* Always use `epochTime` in `randomize`
* Remove TimeInterval normalization
* Fixes #6905

* Fix getDayOfWeek for year < 1
* Export toEpochDay/fromEpochDay and change year/month/monthday order
* Add asserts for checking that the monthday is valid
* Fix some remaining ambiguous references to `Time`
* Fix ambiguous reference to Time
2017-12-18 23:11:28 +01:00
Araq
2775cda6e1 added new stdlib module 'cstrutils' for easier cstring handling 2017-12-18 13:16:29 +01:00
Araq
69aeb86f49 strformat: fix the documentation examples 2017-12-17 20:40:43 +01:00