summaryrefslogtreecommitdiffstats
path: root/Doc
diff options
context:
space:
mode:
authorFred Drake <fdrake@acm.org>1998-11-23 16:30:18 (GMT)
committerFred Drake <fdrake@acm.org>1998-11-23 16:30:18 (GMT)
commitbbd7509dbe6865e8f74d155c6f149b27828361d7 (patch)
treef605e3304d6edc1abd4ed793c5f3f3a2b9fa4182 /Doc
parent185ead6f370639204d4f6602216a6aba3ed89974 (diff)
downloadcpython-bbd7509dbe6865e8f74d155c6f149b27828361d7.zip
cpython-bbd7509dbe6865e8f74d155c6f149b27828361d7.tar.gz
cpython-bbd7509dbe6865e8f74d155c6f149b27828361d7.tar.bz2
Fix up the extraction of optional parameters a little.
Be more informative in an exception message.
Diffstat (limited to 'Doc')
-rwxr-xr-xDoc/tools/latex2esis.py6
1 files changed, 3 insertions, 3 deletions
diff --git a/Doc/tools/latex2esis.py b/Doc/tools/latex2esis.py
index d186a66..afa2d86 100755
--- a/Doc/tools/latex2esis.py
+++ b/Doc/tools/latex2esis.py
@@ -26,7 +26,7 @@ _end_env_rx = re.compile(r"[\\]end{([^}]*)}")
_begin_macro_rx = re.compile("[\\\\]([a-zA-Z]+[*]?)({|\\s*\n?)")
_comment_rx = re.compile("%+[ \t]*(.*)\n")
_text_rx = re.compile(r"[^]%\\{}]+")
-_optional_rx = re.compile(r"[[]([^]]*)[]]")
+_optional_rx = re.compile(r"\s*[[]([^]]*)[]]")
_parameter_rx = re.compile("[ \n]*{([^}]*)}")
_token_rx = re.compile(r"[a-zA-Z][a-zA-Z0-9.-]*$")
_start_group_rx = re.compile("[ \n]*{")
@@ -181,8 +181,8 @@ def subconvert(line, ofp, table, discards, autoclosing, knownempty,
m = _parameter_rx.match(line)
if not m:
raise LaTeXFormatError(
- "could not extract parameter group: "
- + `line`)
+ "could not extract parameter %s for %s: %s"
+ % (attrname, macroname, `line[:100]`))
value = m.group(1)
if _token_rx.match(value):
dtype = "TOKEN"