move {.injectStmt.} to experimental; add a test (#18300)
* move {.injectStmt.} to experimental; add a test
* undocument and deprecat `.injectStmt` but keep its implementation until we have a replacement
This commit is contained in:
parent
590d457631
commit
6030e139b5
6 changed files with 53 additions and 15 deletions
|
|
@ -1183,6 +1183,7 @@ proc singlePragma(c: PContext, sym: PSym, n: PNode, i: var int,
|
|||
if sym == nil: invalidPragma(c, it)
|
||||
else: magicsys.registerNimScriptSymbol(c.graph, sym)
|
||||
of wInjectStmt:
|
||||
warningDeprecated(c.config, it.info, "'.injectStmt' pragma is deprecated")
|
||||
if it.kind notin nkPragmaCallKinds or it.len != 2:
|
||||
localError(c.config, it.info, "expression expected")
|
||||
else:
|
||||
|
|
@ -1194,10 +1195,10 @@ proc singlePragma(c: PContext, sym: PSym, n: PNode, i: var int,
|
|||
of wThis:
|
||||
if it.kind in nkPragmaCallKinds and it.len == 2:
|
||||
c.selfName = considerQuotedIdent(c, it[1])
|
||||
message(c.config, n.info, warnDeprecated, "the '.this' pragma is deprecated")
|
||||
message(c.config, n.info, warnDeprecated, "'.this' pragma is deprecated")
|
||||
elif it.kind == nkIdent or it.len == 1:
|
||||
c.selfName = getIdent(c.cache, "self")
|
||||
message(c.config, n.info, warnDeprecated, "the '.this' pragma is deprecated")
|
||||
message(c.config, n.info, warnDeprecated, "'.this' pragma is deprecated")
|
||||
else:
|
||||
localError(c.config, it.info, "'this' pragma is allowed to have zero or one arguments")
|
||||
of wNoRewrite:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue