summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--prolog/util.py8
1 files changed, 4 insertions, 4 deletions
diff --git a/prolog/util.py b/prolog/util.py
index f5d1865..4826f86 100644
--- a/prolog/util.py
+++ b/prolog/util.py
@@ -41,14 +41,14 @@ def decompose(code):
for t in tokens:
if t[0] == 'SEMI':
if line != []:
- lines.append(line[:])
+ lines.append(tuple(line))
line = []
- lines.append([t])
+ lines.append((t,))
continue
if not parens:
if t[0] in ('PERIOD', 'FROM', 'COMMA', 'EOF'):
if line != []:
- lines.append(line[:])
+ lines.append(tuple(line))
line = []
if t[0] in ('PERIOD', 'EOF') and rule_start < len(lines):
rules.append((rule_start, len(lines)))
@@ -64,7 +64,7 @@ def decompose(code):
elif t[0] == 'RBRACE' and parens[-1] == 'LBRACE':
parens.pop()
line.append(t)
- return lines, rules
+ return tuple(lines), tuple(rules)
# pretty-print a list of rules
def compose(lines, rules):