From 204057fdc5023b5f4ff55a69bc6593388ea427e7 Mon Sep 17 00:00:00 2001 From: Hans Hagen Date: Wed, 13 Jun 2018 09:56:22 +0200 Subject: 2018-06-12 21:56:00 --- tex/context/base/mkiv/mlib-lua.lua | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'tex/context/base/mkiv/mlib-lua.lua') 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 -- cgit v1.2.3