Am 03.10.2010 um 11:02 schrieb Wolfgang Schuster:

> Am 03.10.2010 um 10:28 schrieb luigi scarso:
> 
>> Limitation, but it should be doable to remedy in TeX.
> 
> Possible but is it worth the effort, when you start with “--” the percent 
> should also behave like in Lua etc.

The problem is that there is no solution to write something expandable (because 
\startluacode expands the content) which is required here.

> \starttext
> 
> \bgroup\obeylines
> \gdef\texcomment#1
> {}
> \egroup
> 
> \bgroup
> \let\letterhyphen=-
> \catcode`-=13
> \unexpanded\def-{\futurelet\next\doscanhyphen}
> \def\doscanhyphen
> {\ifx\next-
>    \expandafter\texcomment
>  \else
>    \expandafter\letterhyphen
>  \fi}
> \obeylines
> text
> text
> % foo
> - foo 1

-- \undefined
\normalexpanded{- foo 1}
\normalexpanded{-- foo 2}
\normalexpanded{-- \undefined}

> text
> \egroup
> 
> \stoptext

Wolfgang

___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________

Reply via email to