fixed dot operator recursive loop & macro suggest (#16922)
* basic stability improvements; refs nimsuggest * fixed dot operator recursive loop & macro suggest * hacky fix for run away dot operator sem check Committing this mostly to make the issue more clear. Perhaps get better feedback. * semExprWithType seems like a better place to check * fixed error messages const case expressions * Clean-up test * stopped the dot operator madness No longer get infinite recursion when seming broken code with a dot operator macro like in jsffi. Co-authored-by: Araq <rumpf_a@web.de>
This commit is contained in:
parent
b68ecc82cb
commit
260a5dacb7
8 changed files with 51 additions and 24 deletions
|
|
@ -2184,7 +2184,7 @@ const evalPass* = makePass(myOpen, myProcess, myClose)
|
|||
proc evalConstExprAux(module: PSym; idgen: IdGenerator;
|
||||
g: ModuleGraph; prc: PSym, n: PNode,
|
||||
mode: TEvalMode): PNode =
|
||||
if g.config.errorCounter > 0: return n
|
||||
#if g.config.errorCounter > 0: return n
|
||||
let n = transformExpr(g, idgen, module, n)
|
||||
setupGlobalCtx(module, g, idgen)
|
||||
var c = PCtx g.vm
|
||||
|
|
@ -2262,7 +2262,7 @@ proc errorNode(idgen: IdGenerator; owner: PSym, n: PNode): PNode =
|
|||
|
||||
proc evalMacroCall*(module: PSym; idgen: IdGenerator; g: ModuleGraph; templInstCounter: ref int;
|
||||
n, nOrig: PNode, sym: PSym): PNode =
|
||||
if g.config.errorCounter > 0: return errorNode(idgen, module, n)
|
||||
#if g.config.errorCounter > 0: return errorNode(idgen, module, n)
|
||||
|
||||
# XXX globalError() is ugly here, but I don't know a better solution for now
|
||||
inc(g.config.evalMacroCounter)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue