diff options
author | cooldome <cdome@bk.ru> | 2018-01-09 14:25:22 +0000 |
---|---|---|
committer | Andreas Rumpf <rumpf_a@web.de> | 2018-01-09 15:25:22 +0100 |
commit | 2c9e56a783e36b0f9db3f2f73d76c910f36a9ffd (patch) | |
tree | 3c0ed82169d0cb36a1f0e6c63bc4ce43718471bf /compiler/semtempl.nim | |
parent | aff787db69ed67f54d72e9caa43e556a9d0e2674 (diff) | |
download | Nim-2c9e56a783e36b0f9db3f2f73d76c910f36a9ffd.tar.gz |
Implement custom annotations (#6987)
Diffstat (limited to 'compiler/semtempl.nim')
-rw-r--r-- | compiler/semtempl.nim | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/compiler/semtempl.nim b/compiler/semtempl.nim index f90dff8f1..454dadec0 100644 --- a/compiler/semtempl.nim +++ b/compiler/semtempl.nim @@ -608,7 +608,10 @@ proc semTemplateDef(c: PContext, n: PNode): PNode = popOwner(c) s.ast = n result = n - if n.sons[bodyPos].kind == nkEmpty: + if sfCustomPragma in s.flags: + if n.sons[bodyPos].kind != nkEmpty: + localError(n.sons[bodyPos].info, errImplOfXNotAllowed, s.name.s) + elif n.sons[bodyPos].kind == nkEmpty: localError(n.info, errImplOfXexpected, s.name.s) var proto = searchForProc(c, c.currentScope, s) if proto == nil: |