% % stack: functions % "^\}.*\r" rex &; dup mats "|*|" &; ^ & "_mats.txt" ofbin write "mats " count & logs "_mats.txt" ofbin read "|*|" slice "Matches" second <> { "mats " count & &" " log)( dupnzis { 1 !start 0 !term countup { count &" x" logs second <> "look " log)( { !temp pop2 % % stack: funcs lookup start-pos % third length logs exch % % stack: funcs lookup funcs start-pos % _start second !start _term add % % stack: funcs lookup funcs end-pos start-pos % "startpos " third & logs exch second sub + "lensect " log)( % % stack: funcs lookup funcs start-pos len % mid % % stack: funcs lookup funcs fsect % trim &; _temp length !term trim &; & count &" a" logs dup Str.FirstLine dup " " Str.Left "fdef " log)( < |var % % variable assignment for func assign % dup " " 1 1 1 parse |function % % function definition % dup " " 1 1 1 parse "(" Str.Left trim > not { % % this is an object assignment, use the token % dup " " Str.Left } if root\ dup "_mats3.txt" ofbin write newchild "_mats2.txt" ofbin write dup "_mats1.txt" ofbin write "Body" \! count &" b" logs } if } for nod@ } if } if "mats " count & &" " log)( pop2