From ce454fb835827ccefacad2acf79a90ca25560e5a Mon Sep 17 00:00:00 2001 From: Araq Date: Wed, 31 Oct 2012 02:31:03 +0100 Subject: exception tracking barely works; but disabled --- compiler/magicsys.nim | 2 +- compiler/sempass2.nim | 57 +++++++++++++++++++++++++++++---------------------- compiler/transf.nim | 3 ++- 3 files changed, 36 insertions(+), 26 deletions(-) (limited to 'compiler') diff --git a/compiler/magicsys.nim b/compiler/magicsys.nim index 19d19b5f9..2681f93d6 100755 --- a/compiler/magicsys.nim +++ b/compiler/magicsys.nim @@ -41,7 +41,7 @@ proc getSysSym(name: string): PSym = if result == nil: rawMessage(errSystemNeeds, name) if result.kind == skStub: loadStub(result) -proc sysTypeFromName(name: string): PType = +proc sysTypeFromName*(name: string): PType = result = getSysSym(name).typ proc getSysType(kind: TTypeKind): PType = diff --git a/compiler/sempass2.nim b/compiler/sempass2.nim index 16a035839..bdc4e7028 100644 --- a/compiler/sempass2.nim +++ b/compiler/sempass2.nim @@ -8,7 +8,7 @@ # import - ast, astalgo, msgs, semdata + ast, astalgo, msgs, renderer, magicsys, types, idents, trees, wordrecg # Second semantic checking pass over the AST. Necessary because the old # way had some inherent problems. Performs: @@ -44,13 +44,14 @@ import # done: It essentially requires a built-in 'indexSplit' operation and dependent # typing. -proc sem2call(c: PContext, n: PNode): PNode = - assert n.kind in nkCallKinds - - +when false: + proc sem2call(c: PContext, n: PNode): PNode = + assert n.kind in nkCallKinds + + -proc sem2sym(c: PContext, n: PNode): PNode = - assert n.kind == nkSym + proc sem2sym(c: PContext, n: PNode): PNode = + assert n.kind == nkSym # ------------------------ exception tracking ------------------------------- @@ -96,13 +97,16 @@ proc excType(n: PNode): PType = else: n.sons[0].typ result = skipTypes(t, skipPtrs) -proc mergeEffects(a: PEffects, b: PNode) = +proc addEffect(a: PEffects, e: PNode) = + assert e.kind == nkRaiseStmt var aa = a.exc + for i in a.bottom ..