From 870ab6957882f3942305e384173ea5543c7942a5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marcel=20Fabian=20Kr=C3=BCger?= Date: Sat, 6 Nov 2021 09:03:50 +0100 Subject: [PATCH] Add missing file --- luametalatex-meaning.lua | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) create mode 100644 luametalatex-meaning.lua diff --git a/luametalatex-meaning.lua b/luametalatex-meaning.lua new file mode 100644 index 0000000..4176d6e --- /dev/null +++ b/luametalatex-meaning.lua @@ -0,0 +1,29 @@ +-- Compatibility layer for \meaning +-- This reverts a change rearding the \meaning of user macros: +-- LuaMetaTeX does not prefix prefixes in the meaning with a backslash. + +-- Necessary especially for etoolbox's patching commands + +local primitive_meaning = { + token.primitive_tokens.expandafter, + token.primitive_tokens.relax, + token.primitive_tokens.meaning, +} +token.luacmd("meaning", function() + local peeked = token.peek_next() + token.put_next(primitive_meaning) + token.skip_next_expanded() + if peeked.parameters == 0 then + tex.sprint'->' + end + --[[ + if peeked.frozen then + assert(token.scan_keyword'frozen' and token.scan_code(0x400)) + tex.sprint(-2, '\\frozen ') + end + if peeked.protected then + assert(token.scan_keyword'protected' and token.scan_code(0x400)) + tex.sprint(-2, '\\protected ') + end + ]] +end, "force", "global")