the .deprecated pragma for procs now supports a user-definable deprecation message

This commit is contained in:
Andreas Rumpf 2018-02-02 12:53:38 +01:00
commit 212457f5e0
5 changed files with 27 additions and 4 deletions

View file

@ -810,7 +810,10 @@ proc singlePragma(c: PContext, sym: PSym, n: PNode, i: int,
of wExplain:
sym.flags.incl sfExplain
of wDeprecated:
if it.kind in nkPragmaCallKinds: deprecatedStmt(c, it)
if sym != nil and sym.kind in routineKinds:
if it.kind in nkPragmaCallKinds: discard getStrLitNode(c, it)
incl(sym.flags, sfDeprecated)
elif it.kind in nkPragmaCallKinds: deprecatedStmt(c, it)
elif sym != nil: incl(sym.flags, sfDeprecated)
else: incl(c.module.flags, sfDeprecated)
of wVarargs: