Mercurial > lcfOS
comparison python/c3/parser.py @ 186:46d62dadd61b
Improved testsuite
author | Windel Bouwman |
---|---|
date | Sat, 25 May 2013 14:26:25 +0200 |
parents | ee0d30533dae |
children | 003c8a976fff |
comparison
equal
deleted
inserted
replaced
185:51a6440d6398 | 186:46d62dadd61b |
---|---|
14 def parseSource(self, source): | 14 def parseSource(self, source): |
15 self.initLex(source) | 15 self.initLex(source) |
16 self.sema.reinit() | 16 self.sema.reinit() |
17 try: | 17 try: |
18 self.parsePackage() | 18 self.parsePackage() |
19 return self.sema.mod | |
19 except CompilerError as e: | 20 except CompilerError as e: |
20 self.diag.addDiag(e) | 21 self.diag.addDiag(e) |
21 return self.sema.mod | |
22 def Error(self, msg): | 22 def Error(self, msg): |
23 raise CompilerError(msg, self.token.loc) | 23 raise CompilerError(msg, self.token.loc) |
24 # Lexer helpers: | 24 # Lexer helpers: |
25 def Consume(self, typ): | 25 def Consume(self, typ): |
26 if self.Peak == typ: | 26 if self.Peak == typ: |