summaryrefslogtreecommitdiff
path: root/module/tex/context/third/simpleslides/automata
diff options
context:
space:
mode:
Diffstat (limited to 'module/tex/context/third/simpleslides/automata')
-rw-r--r--module/tex/context/third/simpleslides/automata/automata-eca.lua12
1 files changed, 8 insertions, 4 deletions
diff --git a/module/tex/context/third/simpleslides/automata/automata-eca.lua b/module/tex/context/third/simpleslides/automata/automata-eca.lua
index 4dcf3c7..a8011c4 100644
--- a/module/tex/context/third/simpleslides/automata/automata-eca.lua
+++ b/module/tex/context/third/simpleslides/automata/automata-eca.lua
@@ -61,11 +61,15 @@ function eca.next_line(from, rule)
--from = string.format("0%s0", from) -- too slow
local cell = C(S"01")
- local cells= Ct(cell * #(cell * cell)) / function (t) -- I ♡ LPEG
- local three = t[1]..t[2]..t[3]
- new = new .. rule[three]
+ --local cells= Ct(cell * #(cell * cell)) / function (t) -- I ♡ LPEG
+ -- local three = t[1]..t[2]..t[3]
+ -- new = new .. rule[three]
+ --end
+ --lpeg.match(cells^1, from)
+ for i=1, #from - 2 do
+ local three = from:sub(i, i+2)
+ new = new .. rule[three]
end
- lpeg.match(cells^1, from)
return new
end