Commit Graph

12482 Commits

Author SHA1 Message Date
Michael Voronin
11fcc83f8a [add] Add procs for TimeInterval stringify 2018-05-31 16:02:37 +03:00
Michael Voronin
a573577cdc [add+change] Added toDurationParts proc to convert Duration to array[FixedTimeUnit, int64] of it's human-readable parts, use it in $Duration 2018-05-31 16:01:58 +03:00
Michael Voronin
08d1b5892b [doc] Standardize deprecation warnings 2018-05-10 13:18:38 +03:00
Michael Voronin
8a080acda9 [add] Add some wrappers 2018-05-10 13:18:38 +03:00
Michael Voronin
0ff0dfbfce [refactoring] Rearrange functions for better readability/usage 2018-05-10 13:18:38 +03:00
Michael Voronin
52eac6fb64 [doc] Add/modify some runnable examples for pure/times 2018-05-10 13:18:38 +03:00
Michael Voronin
b63dc4042b [fix] Little fix for runnable example in pure/times 2018-05-10 13:18:38 +03:00
Michael Voronin
1051e8d69d Merge pull request #4 from nim-lang/devel
#4
2018-05-10 13:15:33 +03:00
Mathias Stearn
9048bcc54b Add connectUnix and bindUnix to net docs
fixes #7715
2018-05-09 17:42:16 +02:00
Lolo Iccl
af591544c5 Modify hash for HashSet to use xor to mix hash of items. 2018-05-09 17:41:41 +02:00
Lolo Iccl
5c7b66e07a Modify previous commit and add tests 2018-05-09 17:41:41 +02:00
Lolo Iccl
ee8313da3f Modify previous commit
Modify previous commit to use data[h].hcode in
proc hash for HashSet and for OrderedSet.
2018-05-09 17:41:41 +02:00
Lolo Iccl
80f17f9405 Add proc hash for HashSet and for OrderedSet
close #7772
2018-05-09 17:41:41 +02:00
Ganesh Viswanathan
9bde9a1404 Add nimble dir to path via finish 2018-05-09 17:39:42 +02:00
Oscar Nihlgård
7cf87dfac6 VM fix for refs 2018-05-08 17:00:00 +02:00
Zahary Karadjov
6758fbd06e Export an 'escapeXml' proc from xmldom
The interface is similar to escapeJson
2018-05-07 09:37:49 +02:00
Zahary Karadjov
5623007126 Fix the compilation of terminal.nim on Windows 2018-05-07 09:37:49 +02:00
Zahary Karadjov
70ec344bbf bugfix: strutils.find was broken for strings with uneven number of chars
For some reason, the problem was manifesting only inside the VM, it was
detecting an attempt to read past the string end (i.e. the formerly
accessible null byte).

To catch such errors, strutils now performs static tests too.

I've solved the problem by re-implementing the Boyer-Moore algotihm
in a cleaner way and I took the opportunity to make some other
optimisations to strutils.
2018-05-07 09:37:49 +02:00
Zahary Karadjov
cf13c5fba4 implement the export/except statement 2018-05-07 09:37:49 +02:00
Zahary Karadjov
7297613900 Bugfix: The compiler were not inserting proper downcasts for generic types
This resulted in a codegen error in C++ mode, because the generic
types were not defined in modules where calls requiring downcasts
were used (generating a downcast forces the inclusion of the full
definition of the involved types).
2018-05-07 09:37:49 +02:00
Zahary Karadjov
4ab1cfb0b0 fix a compiler crash related to the new strings in C++ mode 2018-05-07 09:37:49 +02:00
Zahary Karadjov
4409c82228 The terminal module now exports additional procs for generating ANSI color
codes as strings.
2018-05-07 09:37:49 +02:00
Zahary Karadjov
ae5c946a32 Support thread-local variables declared inside procs; fixes #7565 2018-05-07 09:37:49 +02:00
Zahary Karadjov
b0d85b0adf Backwards-compatible support for keyword arguments in the command syntax 2018-05-07 09:37:49 +02:00
Zahary Karadjov
e678a4285d Bugfix: Allow matching on nkExprEqExpr against varargs[untyped]
This enables macros accepting arbitrary keyword arguments:

