From 027f30610e44633b661befcca1b5dd39e9eaa283 Mon Sep 17 00:00:00 2001 From: Zahary Karadjov Date: Thu, 19 Dec 2013 01:06:38 +0200 Subject: 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. --- compiler/cgen.nim | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'compiler/cgen.nim') 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, -- cgit 1.4.1-2-gfad0