Op 1-7-2012 2:12, Uwe Stöhr schreef:


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.

But my code will only be accessed for \verb: I allow a single '\' only when left==right and when it is the only character within the delimiters. So take for example this:
\test|\{|

As only \verb can contain a single \, there is always a second character behind a \. So my code is not used.

Take now this example:
\test|\|

This is invalid LateX code as there is no closing delimiter (the \ escapes it). texl2yx will allow this, but the user is responsible for this code and if he writes wrong LaTeX, we cannot do much.

I have put my new patch in. Please test. I might have overseen a case buut no example comes into my mind that would fail. If you have one, please tell me.


I believe that your latest patch works for all examples, but that was not the point I wanted to made. In theory, one should be able to know what a function does without looking at the implementation. The problem I have with the code is that it treats a backslash differently according to whether the left and right delimiters are the same. This is wrong logic.

Vincent

Reply via email to