[NTG-context] Bug in ctxtools --documentation

Aditya Mahajan adityam at umich.edu
Mon Jul 31 09:17:37 CEST 2006


Hi Hans,

ctxtools.rb says that %D is the documetation marker. However, while 
matching it uses

   when /^[%\#]D/io then

Doesn't /i stand for ignorecase, which means that %d is also matched? 
Is this a bug or a feature?

Try generating documentation of core-fnt.tex for an interesting 
manifestation of this. You have

%def\uppercased#1{{\forceunexpanded\xdef\@@globalcrap{\uppercase{#1}}}\@@globalcrap}
%def\lowercased#1{{\forceunexpanded\xdef\@@globalcrap{\lowercase{#1}}}\@@globalcrap}

%d gets matched, %de gets deleted and the following is written in 
core-fnt.ted

\startdocumentation
f\uppercased#1{{\forceunexpanded\xdef\@@globalcrap{\uppercase{#1}}}\@@globalcrap}
f\lowercased#1{{\forceunexpanded\xdef\@@globalcrap{\lowercase{#1}}}\@@globalcrap}
\stopdocumentation

when context processes this it complains

! Illegal parameter number in definition of \@@expanded.
<to be read again>
                    }
\uppercased ... \xdef \@@expanded {\uppercase {#1}
                                                   }}\@@expanded
l.251 f\uppercased#

1{{\forceunexpanded\xdef\@@globalcrap{\uppercase{#1}}}\@@...

?
! You can't use `macro parameter character #' in horizontal mode.
<recently read> ##

\@@expanded ->\uppercase {##}

l.251 f\uppercased#

1{{\forceunexpanded\xdef\@@globalcrap{\uppercase{#1}}}\@@...



Aditya


More information about the ntg-context mailing list