Skip to content

Commit 6dbec99

Browse files
committed
Speed up joinErrors and ParseError slightly.
1 parent 4afacce commit 6dbec99

File tree

1 file changed

+3
-11
lines changed

1 file changed

+3
-11
lines changed

ometa/runtime.py

Lines changed: 3 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -16,17 +16,10 @@ class ParseError(Exception):
1616
?Redo from start
1717
"""
1818

19-
@property
20-
def position(self):
21-
return self.args[0]
22-
23-
24-
@property
25-
def error(self):
26-
return self.args[1]
27-
2819
def __init__(self, input, position, message, trail=None):
2920
Exception.__init__(self, position, message)
21+
self.position = position
22+
self.error = message
3023
self.input = input
3124
self.trail = trail or []
3225

@@ -137,8 +130,7 @@ def joinErrors(errors):
137130
if pos == err.position:
138131
e, trail = err.error, (err.trail or trail)
139132
if e is not None:
140-
for item in e:
141-
results.add(item)
133+
results.update(e)
142134
else:
143135
break
144136
return ParseError(errors[0].input, pos, list(results) or None, trail)

0 commit comments

Comments
 (0)