Commit cb5166ac authored by Robert Bradshaw's avatar Robert Bradshaw

Minor fixes, all tests pass

I don't know how long_literal used to work, must have ran tests before
that refactor...
parent 459f11b4
...@@ -401,7 +401,7 @@ class Scope: ...@@ -401,7 +401,7 @@ class Scope:
if entry and not entry.type.is_cfunction: if entry and not entry.type.is_cfunction:
# This is legal Python, but for now will produce invalid C. # This is legal Python, but for now will produce invalid C.
error(pos, "'%s' already declared" % name) error(pos, "'%s' already declared" % name)
entry = self.declare_var(name, py_object_type, pos) entry = self.declare_var(name, py_object_type, pos, visibility='extern')
entry.signature = pyfunction_signature entry.signature = pyfunction_signature
self.pyfunc_entries.append(entry) self.pyfunc_entries.append(entry)
return entry return entry
......
...@@ -121,7 +121,9 @@ def long_literal(value): ...@@ -121,7 +121,9 @@ def long_literal(value):
if len(value) < 2: if len(value) < 2:
value = int(value) value = int(value)
elif value[0] == 0: elif value[0] == 0:
return int(value, 8) value = int(value, 8)
elif value[1] in 'xX': elif value[1] in 'xX':
return int(value[2:], 16) value = int(value[2:], 16)
else:
value = int(value)
return not -2**31 <= value < 2**31 return not -2**31 <= value < 2**31
...@@ -4,4 +4,4 @@ cdef class Sub2(Crunchy): ...@@ -4,4 +4,4 @@ cdef class Sub2(Crunchy):
cdef char character cdef char character
cdef class Sub1(Sub2): cdef class Sub1(Sub2):
cdef char character pass
...@@ -29,4 +29,4 @@ cdef class Sub2(list): ...@@ -29,4 +29,4 @@ cdef class Sub2(list):
cdef char character cdef char character
cdef class Sub1(Sub2): cdef class Sub1(Sub2):
cdef char character pass
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