On 2012-05-14 09:35, Hans Hagen wrote: > On 13-5-2012 13:12, Philipp Gesang wrote: > >Hi all, > > > >seems the mkvi-style macros have trouble with groups in comments: > > > >········································································ > >% macros=mkvi > >\def\dosomething#content{%%%<= fine with “#1” > > % { %%% Open unbalanced brace breaks macros. > >} > > > >\starttext \dosomething {foo} \stoptext > >········································································ > > > >Fails here with: > > > > <to be read again> > > c > > l.2 \def\dosomething#c > > ontent{%%%<= fine with “#1” > > > >Removing the comment, closing the group or reverting to TEX-style > >argument numbering makes this behavior disappear. > > Indeed there are some limitations to the parser. I'll note it down > as low priority issue.
Would it be possible to modify the comment pattern so that it accept initial spaces? At least it fixes my problem. Philipp --- /home/laokoon/base/luat-mac.lua 2012-05-14 14:52:40.674091445 +0200 +++ luat-mac.lua 2012-05-14 15:18:35.968999022 +0200 @@ -110,8 +110,10 @@ local commenttoken = P("%") local crorlf = S("\n\r") -local commentline = commenttoken * ((Carg(1) * C((1-crorlf)^0))/function(strip,s) return strip and "" or s end) -local commentline = commenttoken * ((1-crorlf)^0) +--local commentline = commenttoken * ((Carg(1) * C((1-crorlf)^0))/function(strip,s) return strip and "" or s end) +--local commentline = commenttoken * ((1-crorlf)^0) +local commentstart = space^0 * commenttoken +local commentline = commentstart * ((1-crorlf)^0) local leadingcomment = (commentline * crorlf^1)^1 local furthercomment = (crorlf^1 * commentline)^1
pgpRRztvZEQT4.pgp
Description: PGP signature
___________________________________________________________________________________ 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 ___________________________________________________________________________________