Op 30-6-2012 15:17, Uwe Stöhr schreef:
Am 30.06.2012 11:04, schrieb Vincent van Ravesteijn:
1. This must be next_next_token()
I also thought this first. But as "\" is not found .asCharacter so
that we have in case of "+\+"
+ \ +
current_token skipped next_token()
Using next_next_token() would not return the '\'.
Maybe we should change theCatcode list temporarily, but ok. You're right.
2. You must compare it with 'right'
That would imply that the delimiters are different. But the aim was
only to support single '\' as arguments of \verb as in other cases
single '\' are not allowed and could break the compilation.
I wanted to skip cases like
[\}
because this is in any case invalid LaTeX code.
Perhaps I should add a comment.
The fundamental issue is that you should not change the implementation
of a method just to implement a special case of its use.
How would your code treat "{\{}" and "{\}}" when left='{' and right='}' ?
Verb is such an exceptional case that it might deserve its own function
in which this exception is made instead of adding more if-clauses. Verb
is special in that it treats the backslash as a normal character;
outside verb this exception should not be active. So it doesn't make
sense to activate this exception just based on the fact whether left ==
right. Who says we're parsing a verb command at the moment... just
because at the moment the only case where left==right is when we're
parsing a verb command. This is wrong.
Vincent