Commit Graph

80 Commits

Author SHA1 Message Date
Araq
e6019b6f98 fixes #103 2012-05-11 00:22:04 +02:00
Araq
63326f19f0 fixes #111; however may introduce other problems 2012-05-10 08:21:06 +02:00
Araq
a41bf611a0 fixes binding of overloaded procs 2012-05-04 01:58:54 +02:00
Zahary Karadjov
e941a14767 completing the "types as first class values" reform 2012-04-06 18:14:12 +03:00
Zahary Karadjov
efb53233cb the foundations of a type traits module; better error messages for expr, typedesc and typeclasses params 2012-04-06 13:46:31 +03:00
Zahary Karadjov
98b7bdaa50 when expressions, proper rendering for nkDo and nkLambda and parser support for x.type and x.addr 2012-04-05 22:43:37 +03:00
Zahary Karadjov
6d80583d5a Added `global` pragma that can be used to introduce new global variables from within procs 2012-04-05 20:43:22 +03:00
Zahary Karadjov
22dc76a361 typedesc and expr params
types are now valid proc/template/macro params and you can overload over them:
proc foo(T: typedesc)        # accept any type
proc foo(T: typedesc{int}) # overload specifically for int
proc foo(T: typedesc{int or float or Callable}) # overload for any type matching the constraints

expr{type} is a param expecting compile time value of the designated type (or type class).

when typedesc or expr params are used with a proc, the proc will be instantiated once
for each unique type/value used as parameter.
2012-03-31 18:50:48 +03:00
Zahary Karadjov
6216046bc6 genSym support for hygienic macros and templates.
example:
template hygienic(val: expr) =
  var `*x` = val
  echo `*x`

*x was chosen as mnemonic for "opposite of public" and thus private
2012-03-26 04:36:26 +03:00
Zahary Karadjov
a72fe16f9d making tests green again 2012-03-20 14:44:23 +02:00
Zahary Karadjov
e43f8d842b merged branch overloading-for-macros 2012-03-19 12:06:38 +02:00
Zahary Karadjov
72f2a6e275 the test suite is mostly green again 2012-03-16 05:33:21 +02:00
Zahary Karadjov
6975ba401b fix for template redefinition. test cases added. 2012-03-15 14:15:37 +02:00
Araq
4da067691e implemented 'static'; macros do not work anymore 2012-03-15 00:28:28 +01:00
Zahary Karadjov
e5bd3b5b97 bootstraps fine with overloadable templates 2012-03-14 21:00:42 +02:00
Araq
c25ffbf262 first steps for cleaner static/const distinction 2012-03-13 02:01:56 +01:00
Araq
e88123fb17 fixes #100 2012-03-10 12:43:04 +01:00
Araq
4a9e07a47c ERecoverableError exception contains the error message 2012-02-25 12:57:16 +01:00
Zahary Karadjov
560a3bad28 `do' keyword in the grammar for lambda blocks 2012-02-10 14:50:35 +02:00
Araq
2c4a1dbc0c further steps for closure support 2012-02-08 09:10:59 +01:00
Araq
632aece191 further steps to closure support 2012-02-06 00:19:56 +01:00
Araq
e362cbbfd7 bugfix: tests/reject/tnoinst.nim is now rejected properly 2012-01-13 13:40:05 +01:00
Araq
e7e3c451ef removed '^ deprecated' message 2012-01-10 00:33:32 +01:00
Araq
2ae78c0cfb implicit invokation of items/pairs iterators 2012-01-08 01:29:10 +01:00
Araq
4f1b89c30c year 2012 for most copyright headers 2012-01-02 23:07:35 +01:00
Araq
af792da0bb codegen uses alias analysis to generate better code 2011-12-10 01:06:32 +01:00
Araq
2962ca7890 alias analysis as required for the code gen and the HLO 2011-12-08 23:21:08 +01:00
Araq
70cf34cbdc 'assert' is now implemented without compiler magic 2011-12-04 20:14:50 +01:00
Araq
7fcbdc6d42 implemented 'let' statement 2011-11-29 17:27:48 +01:00
Araq
72651de710 bugfix: 'when' sections in generic objects now work, so TThread[void] compiles 2011-11-20 16:13:03 +01:00
Zahary Karadjov
12bac28d23 macros and templates can be expanded anywhere where a type is expected.
This allows for various type selection algorithms to be implemented.
See tests / accept / compile / ttypeselectors.nim for examples.
2011-11-18 02:11:15 +02:00
Araq
bec06a0649 bugfix: s[1..n] = @[] produced wrong C code 2011-11-14 08:33:44 +01:00
Araq
77222b2aad fixes #59 2011-11-02 02:36:01 +01:00
Araq
351e89e705 better code generation for constant aggregates 2011-11-02 00:55:29 +01:00
Araq
78f37b2336 compilation cache: slurped files are a dependency too 2011-10-30 01:02:15 +02:00
Araq
90db9171a2 compilation cache: various bugfixes; works for the compiler itself 2011-10-27 00:41:42 +02:00
Araq
9fb36bd20c compilation cache: mostly working; generics not yet 2011-10-25 15:26:36 +02:00
Araq
51e01879ba 'bind' as a declarative statement 2011-10-10 02:04:15 +02:00
Araq
c138cc36b4 new syntactic construct: a{i} 2011-10-08 02:14:42 +02:00
Araq
e956abbadd slurp uses path; unidecode is improved and threadsafe 2011-10-08 01:17:06 +02:00
Zahary Karadjov
e3deb5b502 Cleaned up the circular dependecies and remaining issues
Changed: The []= operator for strings and sequences is now capable of splicing
2011-10-07 17:10:04 +03:00
Zahary Karadjov
eaeed1f846 getAst works correctly with existing AST values as template/macro arguments 2011-10-07 17:05:54 +03:00
Araq
42516c0086 code generator supports constant sequences; more consistent compile time evaluation 2011-10-07 09:02:08 +02:00
Araq
da6046dcba bugfix: overloading resolution for typeof 2011-09-27 00:27:51 +02:00
Araq
485c371942 renamed optional to discardable 2011-09-24 19:18:08 +02:00
Araq
72ceda98cb implemented optional pragma for implicit discard 2011-09-24 13:55:24 +02:00
Araq
033e3dfc50 l-values are preserved modulo type distinction 2011-09-24 13:15:11 +02:00
Araq
6023e994fb beginning of a taint mode; type system enhancements 2011-09-24 00:46:41 +02:00
Araq
2359b8b107 fixed some newly introduced bugs 2011-09-21 00:54:13 +02:00
Zahary Karadjov
9acfc43119 using statement (ala C#) implemented as macro (added as test).
simplified the usage of the interpolatedFragments iterator.
2011-09-20 14:13:45 +03:00