Commit Graph

30 Commits

Author SHA1 Message Date
Zahary Karadjov
8f4b374327 Fix #4020; Better handling of templates within concepts 2017-06-20 11:29:42 +02:00
Zahary Karadjov
a3f19c87fb lift parameter-less do block to lambdas 2017-04-10 23:58:05 +03:00
Zahary Karadjov
987b522071 fix the do notation when used with procs 2017-04-09 22:59:24 +03:00
zah
1be0022e7c Fixes #5167 and related problems (#5475)
This commit returns to a bit less strict checking of the number
of macro arguments, because some old immediate macros rely on a
behavior where even the arity of the macro is not being checked.

It may be better if such macros are just declared to use varargs[expr],
but this remains for another day.
2017-03-12 09:33:49 +01:00
Andreas Rumpf
4ec39b6a8f macros are now checked to not produce cyclic ASTs 2017-02-08 11:33:42 +01:00
Araq
3e5e18bc5d make tests green again 2016-12-18 23:20:22 +01:00
Araq
91935fd915 fixes #4308, fixes #4905 2016-12-18 20:21:50 +01:00
Andreas Rumpf
1d44fee399 hotfix: don't crash for wrong template calls 2016-06-03 23:07:07 +02:00
Andreas Rumpf
51c62a211b remove funny debug output 2016-05-27 21:25:13 +02:00
Andreas Rumpf
6d76df8454 fixes #4227 2016-05-27 19:18:08 +02:00
Andreas Rumpf
2e62090ec3 Merge pull request #3500 from nanoant/patch/fix-3498-generic-args-in-tmpl
fixes #3498
2016-01-14 15:03:53 +01:00
Araq
ae60f4ae76 better nimsuggest support 2015-11-03 14:52:37 +01:00
Adam Strzelecki
f838c1baa4 fixes #3498
Previously it was not possible to use template arguments in template body as
the symbols were not resolved correctly leading to Error: undeclared
identifier: 'XX', eg.:

   template defaultOf[T](t: T): expr = (var d: T; d)
   echo defaultOf(1) #<- invalid identifier, but should output 0
2015-10-30 12:05:02 +01:00
Araq
2210060965 fixes #3359 2015-09-23 22:47:24 +02:00
Adam Strzelecki
d681812465 compiler: Trim .nim files trailing whitespace
via OSX: find . -name '*.nim' -exec sed -i '' -E 's/[[:space:]]+$//' {} +
2015-09-04 23:03:22 +02:00
Zahary Karadjov
fe124ceadc Disable the new generic params handling for immediate template and macros
Since immediate templates are not subjected to the standard sigmatching
algorithm, they will have a number of deficiencies when it comes to generic
params: Type dependencies between the parameters won't be honoured
and the bound generic symbols won't be resolvable within their bodies.
We could try to fix this, but it may be wiser to just deprecate immediate
templates and macros now that we have working untyped parameters.

Disabling the new features is admittedly not the greatest way to handle
this situations as it introduces inconsistency in the language, but at least
it makes the code backwards-compatible with the previous version of the
compiler instead of triggering more serious problems.
2015-08-02 23:58:22 +03:00
Zahary Karadjov
02f97489b7 fix #1858 again; restores the support for static macro params 2015-08-02 23:58:22 +03:00
Araq
0df8fa1ddd fixes #3044 2015-07-02 21:42:10 +02:00
Araq
d58212ccc5 fixes #1940; code breakage! stricter template evaluation 2015-03-07 15:43:36 +01:00
Araq
fe30ec83e2 nimsuggest improvements 2015-01-30 03:04:45 +01:00
Araq
b9079b8713 fixes #1915 2015-01-12 02:00:37 +01:00
Dustin Lacewell
0619383f46 Revert 5e4ae8d 2015-01-07 14:07:06 -08:00
Zahary Karadjov
5e4ae8dbb4 fix #1858; Add support for generic templates and macros
Implementation notes:
Just after overload resolution, the resolved generic params will be added to the
call expression to be later processed in evalTemplate and evalMacroCall. These
procs have been modified to handle the increased number of parameters, but one
remaining issue is that immediate templates and macros don't go through the same
process. The next commit will outlaw the use of generic parameters with such macros.
2015-01-05 03:53:31 +02:00
Araq
2781fea9e2 Nimrod renamed to Nim 2014-08-28 09:38:14 +02:00
Araq
438703f59e case consistency: next steps 2013-12-29 01:13:51 +01:00
Araq
92b8fac94a case consistency part 4 2013-12-27 23:10:36 +01:00
Araq
5659a1662e attempt to improve line information for '!=' etc. templates 2013-10-15 07:57:32 +02:00
Araq
6fd4b8350d bugfix: evalTemplateArgs 2012-10-14 12:02:57 +02:00
Araq
af7c92c003 term rewriting macros fully implemented; still buggy 2012-09-03 00:55:44 +02:00
Araq
5e15dec175 first steps to make templates hygienic 2012-08-20 01:13:13 +02:00