log("foo", prop1 = "bar", prop2 = "baz")

As an added bonus, simple templates with varargs arguments can now
forward their params to procs accepting keyword arguments.
2018-05-07 09:37:49 +02:00
Zahary Karadjov
2b8bf8fc4a A motivating example for the new bindSym behavior.
The example is a proof-of-concept logging library, allowing you to define
lexically-scoped environments where certain logging attributes are applied
automatically to all logging statements.

fixes tmacro1 (use of `bindSym` inside static blocks)
2018-05-07 09:37:49 +02:00
Zahary Karadjov
bdcb729597 Better support for treating templates and macros as symbols.
This allows you to pass a template or a macro to another macro
which can then inspect the implementation of the former template/macro
using `getImpl`.

Since templates can be freely redefined, this allows you to treat
their symbols as compile-time variables that have lexical scope.
A motivating PoC example for a logging library taking advantage of
this will be provided in the next commit.

Implementation details:

* The name of a template or a macro will be consider a symbol if
  the template/macro requires parameters

* For parameterless templates/macros, you can use `bindSym`, which
  was extended to also work outside of compile-time procs.
2018-05-07 09:37:49 +02:00
alaviss
7897026e57 pretty, prettybase: simplify relative paths (#7779)
This allows nimble to be built with compiler as a nimble package
2018-05-07 07:30:13 +02:00
Flaviu Tamas
b132965330 Allow using CC environment variable with csources (#7754) 2018-05-06 11:23:08 +02:00
Florent
d3ad467022 Fixes #7764 (#7767)
* Fixes #7764

* Change KEY_RECORD_EVENT filter

* Update terminal.nim

* Revert changes and modify readPasswordFromStdIn
2018-05-06 10:56:40 +02:00
alaviss
26d89fa09c options: use isSome (#7782)
Fixes #7780
2018-05-06 10:55:19 +02:00
Andreas Rumpf
d8dd43e500 fixes #7757 2018-05-06 10:50:04 +02:00
alaviss
97056fbb9b fixes #7774 (#7783) 2018-05-06 10:34:22 +02:00
Andreas Rumpf
700a2e125b make the tester compile without warnings 2018-05-06 09:00:55 +02:00
Andreas Rumpf
6e8d5790c8 pegs: fixes another null accessing bug 2018-05-06 09:00:41 +02:00
Andreas Rumpf
88cf6573e0 fixes #7743 2018-05-06 08:59:39 +02:00
Andreas Rumpf
cd0985df06 update the changelog 2018-05-06 08:17:32 +02:00
Andreas Rumpf
272bbad784 Merge branch 'devel' into araq-parser-fixes 2018-05-06 08:03:29 +02:00
Andreas Rumpf
d8fde9daba make tests green 2018-05-05 21:45:07 +02:00
Araq
bbb0fd4eb7 remove deprecated stuff from the stdlib; introduce better deprecation warnings 2018-05-05 21:45:07 +02:00
Andreas Rumpf
dfc17e5f8e make Nimble not crash after the refactoring 2018-05-05 21:08:45 +02:00
Andreas Rumpf
b7116a28ee compiler refactoring, pass config around explicitly 2018-05-05 18:47:29 +02:00
Andreas Rumpf
eef12654bd compiler/msgs.nim: minor code cleanup 2018-05-05 15:07:13 +02:00
Andreas Rumpf
1aa359febb warn about inconsistent spacing around binary operators; fixes #7582 2018-05-05 14:58:33 +02:00
Andreas Rumpf
805402b294 fixes #7582 2018-05-05 14:17:31 +02:00
Dominik Picheta
608017801d Fixes crash in httpclient due to new string indexing rules. 2018-05-04 22:26:16 +01:00
Arne Döring
6f4ca3f276 test binarySearch, fix for search in empty. (#7769) 2018-05-04 15:29:21 +02:00
Araq
7d78707e36 fixes #7766 2018-05-04 08:11:13 +02:00
Emery Hemingway
cda591a42f Disable setTerminate when noCppExceptions is defined (#7751) 2018-05-04 07:40:40 +02:00
Dmitry Atamanov
27631b1112 Fix filter_tmpl errors (#7763) 2018-05-04 07:39:05 +02:00