# HG changeset patch # User Windel Bouwman # Date 1368894282 -7200 # Node ID e9b27f7193e3085ec91ede2e2e23d609cf842e90 # Parent 216da5e46efc95f75de55e0b05a0b90ff4c69970 Replace clear function by function also supported in python 3.2 diff -r 216da5e46efc -r e9b27f7193e3 python/ks/parser.py --- a/python/ks/parser.py Sat May 18 17:45:26 2013 +0200 +++ b/python/ks/parser.py Sat May 18 18:24:42 2013 +0200 @@ -2,7 +2,6 @@ from .nodes import * from ...core.errors import CompilerException, Error from .builtin import * -#from . import assembler from .lexer import tokenize class KsParser: diff -r 216da5e46efc -r e9b27f7193e3 python/ks/symboltable.py --- a/python/ks/symboltable.py Sat May 18 17:45:26 2013 +0200 +++ b/python/ks/symboltable.py Sat May 18 18:24:42 2013 +0200 @@ -1,5 +1,4 @@ from .nodes import * -from ...core.errors import Error class SymbolTable: """ @@ -67,7 +66,7 @@ if self.parent: return self.parent.getSymbol(name) else: - Error('Symbol "{0}" undeclared!'.format(name)) + raise Exception('Symbol "{0}" undeclared!'.format(name)) def hasSymbol(self, name): if name in self.syms.keys(): diff -r 216da5e46efc -r e9b27f7193e3 python/ppci/errors.py --- a/python/ppci/errors.py Sat May 18 17:45:26 2013 +0200 +++ b/python/ppci/errors.py Sat May 18 18:24:42 2013 +0200 @@ -43,7 +43,7 @@ def error(self, msg, loc): self.addDiag(CompilerError(msg, loc)) def clear(self): - self.diags.clear() + del self.diags[:] def printErrors(self, src): if len(self.diags) > 0: print('{0} Errors'.format(len(self.diags))) diff -r 216da5e46efc -r e9b27f7193e3 python/testc3.py --- a/python/testc3.py Sat May 18 17:45:26 2013 +0200 +++ b/python/testc3.py Sat May 18 18:24:42 2013 +0200 @@ -84,7 +84,7 @@ builder = c3.Builder(diag) ir = builder.build(src) # optional optimize here - x86gen = x86.X86CodeGen(diag) + x86gen = x86.X86CodeGenSimple(diag) ok = len(diag.diags) == 0 if not ok: return