diff options
author | Flaviu Tamas <tamasflaviu@gmail.com> | 2018-11-18 20:25:59 -0500 |
---|---|---|
committer | Flaviu Tamas <tamasflaviu@gmail.com> | 2018-12-11 22:15:02 +0000 |
commit | 22b3e9df27fc65ec49b8ba8ea8de492917988e3d (patch) | |
tree | 96e6a2ccb032be0945687f3927dd5eb98380f54a /lib/impure/nre | |
parent | c682671feae3ae6c90416152f84b274cb5aa4a21 (diff) | |
download | Nim-22b3e9df27fc65ec49b8ba8ea8de492917988e3d.tar.gz |
Revert 7f49364fd0 for nre
Diffstat (limited to 'lib/impure/nre')
-rw-r--r-- | lib/impure/nre/private/util.nim | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/lib/impure/nre/private/util.nim b/lib/impure/nre/private/util.nim index a3ae84007..12d2506ea 100644 --- a/lib/impure/nre/private/util.nim +++ b/lib/impure/nre/private/util.nim @@ -10,7 +10,11 @@ proc fget*[K, V](self: Table[K, V], key: K): V = const Ident = {'a'..'z', 'A'..'Z', '0'..'9', '_', '\128'..'\255'} const StartIdent = Ident - {'0'..'9'} -template checkNil(arg: string): string = arg +proc checkNil(arg: string): string = + if arg == nil: + raise newException(ValueError, "Cannot use nil capture") + else: + return arg template formatStr*(howExpr, namegetter, idgetter): untyped = let how = howExpr |