diff options
Diffstat (limited to 'tex/context/base/char-tex.lua')
-rw-r--r-- | tex/context/base/char-tex.lua | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/tex/context/base/char-tex.lua b/tex/context/base/char-tex.lua index ed9a244d7..5a1edb42e 100644 --- a/tex/context/base/char-tex.lua +++ b/tex/context/base/char-tex.lua @@ -6,11 +6,16 @@ if not modules then modules = { } end modules ['char-tex'] = { license = "see context related readme files" } -characters = characters or { } -characters.tex = characters.tex or { } - local find = string.find +local lpeg = lpeg +local P, C, R, S, Cs, Cc = lpeg.P, lpeg.C, lpeg.R, lpeg.S, lpeg.Cs, lpeg.Cc +local U, lpegmatch = lpeg.patterns.utf8, lpeg.match + +characters = characters or { } +local characters = characters +characters.tex = characters.tex or { } + local accent_map = { ['~'] = "̃" , -- ̃ Ẽ ['"'] = "̈" , -- ̈ Ë @@ -57,9 +62,6 @@ local function remap_commands(c) end end -local P, C, R, S, Cs, Cc = lpeg.P, lpeg.C, lpeg.R, lpeg.S, lpeg.Cs, lpeg.Cc -local U, lpegmatch = lpeg.patterns.utf8, lpeg.match - local accents = (P('\\') * C(S(accents)) * (P("{") * C(U) * P("}" * Cc(true)) + C(U) * Cc(false))) / remap_accents local commands = (P('\\') * C(R("az","AZ")^1)) / remap_commands |