diff options
author | Hans Hagen <pragma@wxs.nl> | 2018-06-13 09:56:22 +0200 |
---|---|---|
committer | Context Git Mirror Bot <phg42.2a@gmail.com> | 2018-06-13 09:56:22 +0200 |
commit | 204057fdc5023b5f4ff55a69bc6593388ea427e7 (patch) | |
tree | 2153d525f1fb854189772d3109be782a0aeb14fd /tex/context/base/mkiv/mlib-lua.lua | |
parent | 7686a24f79edfef2a9d013882c822c76a12e23dc (diff) | |
download | context-204057fdc5023b5f4ff55a69bc6593388ea427e7.tar.gz |
2018-06-12 21:56:00
Diffstat (limited to 'tex/context/base/mkiv/mlib-lua.lua')
-rw-r--r-- | tex/context/base/mkiv/mlib-lua.lua | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/tex/context/base/mkiv/mlib-lua.lua b/tex/context/base/mkiv/mlib-lua.lua index 675be15bc..543d04697 100644 --- a/tex/context/base/mkiv/mlib-lua.lua +++ b/tex/context/base/mkiv/mlib-lua.lua @@ -776,3 +776,17 @@ do end end + +do + + -- a bit overkill: just a find(str,"mf_object=") can be enough + + local p1 = P("mf_object=") + local p2 = lpeg.patterns.eol * p1 + local pattern = (1-p2)^0 * p2 + p1 + + function mp.isobject(str) + mp.boolean(pattern and str ~= "" and lpegmatch(p,str)) + end + +end |