Commit Graph

12827 Commits

Author SHA1 Message Date
Andreas Rumpf
0c683d28bb Merge branch 'devel' of github.com:nim-lang/Nim into devel 2018-06-22 03:19:36 +02:00
Andreas Rumpf
cc11aa9698 varints module: critical bugfix 2018-06-22 03:19:30 +02:00
Andreas Rumpf
6015749720 Merge pull request #8062 from LemonBoy/fix-7825
Fix constant folding for shl/not
2018-06-21 00:35:17 +02:00
Araq
1be82d96a6 nimpretty: bugfixes; refs #8078 2018-06-20 11:35:36 +02:00
Araq
9adfaa7f07 fixes #8076 2018-06-20 10:20:42 +02:00
Andreas Rumpf
2dab490ec1 Merge branch 'araq-nimpretty' into devel 2018-06-20 01:03:41 +02:00
Andreas Rumpf
2a662250d4 nimpretty: added more code claimed to not be working 2018-06-20 00:59:01 +02:00
Andreas Rumpf
0725003a8c nimpretty: fixes more reported issues 2018-06-20 00:56:29 +02:00
Andreas Rumpf
26568dff00 nimpretty: also test on Windows/Appveyor 2018-06-19 23:48:27 +02:00
Andreas Rumpf
c3090fcb48 nimpretty: don't produce trailing whitespace; fixes the rendering of unary operators 2018-06-19 23:45:11 +02:00
LemonBoy
fb62dd1fae Fix constant folding for shl/not
Since the source and destination types are the same the result should be
trimmed to fit.
2018-06-19 22:32:15 +02:00
Andreas Rumpf
837d0c7270 nimpretty: proper command line handling; added tests; travis ensures these stay green 2018-06-19 20:06:04 +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
Andreas Rumpf
3ca11def6d Merge pull request #7771 from nim-lang/nim-in-action-fixes
Higher Nim in Action coverage plus regression fix.
2018-06-19 17:52:05 +02:00
Dominik Picheta
0da87939d1 Merge pull request #8047 from kaushalmodi/add-styledWrite
Add styledWrite macro
2018-06-19 12:13:12 +01:00
Andreas Rumpf
0c33244c23 Merge branch 'devel' of github.com:nim-lang/Nim into devel 2018-06-19 12:43:21 +02:00
Andreas Rumpf
dd81d9d5b7 nimpretty improvements 2018-06-19 09:42:33 +02:00
Kaushal Modi
abbf9ba9f7 Convert styledWriteLine and styledEcho to templates
This also fixes a bug in the styledWriteLine behavior where the background color
leaked onto the next newline if that command did not end with resetStyle.

Now it is not necessary to end styledWriteLine calls that set BackgroundColor to
end in resetStyle.
2018-06-18 09:09:23 -04:00
Kaushal Modi
3b5b3deecd Add styledWrite macro
Also:

- Move the tests block to the end of the file
- Fix the older tests
- Add tests for existing styledEcho
- Add new tests for styledWrite

Fixes https://github.com/nim-lang/Nim/issues/8046.
2018-06-18 09:09:23 -04:00
mboratko
70664bd1a2 Changed tutorial documentation referring to 'constant' to 'immutable' (#8056)
* Changed tutorial documentation referring to 'constant' to 'immutable'

* Clarification regarding side-effect free procedures fo:r multiple assignments
2018-06-18 02:05:35 -04:00
Dominik Picheta
03b073d541 Workaround VM bug in strutils 2018-06-17 23:26:18 +01:00
Kaushal Modi
4616b28c7b Add support for italic and strikethrough ANSI escape codes (#8048)
\e[3m -> italic
    \e[9m -> strikethrough

On terminals not supporting italic text, the text is shown in reverse instead,
and on terminals not supporting strikethrough text, the text is shown as is.
2018-06-17 12:37:41 -04:00
Andreas Rumpf
98f3daea65 nimpretty: don't touch dense binary operators 2018-06-17 14:25:23 +02:00
Andreas Rumpf
dbcdc4331a testament: minor code formating change 2018-06-17 14:16:01 +02:00
Andreas Rumpf
c70706f4bd nimpretty: fixes pragma rendering 2018-06-17 14:15:42 +02:00
Dominik Picheta
9e86237855 Adds smaller code samples from Chapters 1-3 to the tester. 2018-06-17 00:12:51 +01:00
Dominik Picheta
8081a9b3d0 Exports unicode.toUpper/toLower in strutils module. 2018-06-17 00:12:51 +01:00
Andreas Rumpf
798a8bd45c Merge branch 'devel' of github.com:nim-lang/Nim into devel 2018-06-16 19:02:54 +02:00
Andreas Rumpf
dba26656f6 nimpretty: stuff that doesn't work 2018-06-16 19:02:47 +02:00
Andreas Rumpf
7819e63f77 nimpretty: more features 2018-06-16 09:53:36 +02: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
Andreas Rumpf
97398edc05 nimpretty: render and/or/notin/in properly 2018-06-16 01:58:52 +02:00
Andreas Rumpf
a1bd4a6cbd nimpretty: first version that seems useful for others to test it 2018-06-16 01:46:39 +02:00
Yuriy Glukhov
78cbf6734a Added more tests to toverflw 2018-06-15 19:46:17 +03:00
Yuriy Glukhov
951157a4e9 Fixed proto options 2018-06-15 12:54:59 +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
Andreas Rumpf
f1d5e9090e Merge pull request #8021 from yglukhov/seq-lit
Added NIM_STRLIT_FLAG to seq literals
2018-06-14 17:38:12 +02:00
Araq
21a17f3911 document the 'pkg' and 'std' pseudo directories; closes #7250 2018-06-14 16:40:06 +02:00
Araq
1578d222e2 implements pkg/ prefix to enforce searching for the module ignore the stdlib paths; refs #7250 2018-06-14 16:12:02 +02:00
Araq
894f21eb73 RST hotfix: don't crash in rstnodeToRefname 2018-06-14 15:01:30 +02:00
Yuriy Glukhov
466af35d4d Fixed stacktrace/linetrace proc pragmas when appended by macro pragma 2018-06-14 15:48:51 +03:00
Andreas Rumpf
2d186f18ec Merge pull request #7950 from Paalon/math-log
Add log for base b of x
2018-06-14 14:02:57 +02:00
Andreas Rumpf
80a1da951d Merge pull request #8033 from FedericoCeratto/patch-9
Add hint on JSON serialization
2018-06-14 12:03:41 +02:00
Koki Fushimi
5332da2e7c Fix a test 2018-06-14 13:37:37 +09:00
Koki Fushimi
5fc5e37194 Use one same type for two parameters 2018-06-14 13:17:17 +09:00
Federico Ceratto
127556ad63 Update marshal.nim 2018-06-13 23:22:07 +01:00
Federico Ceratto
d1e03c20d2 Add hint on JSON serialization 2018-06-13 23:11:29 +01:00
Andreas Rumpf
89dd1e3592 Merge pull request #8030 from c-blake/devel
hotfix 3221ac0943 broke gc:regions/aka …
2018-06-13 20:01:47 +02: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
Charles Blake
ed4f1f4c43 hotfix 3221ac0943 broke gc:regions/aka gc:stack by
underallocating for sequences of any type larger than 1 byte.  This does the
necessary multiply to restore basic functionality.
2018-06-13 10:36:47 -04:00