Commit Graph

2903 Commits

Author SHA1 Message Date
Zahary Karadjov
ab9969ed3b Bugfix: the size of an array may be a static tuple element 2018-06-16 16:46:32 +03:00
Zahary Karadjov
509d6e9232 Bugfix: aliases to generic types were not considered implicit generic parameters 2018-06-16 16:46:32 +03:00
Zahary Karadjov
fb27357b62 A minimal patch enabling the new typedesc and static types syntax 2018-06-16 16:46:32 +03:00
Zahary Karadjov
8633b1b309 Starting test recording the current state of the parser
In the next commit, I'll introduce changes to the parser bringing
consistent handling of all type modifiers (ref, ptr, var, static
and type). The goal of this commit is to record precisely what is
going to be changed (i.e. by allowing you to look at the diff).

To preserve the diff, please don't squash upon merging.
2018-06-16 16:46:32 +03:00
Andreas Rumpf
ee16e62061 Merge pull request #8039 from yglukhov/proc-pragmas
Fixed stacktrace/linetrace proc pragmas when appended by macro pragma
2018-06-16 01:59:06 +02:00
Yuriy Glukhov
78cbf6734a Added more tests to toverflw 2018-06-15 19:46:17 +03: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
Arne Döring
51fdb071cb fix #5930 2018-06-13 12:18:21 +02:00
Andreas Rumpf
b379547fc0 Merge pull request #8019 from yglukhov/proc-stacktrace
Allow stacktrace and linetrace pragmas on procs
2018-06-12 17:12:13 +02:00
Andreas Rumpf
aaceec0744 Merge pull request #7981 from cooldome/Fix_-7980
Fixes 7980
2018-06-12 11:50:40 +02:00
Yuriy Glukhov
7e7b85afc7 Allow stacktrace and linetrace pragmas on procs 2018-06-12 12:31:14 +03:00
Andreas Rumpf
1c58f31a71 Merge pull request #8014 from yglukhov/fix-6803
Fixes #6803
2018-06-11 23:39:27 +02:00
LemonBoy
ac0f986008 Correct field lookup in concept types
Fixes #6770
2018-06-12 00:36:43 +03:00
Yuriy Glukhov
8f06763491 Fixes #6803 2018-06-11 22:38:40 +03:00
Araq
1074cc1fb9 fixes yet another merge conflict 2018-06-11 17:17:34 +02:00
Araq
68ba13c759 fixes merge conflict 2018-06-11 17:05:23 +02:00
Andreas Rumpf
76676cb79f Merge pull request #8009 from yglukhov/remove-oldIterTransf
Removed oldIterTranf feature
2018-06-11 16:45:35 +02:00
Andreas Rumpf
df1784dabf Merge pull request #8005 from Vindaar/fixes-7997
fix #7997
2018-06-11 01:33:14 +02:00
Andreas Rumpf
61d9292095 fixes merge conflict 2018-06-11 01:25:48 +02:00
Andreas Rumpf
61e1897922 make tests green again 2018-06-11 01:23:14 +02:00
Yuriy Glukhov
5c449c8cd1 Removed oldIterTranf feature 2018-06-10 23:42:53 +03:00
Zahary Karadjov
5f2cdcd4fa fix #7653 2018-06-10 22:27:51 +03:00
Vindaar
9c5f38850d add test case for fix to #7997 2018-06-10 18:01:15 +02:00
LemonBoy
03653ab61e Fix type inference with static literals.
Fixes #3977
2018-06-10 14:25:40 +03:00
Araq
8e9551b1c7 fixex merge conflicts 2018-06-08 19:50:36 +02:00
Andreas Rumpf
e273ef4f5e Merge pull request #7992 from yglukhov/fromSockAddr-compile-error
Fixed compilation error when Sockaddr_in4 or Sockaddr_in6 passed to fromSockAddr
2018-06-08 13:38:39 +02:00
Yuriy Glukhov
b2323de914 Fixed compilation error when Sockaddr_in4 or Sockaddr_in6 passed to fromSockAddr 2018-06-07 21:10:00 +03:00
Yuriy Glukhov
60b9c9dc1f Fixes #7985 2018-06-07 19:14:14 +03:00
data-man
cc63351a5a Updated tests for CritBitTree $ 2018-06-07 18:49:59 +03:00
Yuriy Glukhov
ec1d42b9f0 Cleanup copypaste leftover 2018-06-07 15:28:41 +03:00
cooldome
e03b3bdde7 fixes 7980 2018-06-06 23:41:19 +01:00
Yuriy Glukhov
fef60716bf Fixed yield in nkBlockExpr 2018-06-07 00:15:46 +03:00
Andreas Rumpf
bf394ed1a1 Merge pull request #7550 from jangko/fix4799
fixes #4799, varargs now can accept polymorphic types
2018-06-06 22:04:54 +02:00
Yuriy Glukhov
511d7079a1 Fixed tests 2018-06-06 20:04:37 +03:00
andri lim
4262a85653 fixed wrong test 2018-06-06 22:29:31 +07:00
Yuriy Glukhov
0ec2b33c50 Fixed yield in dotExpr and nkOfBranch lowering. Closes #7969. 2018-06-06 16:35:40 +03:00
Andreas Rumpf
e957d369b1 Merge pull request #7907 from GULPF/lexer-unicode-fix
Lexer fix for multi byte characters
2018-06-06 11:42:59 +02:00
Andreas Rumpf
1593b9cac4 Merge pull request #7967 from nitely/empty_openarray_7904
support empty toOpenArray
2018-06-06 11:06:57 +02:00
nitely
7297195f9f test negative range array 2018-06-06 02:22:33 -03:00
nitely
ba39f359aa check bounds instead of index 2018-06-05 20:22:27 -03:00
Oscar Nihlgård
c69b88688f Combine some of the lexer tests into a single file 2018-06-05 21:05:13 +02:00
Andreas Rumpf
3cbc07ac78 Merge pull request #7770 from yglukhov/yield-in-try
Yield in try
2018-06-05 19:58:00 +02:00
andri lim
436c122956 combine/reduce test 2018-06-05 22:16:53 +07:00
andri lim
8063ecbb8f fix test case output 2018-06-05 16:54:01 +07: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
andri lim
80107b360c add more test to 4799 2018-06-05 09:18:20 +07: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
andri lim
069a53ad4b fixes #7906, array and openarray arg vs. ptr/ref generic (#7909)
* fixes #7906, array and openarray arg vs. ptr/ref generic

* add comment
2018-06-04 17:43:15 +02:00
Andreas Rumpf
12996c08a1 fixed merge conflict 2018-06-04 16:16:50 +02:00