diff options
author | Zahary Karadjov <zahary@gmail.com> | 2013-05-12 14:41:32 +0300 |
---|---|---|
committer | Zahary Karadjov <zahary@gmail.com> | 2013-05-12 14:41:32 +0300 |
commit | 14b5d5f2622b8ed4625fc7c010be2b627381693d (patch) | |
tree | 39fd87964ddb19a4e83784df2ea23b730f223e08 /compiler/semdata.nim | |
parent | f317807a895e020b9398c2d7f0b6253dc3abbea9 (diff) | |
parent | f44a4362bbb74255b8781951c6b1286100176ef3 (diff) | |
download | Nim-14b5d5f2622b8ed4625fc7c010be2b627381693d.tar.gz |
merged the persistent scopes work with the delayed proc compilation strategy
Diffstat (limited to 'compiler/semdata.nim')
-rw-r--r-- | compiler/semdata.nim | 12 |
1 files changed, 4 insertions, 8 deletions
diff --git a/compiler/semdata.nim b/compiler/semdata.nim index 41979fd1c..4c94d0812 100644 --- a/compiler/semdata.nim +++ b/compiler/semdata.nim @@ -44,13 +44,6 @@ type efLValue, efWantIterator, efInTypeof, efWantStmt, efDetermineType, efAllowDestructor TExprFlags* = set[TExprFlag] - - TScope* = object - depthLevel*: int - symbols*: TStrTable - parent*: PScope - - PScope* = ref TScope PContext* = ref TContext TContext* = object of TPassContext # a context represents a module @@ -58,7 +51,6 @@ type currentScope*: PScope # current scope importTable*: PScope # scope for all imported symbols topLevelScope*: PScope # scope for all top-level symbols - scopeDepth*: int # number of open scopes p*: PProcCon # procedure context friendModule*: PSym # current friend module; may access private data; # this is used so that generic instantiations @@ -112,6 +104,10 @@ proc makeVarType*(c: PContext, baseType: PType): PType proc newTypeS*(kind: TTypeKind, c: PContext): PType proc fillTypeS*(dest: PType, kind: TTypeKind, c: PContext) +proc scopeDepth*(c: PContext): int {.inline.} = + result = if c.currentScope != nil: c.currentScope.depthLevel + else: 0 + # owner handling: proc getCurrOwner*(): PSym proc PushOwner*(owner: PSym) |