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