Commit Graph

280 Commits

Author SHA1 Message Date
Araq
4ab9953787 fixes #8961 2018-09-14 11:40:43 +02:00
Araq
7cea0c1765 closes #5252 2018-09-03 10:16:11 +02:00
gemath
f26ed1d540 Add interpreting event parser proc to pegs module. (#8075)
* Added simple interpreting event parser to pegs module.
* Has side-effects problem.
* Macro solution works.
* First flat callback test works.
* Fixed namespace pollution.
* Added handler for pkChar.
* Replaced event parser test.
* Started extensive docs.
* 'callback' to 'handler' renaming part 1.
* Renaming 'callback' to 'handler' part2, completed comments.
* Fixed exported API pollution.
* Added more event handler hooks, fixed comments.
* Changed event parser addition entry.
* Fixed variable names and comments.
* Enhanced comment.
* Leave handlers are not called for an unsuccessful match.
* The three varieties of back-reference matches are processed in separate
of-clauses now.
* Improved hygiene and (almost) eliminated exports.
* Trying to fix CI test breakage by eliminating export.
* Trying to fix CI test breakage by eliminating exports.
* Re-activated leave handler code execution for unsuccessful matches.
* Eliminated the last export statement (with a funny smelling hack).
* Make sure leave handler code is executed for all unsuccessful matcher
cases.
* Replaced local unicode.`==` with export.
2018-08-24 20:13:37 +02:00
Oscar Nihlgård
1d93991929 Cleanup ttimes (#8714)
* Refactor fromWinTime

* Cleanup ttimes
2018-08-22 17:20:41 +02:00
Dmitry Atamanov
b75808c7d9 Fixes ropes regressions due to the not-nil strings (#8687) 2018-08-20 16:55:22 +02:00
Oscar Nihlgård
33ed8f7e73 times.Timezone changes (#8527)
* Use floorDiv in times.nim

* New implementation of times.Timezone

* Tweak doc comments

* Fix typo
2018-08-17 11:12:58 +02:00
Andreas Rumpf
0da91aa744 changes how the now illegal 'string == nil' comparison is detected 2018-08-15 16:31:56 +02:00
Araq
a0cde8cee6 Merge branch 'devel' into araq-misc 2018-08-13 20:16:18 +02:00
Andreas Rumpf
7f49364fd0 make more tests green 2018-08-13 12:29:03 +02:00
Iván Montes
ee29370f60 Fixed 7478: splitLines keepEol option (#8621) 2018-08-13 11:42:50 +02:00
Timothee Cour
43f634db8d fixes #8519; implements T.distinctBase to reverse T = distinct A (#8531) 2018-08-10 09:20:14 +02:00
Timothee Cour
674bd7bfad fix wrong arch defined(osx) (#8492) 2018-08-02 01:19:29 +02:00
andri lim
2e6d073be1 fixes #8468, stdlib.encodings.convert not crash anymore on windows (#8470) 2018-07-30 12:04:49 +02:00
andri lim
f92d61b1f4 fixes #8037, json.to support object with distinct types (#8086)
* add distinct types to json 'to' macro

* fix json 'to' macro and add more test
2018-07-19 16:38:40 +01:00
Oscar Nihlgård
3b310e91cd New implementations of times.parse & times.format (#8094) 2018-07-09 20:04:25 +02:00
Federico Ceratto
d65429d857 Add normalizePath and tests 2018-07-06 20:21:39 +01:00
Andreas Rumpf
963f431443 Merge branch 'araq-devel' of github.com:nim-lang/Nim into araq-devel 2018-07-06 17:27:02 +02:00
Andreas Rumpf
32230ffe31 make tests green again 2018-07-06 17:26:45 +02:00
Araq
8bcaee1fdf make tmemfile2 work again 2018-07-06 15:53:32 +02:00
Andreas Rumpf
20950ee073 make test green for OSX 2018-07-06 11:26:36 +02:00
Andreas Rumpf
86a7054c88 Merge branch 'devel' into araq-devel 2018-07-04 19:25:53 +02:00
Tomohiro
c79f488027 Fix os.unixToNativePath proc returns wrong result(#8179) (#8181)
* Fix os.unixToNativePath proc returns wrong result(#8179)

* Add tests for unixToNativePath
2018-07-02 17:14:26 +02:00
Andreas Rumpf
c7298561c1 system.nim: remove deprecated symbols 2018-06-28 07:42:46 +02:00
gemath
db68bbe4f7 Pegs AST read access (#8050)
* Make PEG AST nodes readable from outside the module.

* Added a test module for the pegs stdlib module.

* Edited changelog.

* Renamed ``sons`` iterator to ``items``, added ``pairs``, inlined both.

* Updated entry and moved it to the right category.
2018-06-19 18:13:33 +01:00
Dmitry Atamanov
bf5d619a52 Add MemMapFileStream. Fixes in memFiles. (#7944)
* Add MemMapFileStream

* Added tests

* Fixed bug in memfiles (zero index for string)

* Added flush to changelog

* Attempt to fix Win's nuances

* Fix attempt to fix

* Continue...

* And again...

* Reworked tests (all for win on Win)

* Fixes in flush (Win)

* Replace fn vars to consts

* Added the attempts parameter to the flush

* Replace while to for

* Move to memfiles

* Use Natural instead of uint

* Better error messages for append mode. Handle specific cases.
2018-06-14 17:34:26 +01:00
Vindaar
e80be6173d Add parse bin int, fixes #8018 (#8020)
* clarify `parseHexInt`, `parseOctInt` docstring and exception msgs

* add `parseBinInt` based on `parseutil.parseBin` implementation

Adds a `parseBinInt`, which parses a binary integer string and returns
it as an integer. This is based on the implementation of
`parseutil.parseBin`, removing the unnecessary parts.

* add tests for all `parse(Hex|Oct|Bin)Int` procs

* replace `parse*Int` proc impls by call to parseutil procs

Replaces the `parse(Hex|Oct|Bin)Int` procedure implementation by calls
to the `parseutil` procs, which receive a mutable argument.

Has the main advantage that the empty string as well as a "prefix
only" string, e.g. "0x" counts as an invalid integer.

Also moves the `parseOctInt` proc further up in the file so that all
`parse` procs are below one another.

* replace `var L` by `let L` in `parse` procs

There's no reason for the usage of `var` here.

* add `maxLen` optional arg for `parseutil.parse(Oct|Bin)`

Plus small change to test cases.

* update changelog about `parse*Int` procs

* fix `rejectParse` template in `tstrutils`

* make sure only `s.len` chars are parsed, if `maxLen+start` > s.len

Fixes a previous bug in `parseHex` (and now affected `parseOct` and
`parseBin`), which allowed to set `start + maxLen` to be larger than
the strings length. This resulted in an out of bounds access.

* move `parse*Int` proc change to breaking changes, add double `
2018-06-13 13:32:12 -04:00
Yuriy Glukhov
b2323de914 Fixed compilation error when Sockaddr_in4 or Sockaddr_in6 passed to fromSockAddr 2018-06-07 21:10:00 +03:00
skilchen
230692a22f Fix strformat neg zero (#7954)
* fix strformat handling of neg zero with sign

* better tests for neg zero with sign

* use inplace insertion of the sign as suggested by Varriount
2018-06-05 00:09:07 -04:00
skilchen
fd102f39bb Fix strformat precision handling for strings (#7941)
* fix strformat precision handling for strings

* add some limited unicode awareness to the precision handling for strings

* improvement suggested by Varriount: use setLen and runeOffset instead of runeSubstr
2018-06-04 18:26:16 -04:00
Oscar Nihlgård
05b447374b Use higher time resolution when available in os.nim (#7709) 2018-06-04 14:56:56 +02:00
skilchen
07ff9940f4 fix strformat zeropadding for floats (#7934) 2018-06-01 22:23:50 -04:00
七秒不觉梦
b6b6382e0b Added: type name output when exception raised from unittest (#7869) 2018-05-28 05:24:04 +03:00
Dominik Picheta
f7f69b1abb Merge pull request #7624 from skilchen/fix-issue7620
there is no hour 0 in am/pm time (see #7620)
2018-05-03 16:07:27 +01:00
Araq
ed79201d0b make more tests green 2018-04-30 11:16:56 +02:00
Andreas Rumpf
5237ef4f52 update the documentation about the new strings/seqs behaviours 2018-04-29 08:14:00 +02:00
Oscar Nihlgård
b34580fd5b Rename Time.nanoseconds to nanosecond (#7673)
* Rename `Time.nanoseconds` to `nanosecond`

* Fix bug with Duration comparision
2018-04-25 02:43:26 +02:00
Oscar Nihlgård
7d034d7b6a Add fromWinTime and deprecate unixTimeToWinTime/winTimeToUnixTime (#7641) 2018-04-19 22:41:06 +02:00
skilchen
bf6e82a861 there is no hour 0 in am/pm time 2018-04-16 17:40:54 +02:00
Oscar Nihlgård
02d6dd723d Timeinterval optimization (#7608)
* TimeInterval optimization

* Fix typo in `$`(Duration)
2018-04-16 00:01:34 +02:00
Oscar Nihlgård
f6df2d9956 Sub second time resolution (#6978)
* Add deprecation warnings to recently deprecated procs

* Fix bad usage of the times module

* Introduce sub second resolution

* Fix usage of C's time()

* Switch to nanosecond resolution

* Make Time & Duration opaque again and fix some errors

* Change back to TimeInterval for shorthands

* Fix JS test

* Fix build error for windows

* Undeprecate epochTime

* Documentation and minor changes

* Lots of bugfixes and doc comments

* Attempt to make travis & appveyor green

* Fix edge cases for dealing with the local timezone

* Workaround JS backend overflow/underflow bug

* Use better workaround for not knowing the size of time_t

* Use all available timezones for tests

* Fix indentation

* Add procs for accessing the fractional part of a duration

* Order time units from smallest to largest since it makes more sense

* Include months and years in `TimeUnit`

* Review fix
2018-04-13 07:36:30 +02:00
treeform
f3db632b1d Added count(*) support to sql parser. Fixed warnings in sql parser. (#7490) 2018-04-12 17:49:24 +02:00
Dominik Picheta
58dc8a399e Merge pull request #7450 from cabhishek/devel
Fixes #6902
2018-04-04 22:36:18 +01:00
Dominik Picheta
7ef0cfebb5 Merge pull request #7495 from GULPF/fix-fill-bug
Fix algorithm.fill for empty input
2018-04-04 13:54:40 +01:00
Oscar Nihlgård
da077eea7c Move algorithm tests away from koch 2018-04-04 13:00:51 +02:00
Dominik Picheta
39c71d6211 Merge pull request #7336 from yglukhov/ipaddr-sockaddr-conversions
Conversion procs for (IpAddress, Port) <-> (SockAddr, Socklen)
2018-04-02 14:31:05 +01:00
data-man
759023e157 Comparing datetimes 2018-04-01 00:41:38 +03:00
Abhishek Kapatkar
c7cba5e6f0 Fixes #6902 2018-03-30 13:43:01 -07:00
Dominik Picheta
9c2cdc94a2 Fixes #7433. 2018-03-29 11:57:53 +01:00
Yuriy Glukhov
1bd0efb067 Fixed crash/interface. Added tests. 2018-03-15 15:49:41 +02:00
twetzel59
9079517d71 Resolves #5588: adds openFileStream proc that throws on failure (#7282) 2018-03-04 17:30:28 +01:00