Georg Baum wrote:

> Jean-Marc Lasgouttes wrote:
> 
>> Could you make a patch?
> 
> I'll make one when André has answered my question concerning changing
> math_deliminset instead of math_parser.

Jean-Marc,
since I got no answer I applied my original version. Attached is the
corresponding patch for 1.3. I am going to apply it unless you tell me not
to do so.


Georg
Index: src/mathed/ChangeLog
===================================================================
RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/mathed/ChangeLog,v
retrieving revision 1.299.2.18
diff -u -p -r1.299.2.18 ChangeLog
--- src/mathed/ChangeLog	11 Feb 2005 13:47:18 -0000	1.299.2.18
+++ src/mathed/ChangeLog	2 Mar 2005 14:37:29 -0000
@@ -1,3 +1,8 @@
+2005-03-02  Georg Baum  <[EMAIL PROTECTED]>
+
+	* math_parser.C (parse1): Don't parse "\|" following a "\left" or
+	"\right" as "|"
+
 2005-02-11  Jean-Marc Lasgouttes  <[EMAIL PROTECTED]>
 
 	* math_casesinset.C (validate): New method. Requires amsmath.
Index: src/mathed/math_parser.C
===================================================================
RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/mathed/math_parser.C,v
retrieving revision 1.259.2.6
diff -u -p -r1.259.2.6 math_parser.C
--- src/mathed/math_parser.C	30 Dec 2004 14:54:17 -0000	1.259.2.6
+++ src/mathed/math_parser.C	2 Mar 2005 14:37:30 -0000
@@ -1022,10 +1022,15 @@ void Parser::parse1(MathGridInset & grid
 		}
 
 		else if (t.cs() == "left") {
-			string l = getToken().asString();
+			Token const & tl = getToken();
+			// \| and \Vert are equivalent, and MathDelimInset
+			// can't handle \|
+			// FIXME: fix this in MathDelimInset itself!
+			string const l = tl.cs() == "|" ? "Vert" : tl.asString();
 			MathArray ar;
 			parse(ar, FLAG_RIGHT, mode);
-			string r = getToken().asString();
+			Token const & tr = getToken();
+			string const r = tr.cs() == "|" ? "Vert" : tr.asString();
 			cell->push_back(MathAtom(new MathDelimInset(l, r, ar)));
 		}
 

Reply via email to