Bug in ctxtools --documentation
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
Aditya Mahajan wrote:
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?
an undocumented feature (which will remain undocumented because i dislike a mix of Dd's)
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
actually it's lazyness when /^[%\#]D($| )/io then when /^[%\#]M($| )/io then so there need to be a space after the %D *or a newline) Hans
participants (2)
-
Aditya Mahajan
-
Hans Hagen