diff python/c3/parser.py @ 230:88a1e0baef65

Added some tests for IR-code
author Windel Bouwman
date Sat, 13 Jul 2013 19:53:44 +0200
parents 7f18ed9b6b7e
children e621e3ba78d2
line wrap: on
line diff
--- a/python/c3/parser.py	Sat Jul 13 11:13:01 2013 +0200
+++ b/python/c3/parser.py	Sat Jul 13 19:53:44 2013 +0200
@@ -309,17 +309,17 @@
           so introduce extra keyword 'cast'
         """
         if self.Peak == 'cast':
-            self.Consume('cast')
+            loc = self.Consume('cast').loc
             self.Consume('<')
             t = self.parseTypeSpec()
             self.Consume('>')
             self.Consume('(')
             ce = self.CastExpression()
             self.Consume(')')
-            return astnodes.TypeCast(t, ce)
+            return astnodes.TypeCast(t, ce, loc)
         else:
             return self.UnaryExpression()
-        
+
     def UnaryExpression(self):
         if self.Peak in ['&', '*']:
             op = self.Consume(self.Peak)