diff options
author | Robert Alessi <alessi@robertalessi.net> | 2018-05-28 13:57:58 +0200 |
---|---|---|
committer | Robert Alessi <alessi@robertalessi.net> | 2018-05-28 13:57:58 +0200 |
commit | 3f1f2d11ce0b89e7084905c4a0111b7d84455a60 (patch) | |
tree | fd8cbcb81c5af97e027b2011a5ef7a80a0ab4f77 | |
parent | 9db04636dc0a1c4cd0dff49e1c48a1612a8233e8 (diff) | |
download | arabluatex-3f1f2d11ce0b89e7084905c4a0111b7d84455a60.tar.gz |
tightened some Pegs
-rw-r--r-- | arabluatex.lua | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/arabluatex.lua b/arabluatex.lua index 3e7dd96..b99fbca 100644 --- a/arabluatex.lua +++ b/arabluatex.lua | |||
@@ -81,7 +81,7 @@ local bsqbrackets = lpeg.Cs{ "[" * ((1 - lpeg.S"[]") + lpeg.V(1))^0 * "]" } | |||
81 | local bcbraces = lpeg.Cs{ "{" * ((1 - lpeg.S"{}") + lpeg.V(1))^0 * "}" } | 81 | local bcbraces = lpeg.Cs{ "{" * ((1 - lpeg.S"{}") + lpeg.V(1))^0 * "}" } |
82 | local spce = lpeg.P(" ") | 82 | local spce = lpeg.P(" ") |
83 | local bsqbracketsii = lpeg.Cs(bsqbrackets^-2) | 83 | local bsqbracketsii = lpeg.Cs(bsqbrackets^-2) |
84 | local bcbracesii = lpeg.Cs(spce^-1 * bcbraces * spce^-1 * bcbraces^-1) | 84 | local bcbracesii = lpeg.Cs(bcbraces * bcbraces^-1) |
85 | 85 | ||
86 | local function breakcmd(str) | 86 | local function breakcmd(str) |
87 | for i = 1,#albrkcmds do | 87 | for i = 1,#albrkcmds do |
@@ -95,7 +95,7 @@ local function breakcmd(str) | |||
95 | str = gsub(str, dblbkslash * lpeg.Cs(brkcmds[i]) * spce^-1 * bsqbracketsii * bcbracesii, "}%1%2%3%4\\arb{") | 95 | str = gsub(str, dblbkslash * lpeg.Cs(brkcmds[i]) * spce^-1 * bsqbracketsii * bcbracesii, "}%1%2%3%4\\arb{") |
96 | end | 96 | end |
97 | end | 97 | end |
98 | -- process \item[], then \item[] | 98 | -- process \item[], then \item |
99 | str = string.gsub(str, "\\(item.?)(%b[])", | 99 | str = string.gsub(str, "\\(item.?)(%b[])", |
100 | function(tag, body) | 100 | function(tag, body) |
101 | body = string.sub(body, 2, -2) | 101 | body = string.sub(body, 2, -2) |