added nkError to the AST (#17567)

* added nkError to the AST

* Update lib/core/macros.nim

Co-authored-by: konsumlamm <44230978+konsumlamm@users.noreply.github.com>

* Update compiler/ast.nim

Co-authored-by: konsumlamm <44230978+konsumlamm@users.noreply.github.com>

Co-authored-by: konsumlamm <44230978+konsumlamm@users.noreply.github.com>
This commit is contained in:
Andreas Rumpf 2021-03-29 16:23:19 +02:00 • committed by GitHub
commit cfff27529e
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
6 changed files with 90 additions and 3 deletions

View file

@ -1645,6 +1645,10 @@ proc gsub(g: var TSrcGen, n: PNode, c: TContext) =
gsons(g, n, c, 0)
of nkTypeClassTy:
gTypeClassTy(g, n)
of nkError:
putWithSpace(g, tkSymbol, "error")
#gcomma(g, n, c)
gsub(g, n[0], c)
else:
#nkNone, nkExplicitTypeListCall:
internalError(g.config, n.info, "rnimsyn.gsub(" & $n.kind & ')')