To protect your data, the CISO officer has suggested users to enable GitLab 2FA as soon as possible.

Commit 5333a7b6 authored by Tobias Pape's avatar Tobias Pape
Browse files

RPython does not like mixin of pointers (eg, None) and ints/booleans

parent b159370a
......@@ -5,9 +5,9 @@ class ClassGenerationContext(object):
self._name = None
self._super_name = None
self._class_side = None
self._number_of_instance_fields_of_super = None
self._number_of_class_fields_of_super = None
self._class_side = False # to be overridden
self._number_of_instance_fields_of_super = -1
self._number_of_class_fields_of_super = -1
self._instance_fields = []
self._instance_methods = []
self._class_fields = []
......
......@@ -9,12 +9,12 @@ class Lexer(object):
self._line_number = 0
self._chars_read = 0 # all characters read, excluding the current line
self._infile = input_file
self._sym = None
self._symc = None
self._sym = Symbol.NONE
self._symc = '\0'
self._text = ""
self._peek_done = False
self._next_sym = None
self._next_symc = None
self._next_sym = Symbol.NONE
self._next_symc = '\0'
self._next_text = ""
self._buf = ""
self._bufp = 0
......@@ -43,7 +43,7 @@ class Lexer(object):
if self._current_char() == '\'':
self._sym = Symbol.STString
self._symc = 0
self._symc = '\0'
self._bufp += 1
self._text = self._bufchar(self._bufp)
......@@ -62,7 +62,7 @@ class Lexer(object):
if self._bufchar(self._bufp + 1) == '=':
self._bufp += 2
self._sym = Symbol.Assign
self._symc = 0
self._symc = '\0'
self._text = ":="
else:
self._bufp += 1
......@@ -96,7 +96,7 @@ class Lexer(object):
elif self._is_operator(self._current_char()):
if self._is_operator(self._bufchar(self._bufp + 1)):
self._sym = Symbol.OperatorSequence
self._symc = 0
self._symc = '\0'
self._text = ""
while self._is_operator(self._current_char()):
self._text += self._bufchar(self._bufp)
......@@ -131,10 +131,10 @@ class Lexer(object):
elif self._buf.startswith(self._PRIMITIVE, self._bufp):
self._bufp += len(self._PRIMITIVE)
self._sym = Symbol.Primitive
self._symc = 0
self._symc = '\0'
self._text = self._PRIMITIVE
elif self._current_char().isalpha():
self._symc = 0
self._symc = '\0'
self._text = ""
while self._current_char().isalnum() or self._current_char() == '_':
self._text += self._bufchar(self._bufp)
......@@ -151,7 +151,7 @@ class Lexer(object):
self._bufp += 1
elif self._current_char().isdigit():
self._sym = Symbol.Integer
self._symc = 0
self._symc = '\0'
self._text = self._bufchar(self._bufp)
self._bufp += 1
while self._current_char().isdigit():
......
......@@ -6,10 +6,10 @@ class MethodGenerationContext(object):
def __init__(self):
self._holder_genc = None
self._outer_genc = None
self._block_method = None
self._block_method = False
self._signature = None
self._arguments = []
self._primitive = None
self._primitive = False # to be changed
self._locals = []
self._literals = []
self._finished = False
......
......@@ -4,8 +4,8 @@ class Object(object):
CLASS_INDEX = 0
NUMBER_OF_OBJECT_FIELDS = 1 + CLASS_INDEX
def __init__(self, nilObject, number_of_fields = None):
num_fields = number_of_fields if number_of_fields else self._get_default_number_of_fields()
def __init__(self, nilObject, number_of_fields = -1):
num_fields = number_of_fields if number_of_fields != -1 else self._get_default_number_of_fields()
self._fields = None
self.set_number_of_fields_and_clear(num_fields, nilObject)
......
......@@ -5,7 +5,7 @@ class Symbol(Object):
def __init__(self, nilObject):
Object.__init__(self, nilObject)
self._string = None
self._number_of_signature_arguments = None
self._number_of_signature_arguments = 0 # updated later
def get_string(self):
# Get the string associated to this symbol
......
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