summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPhilipp Gesang <pgesang@ix.urz.uni-heidelberg.de>2012-02-22 14:39:39 +0100
committerPhilipp Gesang <pgesang@ix.urz.uni-heidelberg.de>2012-02-22 14:39:39 +0100
commit5d104ea769afd5a9319be297bb8b450e7c0aa8c2 (patch)
tree2dbb44e16a7db08264e2aa5ccee2b5df0e092d2c
parent8b1982129e6fca8df0c99b55d55d3b682f6e0a6d (diff)
downloadautomata-backgrounds-5d104ea769afd5a9319be297bb8b450e7c0aa8c2.tar.gz
[elementary] replaced broken lpeg
-rw-r--r--examples/elementary.tex1
-rw-r--r--module/tex/context/third/simpleslides/automata/automata-eca.lua12
-rw-r--r--module/tex/context/third/simpleslides/simpleslides-s-Automata.tex5
3 files changed, 11 insertions, 7 deletions
diff --git a/examples/elementary.tex b/examples/elementary.tex
index aafebcb..85eb918 100644
--- a/examples/elementary.tex
+++ b/examples/elementary.tex
@@ -7,7 +7,6 @@
mode=eca,
color=blue,]
-%\ctxlua{dofile "automatarc-eca.lua"}
\starttext
\dorecurse{10}{
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
diff --git a/module/tex/context/third/simpleslides/simpleslides-s-Automata.tex b/module/tex/context/third/simpleslides/simpleslides-s-Automata.tex
index a7a079d..77861e9 100644
--- a/module/tex/context/third/simpleslides/simpleslides-s-Automata.tex
+++ b/module/tex/context/third/simpleslides/simpleslides-s-Automata.tex
@@ -30,7 +30,8 @@
clip=,
] % using defaults from lua config
-\ctxlua{environment.loadluafile( "automata-main" )}
+% \ctxlua{environment.loadluafile( "automata-main" )}
+\ctxloadluafile{automata-main}
\ctxlua{mplife.slides = true}
\unprotect
@@ -171,7 +172,7 @@ do
else
c.init = eca.parse_file(c.file)
c.framesize = math.floor(c.aspect * c.init:len())
- c.pages = structure.counters.record("realpage")["last"]
+ c.pages = structures.counters.record("realpage")["last"]
if c.clip then
c.xneeded = c.pages * c.framesize
if c.clip == "both" then -- Assume initial pattern is centered.