Fixes based on @Araq's feedback.

This commit is contained in:
Dominik Picheta 2017-02-01 21:51:17 +01:00
commit 814f527175
3 changed files with 5 additions and 4 deletions

View file

@ -286,7 +286,8 @@ proc semTry(c: PContext, n: PNode): PNode =
var typeNode = a.sons[j] # e.g. `Exception`
var symbolNode: PNode = nil # e.g. `foobar`
# Handle the case where the `Exception as foobar` syntax is used.
if typeNode.kind == nkInfix:
if typeNode.kind == nkInfix and
considerQuotedIdent(typeNode[0]).s == "as":
typeNode = a.sons[j].sons[1]
symbolNode = a.sons[j].sons[2]