diff options
author | Arne Döring <arne.doering@gmx.net> | 2017-02-22 17:33:12 +0100 |
---|---|---|
committer | Andreas Rumpf <rumpf_a@web.de> | 2017-02-22 17:33:12 +0100 |
commit | 92c2a51bf763c16579da6b9e2ceaede5552bf5ff (patch) | |
tree | 18f20e5f69c11209d0e3b8d71df05f9ad1e1edad /compiler/semdata.nim | |
parent | 2ba374f9ab5f5ede0a4c67ab8339799108e3d720 (diff) | |
download | Nim-92c2a51bf763c16579da6b9e2ceaede5552bf5ff.tar.gz |
removed compiler internal list implementation (#5371)
Diffstat (limited to 'compiler/semdata.nim')
-rw-r--r-- | compiler/semdata.nim | 19 |
1 files changed, 9 insertions, 10 deletions
diff --git a/compiler/semdata.nim b/compiler/semdata.nim index 77a530a15..b501ec440 100644 --- a/compiler/semdata.nim +++ b/compiler/semdata.nim @@ -10,15 +10,14 @@ ## This module contains the data structures for the semantic checking phase. import - strutils, lists, intsets, options, lexer, ast, astalgo, trees, treetab, + strutils, intsets, options, lexer, ast, astalgo, trees, treetab, wordrecg, ropes, msgs, platform, os, condsyms, idents, renderer, types, extccomp, math, magicsys, nversion, nimsets, parser, times, passes, rodread, vmdef, modulegraphs type - TOptionEntry* = object of lists.TListEntry # entries to put on a - # stack for pragma parsing + TOptionEntry* = object # entries to put on a stack for pragma parsing options*: TOptions defaultCC*: TCallingConvention dynlib*: PLib @@ -79,10 +78,10 @@ type inGenericInst*: int # > 0 if we are instantiating a generic converters*: TSymSeq # sequence of converters patterns*: TSymSeq # sequence of pattern matchers - optionStack*: TLinkedList + optionStack*: seq[POptionEntry] symMapping*: TIdTable # every gensym'ed symbol needs to be mapped # to some new symbol in a generic instantiation - libs*: TLinkedList # all libs used by this module + libs*: seq[PLib] # all libs used by this module semConstExpr*: proc (c: PContext, n: PNode): PNode {.nimcall.} # for the pragmas semExpr*: proc (c: PContext, n: PNode, flags: TExprFlags = {}): PNode {.nimcall.} semTryExpr*: proc (c: PContext, n: PNode,flags: TExprFlags = {}): PNode {.nimcall.} @@ -133,7 +132,7 @@ proc getCurrOwner*(): PSym = # the documentation comment always gets # assigned to the current owner # BUGFIX: global array is needed! - result = gOwners[high(gOwners)] + result = gOwners[^1] proc pushOwner*(owner: PSym) = add(gOwners, owner) @@ -144,7 +143,7 @@ proc popOwner*() = else: internalError("popOwner") proc lastOptionEntry*(c: PContext): POptionEntry = - result = POptionEntry(c.optionStack.tail) + result = c.optionStack[^1] proc popProcCon*(c: PContext) {.inline.} = c.p = c.p.next @@ -187,9 +186,9 @@ proc newOptionEntry*(): POptionEntry = proc newContext*(graph: ModuleGraph; module: PSym; cache: IdentCache): PContext = new(result) result.ambiguousSymbols = initIntSet() - initLinkedList(result.optionStack) - initLinkedList(result.libs) - append(result.optionStack, newOptionEntry()) + result.optionStack = @[] + result.libs = @[] + result.optionStack.add(newOptionEntry()) result.module = module result.friendModules = @[module] result.converters = @[] |