Commits

Philipp Gesang  committed 532cfb9

[elementary] replaced broken lpeg

  • Participants
  • Parent commits 53e0ff9

Comments (0)

Files changed (3)

File examples/elementary.tex

   mode=eca,
   color=blue,]
 
-%\ctxlua{dofile "automatarc-eca.lua"}
 \starttext
 
 \dorecurse{10}{

File module/tex/context/third/simpleslides/automata/automata-eca.lua

     --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
 

File module/tex/context/third/simpleslides/simpleslides-s-Automata.tex

   clip=,
 ] % using defaults from lua config
 
-\ctxlua{environment.loadluafile( "automata-main" )}
+% \ctxlua{environment.loadluafile( "automata-main" )}
+\ctxloadluafile{automata-main}
 \ctxlua{mplife.slides = true}
 
 \unprotect
     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.