diff options
author | Marius <mariausol@gmail.com> | 2010-08-19 10:29:42 +0300 |
---|---|---|
committer | Marius <mariausol@gmail.com> | 2010-08-19 10:29:42 +0300 |
commit | 7d7e0d3c8d778650105cfb479f31a2bb54d69d50 (patch) | |
tree | e0c4e7d8bf466a70af56be02a0de703bbd09a5af /tex/context/base/char-tex.lua | |
parent | b469b8ec1b494ab72cd462bfc539ce01440e6aaf (diff) | |
download | context-7d7e0d3c8d778650105cfb479f31a2bb54d69d50.tar.gz |
beta 2010.08.19 01:08
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 |