ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
* Bug in ctxtools --documentation
@ 2006-07-31  7:17 Aditya Mahajan
  2006-07-31  7:46 ` Hans Hagen
  0 siblings, 1 reply; 2+ messages in thread
From: Aditya Mahajan @ 2006-07-31  7:17 UTC (permalink / raw)


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

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: Bug in ctxtools --documentation
  2006-07-31  7:17 Bug in ctxtools --documentation Aditya Mahajan
@ 2006-07-31  7:46 ` Hans Hagen
  0 siblings, 0 replies; 2+ messages in thread
From: Hans Hagen @ 2006-07-31  7:46 UTC (permalink / raw)


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

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2006-07-31  7:46 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2006-07-31  7:17 Bug in ctxtools --documentation Aditya Mahajan
2006-07-31  7:46 ` Hans Hagen

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).