From 107f295d7ef89493c920ce443eccd13b72cb6aac Mon Sep 17 00:00:00 2001 From: Devine Lu Linvega Date: Tue, 2 Apr 2024 21:28:09 -0700 Subject: [PATCH] Empty replacements for patterns now work. --- modal.py | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/modal.py b/modal.py index 7762ef2..9e8dfd7 100644 --- a/modal.py +++ b/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