summary refs log tree commit diff stats
path: root/compiler/cgen.nim
diff options
context:
space:
mode:
authorZahary Karadjov <zahary@gmail.com>2013-12-19 01:06:38 +0200
committerZahary Karadjov <zahary@gmail.com>2013-12-19 01:06:38 +0200
commit027f30610e44633b661befcca1b5dd39e9eaa283 (patch)
tree45841cac06bf79c512b050791697ce68b36b58ed /compiler/cgen.nim
parent7120491d055c04d838d9539fdf0c42003637ec2d (diff)
downloadNim-027f30610e44633b661befcca1b5dd39e9eaa283.tar.gz
static params: expr[T] is now static[T]
This introduces tyStatic and successfully bootstraps and handles
few simple test cases.  Static params within macros are no longer
treated as PNimrodNodes - they are now equivalent to constants
of the designated type.
Diffstat (limited to 'compiler/cgen.nim')
-rw-r--r--compiler/cgen.nim4
1 files changed, 2 insertions, 2 deletions
diff --git a/compiler/cgen.nim b/compiler/cgen.nim
index b0c90de76..c2bba76b9 100644
--- a/compiler/cgen.nim
+++ b/compiler/cgen.nim
@@ -194,7 +194,7 @@ when compileTimeRopeFmt:
       if i - 1 >= start:
         yield (kind: ffLit, value: substr(s, start, i-1), intValue: 0)
 
-  macro rfmt(m: BModule, fmt: expr[string], args: varargs[PRope]): expr =
+  macro rfmt(m: BModule, fmt: static[string], args: varargs[PRope]): expr =
     ## Experimental optimized rope-formatting operator
     ## The run-time code it produces will be very fast, but will it speed up
     ## the compilation of nimrod itself or will the macro execution time
@@ -209,7 +209,7 @@ when compileTimeRopeFmt:
       of ffParam:
         result.add(args[frag.intValue])
 else:
-  template rfmt(m: BModule, fmt: expr[string], args: varargs[PRope]): expr =
+  template rfmt(m: BModule, fmt: string, args: varargs[PRope]): expr =
     ropecg(m, fmt, args)
 
 proc appcg(m: BModule, c: var PRope, frmt: TFormatStr,