summaryrefslogtreecommitdiffstats
path: root/config/macros.tex
diff options
context:
space:
mode:
Diffstat (limited to 'config/macros.tex')
-rw-r--r--config/macros.tex14
1 files changed, 11 insertions, 3 deletions
diff --git a/config/macros.tex b/config/macros.tex
index 8d0591a..561a15c 100644
--- a/config/macros.tex
+++ b/config/macros.tex
@@ -17,14 +17,22 @@ function dmadore.process_chars(consumer)
elseif t[1]==2 then % Accolade fermante
nesting = nesting-1
if nesting>0 then consumer(t[2]) end
- elseif t[1]>=3 and t[1]<=15 then
+ elseif t[1]>=3 and t[1]<=15 then % La plupart des caractères
consumer(t[2])
elseif token.is_activechar(t) then % Caractère actif
for v in string.utfvalues(token.csname_name(t)) do
consumer(v)
end
- else
- tex.error("I didn't expect a control sequence here")
+ else % Commande
+ do
+ local name_iter = string.utfvalues(token.csname_name(t))
+ local v = name_iter()
+ if v == nil or not (name_iter() == nil) then
+ tex.error("I didn't expect a control sequence here")
+ else
+ consumer(v)
+ end
+ end
end
until nesting==0
end