Skip to content

Commit

Permalink
class parser fix
Browse files Browse the repository at this point in the history
before the parser had problems with declarations across multiple lines.
  • Loading branch information
Zinggi committed Oct 30, 2013
1 parent d9eae72 commit 9957823
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions UnrealScriptIDEParser.py
Original file line number Diff line number Diff line change
Expand Up @@ -75,9 75,9 @@ def save_classes(self):
with open(self.filename, 'rU') as file_lines:
for line in file_lines:
description = line
classline = re.match(r'(class\b. \bextends )(\b. \b)', line.lower()) # get class declaration line of current file
classline = re.search(r'(class\s . [\n]?\s*extends\s )(\w )', description, re.MULTILINE) # get class declaration line of current file //line.lower() '(class\b. \bextends )(\b. \b)'
if classline is not None:
parent_class_name = classline.group(2) # get parent class
parent_class_name = classline.group(2).lower() # get parent class
self.collector.add_class(os.path.basename(self.filename).split('.')[0],
parent_class_name,
description,
Expand Down Expand Up @@ -150,9 150,9 @@ def update_class(self, my_class=None):
with open(self.filename, 'rU') as file_lines:
for line in file_lines:
description = line
classline = re.match(r'(class\b. \bextends )(\b. \b)', line.lower()) # get class declaration line of current file
classline = re.search(r'(class\s . [\n]?\s*extends\s )(\w )', description, re.MULTILINE) # get class declaration line of current file
if classline is not None:
parent_class_name = classline.group(2) # get parent class
parent_class_name = classline.group(2).lower() # get parent class
if my_class:
if my_class.parent_class() != parent_class_name or my_class.description() != description:
my_class.update_class(parent_class_name, description)
Expand Down

0 comments on commit 9957823

Please sign in to comment.