diff options
Diffstat (limited to 'tex/context/base/syst-aux.lua')
-rw-r--r-- | tex/context/base/syst-aux.lua | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/tex/context/base/syst-aux.lua b/tex/context/base/syst-aux.lua index b04d11d89..cda340cb6 100644 --- a/tex/context/base/syst-aux.lua +++ b/tex/context/base/syst-aux.lua @@ -16,6 +16,7 @@ local commands, context = commands, context local settings_to_array = utilities.parsers.settings_to_array local concat = table.concat local format = string.format +local utfsub = utf.sub local P, C, Carg, lpegmatch, utf8char = lpeg.P, lpeg.C, lpeg.Carg, lpeg.match, lpeg.patterns.utf8char local setvalue = context.setvalue @@ -34,6 +35,10 @@ function commands.doiffirstcharelse(chr,str) commands.doifelse(lpegmatch(pattern,str) == chr) end +function commands.getsubstring(str,first,last) + context(utfsub(str,tonumber(first),tonumber(last))) +end + -- function commands.addtocommalist(list,item) -- if list == "" then -- context(item) |