diff options
author | data-man <datamanrb@gmail.com> | 2018-05-19 16:19:29 +0300 |
---|---|---|
committer | data-man <datamanrb@gmail.com> | 2018-05-19 16:19:29 +0300 |
commit | 2a9843c68fc60be6bcb41771dce88df004868e42 (patch) | |
tree | af0396a389f0d35b9239827a7915139e72e6ad9b /compiler/astalgo.nim | |
parent | 606d8b2f6d0ed4c26d44d2b07b8fef39cabc0b3c (diff) | |
parent | 04ddd069a1b3315dc0e323d98fefd621d1430a4d (diff) | |
download | Nim-2a9843c68fc60be6bcb41771dce88df004868e42.tar.gz |
Merge branch 'devel' of https://github.com/nim-lang/Nim into fix_2753
Diffstat (limited to 'compiler/astalgo.nim')
-rw-r--r-- | compiler/astalgo.nim | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/compiler/astalgo.nim b/compiler/astalgo.nim index a35fa4fbb..d98a42b34 100644 --- a/compiler/astalgo.nim +++ b/compiler/astalgo.nim @@ -180,7 +180,7 @@ proc lookupInRecord(n: PNode, field: PIdent): PSym = result = lookupInRecord(n.sons[i], field) if result != nil: return of nkRecCase: - if (n.sons[0].kind != nkSym): internalError(n.info, "lookupInRecord") + if (n.sons[0].kind != nkSym): return nil result = lookupInRecord(n.sons[0], field) if result != nil: return for i in countup(1, sonsLen(n) - 1): @@ -188,10 +188,10 @@ proc lookupInRecord(n: PNode, field: PIdent): PSym = of nkOfBranch, nkElse: result = lookupInRecord(lastSon(n.sons[i]), field) if result != nil: return - else: internalError(n.info, "lookupInRecord(record case branch)") + else: return nil of nkSym: if n.sym.name.id == field.id: result = n.sym - else: internalError(n.info, "lookupInRecord()") + else: return nil proc getModule(s: PSym): PSym = result = s @@ -203,7 +203,7 @@ proc getSymFromList(list: PNode, ident: PIdent, start: int = 0): PSym = if list.sons[i].kind == nkSym: result = list.sons[i].sym if result.name.id == ident.id: return - else: internalError(list.info, "getSymFromList") + else: return nil result = nil proc hashNode(p: RootRef): Hash = |