Commit ff46f601 authored by Stefan Behnel's avatar Stefan Behnel

fix Cython compilation after cdef-locals change

parent 4f8a75c1
...@@ -25,5 +25,4 @@ cdef class PyrexScanner(Scanner): ...@@ -25,5 +25,4 @@ cdef class PyrexScanner(Scanner):
cpdef next(self) cpdef next(self)
cpdef bint expect(self, what, message = *) except -2 cpdef bint expect(self, what, message = *) except -2
@cython.locals(current_level=long, new_level=long)
cpdef indentation_action(self, text) cpdef indentation_action(self, text)
...@@ -367,6 +367,7 @@ class PyrexScanner(Scanner): ...@@ -367,6 +367,7 @@ class PyrexScanner(Scanner):
self.end_string_action(text) self.end_string_action(text)
self.error("Unclosed string literal") self.error("Unclosed string literal")
@cython.locals(current_level=cython.long, new_level=cython.long)
def indentation_action(self, text): def indentation_action(self, text):
self.begin('') self.begin('')
# Indentation within brackets should be ignored. # Indentation within brackets should be ignored.
......
...@@ -23,25 +23,12 @@ cdef class Scanner: ...@@ -23,25 +23,12 @@ cdef class Scanner:
cdef public input_state cdef public input_state
cdef public level cdef public level
cpdef next_char(self): cpdef next_char(self)
cdef:
long input_state
cpdef read(self) cpdef read(self)
cpdef position(self) cpdef position(self)
cpdef run_machine_inlined(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 begin(self, state) cpdef begin(self, state)
cpdef produce(self, value, text = *) cpdef produce(self, value, text = *)
...@@ -159,7 +159,12 @@ class Scanner: ...@@ -159,7 +159,12 @@ class Scanner:
while self.transition(): while self.transition():
pass pass
return self.back_up() 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): def run_machine_inlined(self):
""" """
Inlined version of run_machine for speed. Inlined version of run_machine for speed.
...@@ -299,7 +304,8 @@ class Scanner: ...@@ -299,7 +304,8 @@ class Scanner:
# return action # return action
# else: # else:
# return None # return None
@cython.locals(input_state=long)
def next_char(self): def next_char(self):
input_state = self.input_state input_state = self.input_state
if self.trace: if self.trace:
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment