From 728c2da88338ed85ad5f9d6adefe20ef6da5e111 Mon Sep 17 00:00:00 2001 From: Georg Baum Date: Wed, 2 Mar 2005 14:26:12 +0000 Subject: [PATCH] fix \| after \left or \right in mathed git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@9689 a592a061-630c-0410-9148-cb99ea01b6c8 --- src/mathed/ChangeLog | 5 +++++ src/mathed/math_parser.C | 13 +++++++++---- 2 files changed, 14 insertions(+), 4 deletions(-) diff --git a/src/mathed/ChangeLog b/src/mathed/ChangeLog index 5832bc7368..7bb4069533 100644 --- a/src/mathed/ChangeLog +++ b/src/mathed/ChangeLog @@ -1,3 +1,8 @@ +2005-03-02 Georg Baum + + * math_parser.C (parse1): Don't parse "\|" following a "\left" or + "\right" as "|" + 2005-02-28 André Pönitz * math_nestinset.C (lfunMouseRelease, lfunMouseMotion, lfunMousePress): diff --git a/src/mathed/math_parser.C b/src/mathed/math_parser.C index 192e642b8f..6855483c55 100644 --- a/src/mathed/math_parser.C +++ b/src/mathed/math_parser.C @@ -1048,11 +1048,16 @@ void Parser::parse1(MathGridInset & grid, unsigned flags, else if (t.cs() == "left") { skipSpaces(); - 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); skipSpaces(); - 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))); } @@ -1083,8 +1088,8 @@ void Parser::parse1(MathGridInset & grid, unsigned flags, } else if (name == "split" || name == "cases" || - name == "gathered" || name == "aligned" || - name == "alignedat") { + name == "gathered" || name == "aligned" || + name == "alignedat") { cell->push_back(createMathInset(name)); parse2(cell->back(), FLAG_END, mode, false); } -- 2.39.2