diff options
Diffstat (limited to 'tex/context/base/mkiv/l-lpeg.lua')
-rw-r--r-- | tex/context/base/mkiv/l-lpeg.lua | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/tex/context/base/mkiv/l-lpeg.lua b/tex/context/base/mkiv/l-lpeg.lua index e3d0ff9c3..5101a2e8d 100644 --- a/tex/context/base/mkiv/l-lpeg.lua +++ b/tex/context/base/mkiv/l-lpeg.lua @@ -291,8 +291,12 @@ patterns.beginline = #(1-newline) patterns.longtostring = Cs(whitespace^0/"" * ((patterns.quoted + nonwhitespace^1 + whitespace^1/"" * (P(-1) + Cc(" ")))^0)) -local function anywhere(pattern) --slightly adapted from website - return P { P(pattern) + 1 * V(1) } +-- local function anywhere(pattern) -- slightly adapted from website +-- return P { P(pattern) + 1 * V(1) } +-- end + +function anywhere(pattern) -- faster + return (1-P(pattern))^0 * P(pattern) end lpeg.anywhere = anywhere |