diff options
author | Clyybber <darkmine956@gmail.com> | 2019-11-28 17:13:04 +0100 |
---|---|---|
committer | Andreas Rumpf <rumpf_a@web.de> | 2019-11-28 17:13:04 +0100 |
commit | 7e747d11c66405f08cc7c69e5afc18348663275e (patch) | |
tree | d6277a88b503ddd503d8b769bdae6c72fcf3d27b /compiler/liftlocals.nim | |
parent | b662842bd04852a751993ed506f9e38155a4e4aa (diff) | |
download | Nim-7e747d11c66405f08cc7c69e5afc18348663275e.tar.gz |
Cosmetic compiler cleanup (#12718)
* Cleanup compiler code base * Unify add calls * Unify len invocations * Unify range operators * Fix oversight * Remove {.procvar.} pragma * initCandidate -> newCandidate where reasonable * Unify safeLen calls
Diffstat (limited to 'compiler/liftlocals.nim')
-rw-r--r-- | compiler/liftlocals.nim | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/compiler/liftlocals.nim b/compiler/liftlocals.nim index eed0560ab..672dca5d9 100644 --- a/compiler/liftlocals.nim +++ b/compiler/liftlocals.nim @@ -30,10 +30,10 @@ proc lookupOrAdd(c: var Ctx; s: PSym; info: TLineInfo): PNode = let field = addUniqueField(c.objType, s, c.cache) var deref = newNodeI(nkHiddenDeref, info) deref.typ = c.objType - add(deref, newSymNode(c.partialParam, info)) + deref.add(newSymNode(c.partialParam, info)) result = newNodeI(nkDotExpr, info) - add(result, deref) - add(result, newSymNode(field)) + result.add(deref) + result.add(newSymNode(field)) result.typ = field.typ proc liftLocals(n: PNode; i: int; c: var Ctx) = @@ -44,12 +44,12 @@ proc liftLocals(n: PNode; i: int; c: var Ctx) = n[i] = lookupOrAdd(c, it.sym, it.info) of procDefs, nkTypeSection: discard else: - for i in 0 ..< it.safeLen: + for i in 0..<it.safeLen: liftLocals(it, i, c) proc lookupParam(params, dest: PNode): PSym = if dest.kind != nkIdent: return nil - for i in 1 ..< params.len: + for i in 1..<params.len: if params[i].kind == nkSym and params[i].sym.name.id == dest.ident.id: return params[i].sym |