Commit Graph

4183 Commits

Author SHA1 Message Date
Oscar Nihlgård
7cf87dfac6 VM fix for refs 2018-05-08 17:00:00 +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
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
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
88cf6573e0 fixes #7743 2018-05-06 08:59:39 +02:00
Andreas Rumpf
272bbad784 Merge branch 'devel' into araq-parser-fixes 2018-05-06 08:03:29 +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
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
Dominik Picheta
5564289b57 Merge pull request #7714 from data-man/show_compile_timestamps
Compiler: show compile timestamps
2018-05-03 14:12:24 +01:00
Andreas Rumpf
48aee47bf6 compiler: code cleanup 2018-05-02 13:34:54 +02:00
Andreas Rumpf
5ac94d26b3 remove the deprecated 'nil' statement 2018-05-02 13:34:54 +02:00
Andreas Rumpf
599b5d6dcb make 'not nil' experimental 2018-05-02 13:34:53 +02:00
Oscar Nihlgård
cc0ca43743 Don't hide overflow/underflow/divbyzero in semfold (#7732)
* firstOrd/lastOrd bugfix
* Don't hide overflow/underflow/divbyzero in semfold
2018-05-02 08:54:09 +02:00
Araq
f89218c8b0 fixes #7730, fixes #7746 2018-05-02 08:27:19 +02:00
Dmitry Atamanov
82275e3779 Fix renderer's errors (#7742)
* Fix renderer's errors

* Same for filter_tmpl

* var -> let
2018-05-01 19:45:38 +02:00
Araq
851d2a266d introduce --laxStrings:on switch 2018-04-30 19:57:52 +02:00
Araq
1a3b35603c Merge branch 'araq-strings-v1' into devel 2018-04-30 19:51:26 +02:00
Araq
85af8fb74c introduce --laxstrings switch for backwards compatibility 2018-04-30 19:50:36 +02:00
Andreas Rumpf
6dbfdecd74 make msgs.nim more robust 2018-04-30 12:07:12 +02:00
Andreas Rumpf
50e1a489c0 commands.nim: use let instead of var 2018-04-30 12:06:59 +02:00
Andreas Rumpf
4948cf3b4c make the build more robust 2018-04-30 11:54:26 +02:00
Andreas Rumpf
7e0540ed80 the compiler does not rely on the zero terminator anymore 2018-04-29 01:09:05 +02:00
Andreas Rumpf
e3e18b277c renderer.nim: bugfix 2018-04-29 01:03:24 +02:00
Andreas Rumpf
9b8603adcd strutils: code cleanups and do not rely on the terminating binary zero anymore 2018-04-28 21:59:43 +02:00
Andreas Rumpf
9d77f61038 sigmatch: speed it up 2018-04-28 18:48:18 +02:00
Andreas Rumpf
6408646b02 minor speedup: concept tests still green 2018-04-28 18:37:45 +02:00
Andreas Rumpf
4adc31ee3d stuff that is green 2018-04-28 18:23:54 +02:00
Andreas Rumpf
f64f9e50cc correct comparisons for nil strings/seqs 2018-04-28 15:13:44 +02:00
data-man
e53dc66a18 Compiler: show compile timestamps 2018-04-28 14:47:15 +03:00
Andreas Rumpf
13a380bca6 make tests green 2018-04-28 13:10:45 +02:00
Andreas Rumpf
aded62520b string to cstring conversions produce the empty C string for nil; this will be consistent with alternative string implementations 2018-04-28 11:12:23 +02:00
Andreas Rumpf
e3379770b2 codegen: support nil strings/seqs in more places 2018-04-28 09:56:10 +02:00
Andreas Rumpf
ee7515e376 fixes #7663 2018-04-28 09:26:15 +02:00
Andreas Rumpf
f697596faf semcheck: code cleanups 2018-04-28 07:49:36 +02:00
Andreas Rumpf
f755808350 remove standalone 'except' and 'finally' statements that have been deprecated for years 2018-04-28 00:00:28 +02:00
andri lim
07d6ff4be4 fixes #7601, array construction of ptr generics (#7671)
* fixes #7601, array construction of ptr generics

* add more test
2018-04-27 21:38:15 +02:00
Varriount
822d2b5085 Fix the return value of GetType and friends when given a var T type. (#7701) 2018-04-27 21:35:41 +02:00