From f71a1692947e79a51bb8f62e7e09bcc74afe2f86 Mon Sep 17 00:00:00 2001 From: Georg Baum Date: Tue, 14 Nov 2006 20:45:07 +0000 Subject: [PATCH] Make nesting levels work. Obviously ++nestdepth does not do in python what it does in C++. git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@15930 a592a061-630c-0410-9148-cb99ea01b6c8 --- lib/lyx2lyx/lyx_1_5.py | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/lib/lyx2lyx/lyx_1_5.py b/lib/lyx2lyx/lyx_1_5.py index 0eb9bb44a9..d4f00cfe3a 100644 --- a/lib/lyx2lyx/lyx_1_5.py +++ b/lib/lyx2lyx/lyx_1_5.py @@ -350,9 +350,6 @@ def convert_commandparams(document): # \begin_inset LatexCommand bibitem was not the official version (see # convert_bibitem()), but could be read in, so we convert it here, too. - # FIXME: Handle things like \command[foo[bar]]{foo{bar}} - # we need a real parser here. - regex = re.compile(r'\\([^\[\{]+)(\[[^\[\{]*\])?(\[[^\[\{]*\])?(\{[^}]*\})?') i = 0 while 1: i = find_token(document.body, "\\begin_inset LatexCommand", i) @@ -384,11 +381,11 @@ def convert_commandparams(document): if nestdepth == 0: state = "WS" else: - --nestdepth + nestdepth = nestdepth - 1 if ((state == "OPTION" and c == '[') or (state == "SECOPTION" and c == '[') or (state == "CONTENT" and c == '{')): - ++nestdepth + nestdepth = nestdepth + 1 if state == "CMDNAME": name += c elif state == "OPTION": -- 2.39.2