what it does in C++.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@15930
a592a061-630c-0410-9148-
cb99ea01b6c8
# \begin_inset LatexCommand bibitem was not the official version (see
# convert_bibitem()), but could be read in, so we convert it here, too.
# \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)
i = 0
while 1:
i = find_token(document.body, "\\begin_inset LatexCommand", i)
if nestdepth == 0:
state = "WS"
else:
if nestdepth == 0:
state = "WS"
else:
+ nestdepth = nestdepth - 1
if ((state == "OPTION" and c == '[') or
(state == "SECOPTION" and c == '[') or
(state == "CONTENT" and c == '{')):
if ((state == "OPTION" and c == '[') or
(state == "SECOPTION" and c == '[') or
(state == "CONTENT" and c == '{')):
+ nestdepth = nestdepth + 1
if state == "CMDNAME":
name += c
elif state == "OPTION":
if state == "CMDNAME":
name += c
elif state == "OPTION":