]> git.lyx.org Git - lyx.git/commitdiff
Make nesting levels work. Obviously ++nestdepth does not do in python
authorGeorg Baum <Georg.Baum@post.rwth-aachen.de>
Tue, 14 Nov 2006 20:45:07 +0000 (20:45 +0000)
committerGeorg Baum <Georg.Baum@post.rwth-aachen.de>
Tue, 14 Nov 2006 20:45:07 +0000 (20:45 +0000)
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

index 0eb9bb44a9d322d5af08ae31bd10ff06895384bb..d4f00cfe3a30df2d593a5e3939db08437562ca61 100644 (file)
@@ -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":