diff options
author | Context Git Mirror Bot <phg42.2a@gmail.com> | 2014-05-17 03:15:13 +0200 |
---|---|---|
committer | Context Git Mirror Bot <phg42.2a@gmail.com> | 2014-05-17 03:15:13 +0200 |
commit | 7efbfd1d82c215c154a4840a906e0aa55e07ed0e (patch) | |
tree | e3b2eb3cb73a209713900231290208a40979d00e /tex/context/base/char-ini.lua | |
parent | d14466a41dfef73ca9c32c5ef8e266a30a0ac03f (diff) | |
download | context-7efbfd1d82c215c154a4840a906e0aa55e07ed0e.tar.gz |
2014-05-16 20:10:00
Diffstat (limited to 'tex/context/base/char-ini.lua')
-rw-r--r-- | tex/context/base/char-ini.lua | 42 |
1 files changed, 23 insertions, 19 deletions
diff --git a/tex/context/base/char-ini.lua b/tex/context/base/char-ini.lua index 1cfeb0596..7dc381031 100644 --- a/tex/context/base/char-ini.lua +++ b/tex/context/base/char-ini.lua @@ -459,29 +459,33 @@ local is_mark = allocate ( tohash { "mn", "ms", } ) +local is_punctuation = allocate ( tohash { + "pc","pd","ps","pe","pi","pf","po", +} ) + -- to be redone: store checked characters -characters.is_character = is_character -characters.is_letter = is_letter -characters.is_command = is_command -characters.is_spacing = is_spacing -characters.is_mark = is_mark - -local mt = { -- yes or no ? - __index = function(t,k) - if type(k) == "number" then - local c = data[k].category - return c and rawget(t,c) - else - -- avoid auto conversion in data.characters lookups - end +characters.is_character = is_character +characters.is_letter = is_letter +characters.is_command = is_command +characters.is_spacing = is_spacing +characters.is_mark = is_mark +characters.is_punctuation = is_punctuation + +local mti = function(t,k) + if type(k) == "number" then + local c = data[k].category + return c and rawget(t,c) + else + -- avoid auto conversion in data.characters lookups end -} +end -setmetatableindex(characters.is_character, mt) -setmetatableindex(characters.is_letter, mt) -setmetatableindex(characters.is_command, mt) -setmetatableindex(characters.is_spacing, mt) +setmetatableindex(characters.is_character, mti) +setmetatableindex(characters.is_letter, mti) +setmetatableindex(characters.is_command, mti) +setmetatableindex(characters.is_spacing, mti) +setmetatableindex(characters.is_punctuation,mti) -- todo: also define callers for the above |