fix Cython compilation after cdef-locals change
authorStefan Behnel <scoder@users.berlios.de>
Tue, 3 Mar 2009 17:42:58 +0000 (18:42 +0100)
committerStefan Behnel <scoder@users.berlios.de>
Tue, 3 Mar 2009 17:42:58 +0000 (18:42 +0100)
Cython/Compiler/Scanning.pxd
Cython/Compiler/Scanning.py
Cython/Plex/Scanners.pxd
Cython/Plex/Scanners.py

index 280a3cfdd4ebb22d669a48ce765a3551ae352101..d3220387282aecc2063acd0939d6a788482da6e8 100644 (file)
@@ -25,5 +25,4 @@ cdef class PyrexScanner(Scanner):
     cpdef next(self)
     cpdef bint expect(self, what, message = *) except -2
     
-    @cython.locals(current_level=long, new_level=long)
     cpdef indentation_action(self, text)
index 3b448fca8803f7f6245478f51227de8a655d3d4c..9e019f9e458f78bfe42ac110da51f7c0024390ba 100644 (file)
@@ -367,6 +367,7 @@ class PyrexScanner(Scanner):
         self.end_string_action(text)
         self.error("Unclosed string literal")
 
+    @cython.locals(current_level=cython.long, new_level=cython.long)
     def indentation_action(self, text):
         self.begin('')
         # Indentation within brackets should be ignored.
index 97c441adacfc9074b568653e20b7e697e8219e92..375ab4cd365568f4df5558ae578f39dcf59c830e 100644 (file)
@@ -23,25 +23,12 @@ cdef class Scanner:
     cdef public input_state
 
     cdef public level
-    
-    cpdef next_char(self):
-        cdef:
-            long input_state
+
+    cpdef next_char(self)
     cpdef read(self)
     cpdef position(self)
-    
-    cpdef run_machine_inlined(self):
-        cdef:
-            long cur_pos
-            long cur_line
-            long cur_line_start
-            long input_state
-            long next_pos
-            long buf_start_pos
-            long buf_len
-            long buf_index
-            bint trace
-            long discard
+
+    cpdef run_machine_inlined(self)
     
     cpdef begin(self, state)
     cpdef produce(self, value, text = *)
index a37483aed821c4195a2789d34bd83ba64a2e9825..5f4af56d2497da59cc78bf146224b17cf27beb10 100644 (file)
@@ -159,7 +159,12 @@ class Scanner:
     while self.transition():
       pass
     return self.back_up()
-  
+
+  @cython.locals(cur_pos=cython.long, cur_line=cython.long,
+                 cur_line_start=cython.long, input_state=cython.long,
+                 next_pos=cython.long, buf_start_pos=cython.long,
+                 buf_len=cython.long, buf_index=cython.long,
+                 trace=cython.bint, discard=cython.long)
   def run_machine_inlined(self):
     """
     Inlined version of run_machine for speed.
@@ -299,7 +304,8 @@ class Scanner:
 #            return action
 #        else:
 #            return None
-  
+
+  @cython.locals(input_state=long)
   def next_char(self):
     input_state = self.input_state
     if self.trace: