Empty replacements for patterns now work.
This commit is contained in:
parent
1655160113
commit
107f295d7e
4
modal.py
4
modal.py
|
@ -125,8 +125,6 @@ def apply(queue, rules, pattern, replacement):
|
|||
if not pattern:
|
||||
return (False, roll(queue))
|
||||
replacement = construct(replacement, context)
|
||||
if not replacement:
|
||||
return (False, roll(queue))
|
||||
return (True, enqueue(dequeue(queue, len(pattern)), replacement))
|
||||
|
||||
def define(queue, rules, pattern):
|
||||
|
@ -305,7 +303,7 @@ def run(rules, queue, limit=pow(2, 32)):
|
|||
result, queue = operation(queue, rules, pattern, *parameters)
|
||||
if result == True:
|
||||
failures = 0
|
||||
print("<>: ", inspect(seek(queue, ["SRT"])))
|
||||
#print("<>: ", inspect(seek(queue, ["SRT"])))
|
||||
#print("<>: ", inspect(queue))
|
||||
#input()
|
||||
steps = steps + 1
|
||||
|
|
Loading…
Reference in New Issue