diff options
author | Fred Drake <fdrake@acm.org> | 1996-10-09 16:11:26 (GMT) |
---|---|---|
committer | Fred Drake <fdrake@acm.org> | 1996-10-09 16:11:26 (GMT) |
commit | 7edd8d3c58341ed900795f35c780d04648a56539 (patch) | |
tree | cfeb0ff85c7c8e1410fbc471c0e2c1677ed80d73 | |
parent | e1980ed1f8a85fe72a6343a85a48c32dd90ed1b7 (diff) | |
download | cpython-7edd8d3c58341ed900795f35c780d04648a56539.zip cpython-7edd8d3c58341ed900795f35c780d04648a56539.tar.gz cpython-7edd8d3c58341ed900795f35c780d04648a56539.tar.bz2 |
(partparse.py): Rationalize some behavior around unexpected conditions.
-rw-r--r-- | Doc/partparse.py | 11 | ||||
-rw-r--r-- | Doc/tools/partparse.py | 11 |
2 files changed, 14 insertions, 8 deletions
diff --git a/Doc/partparse.py b/Doc/partparse.py index 86bea47..73ca346 100644 --- a/Doc/partparse.py +++ b/Doc/partparse.py @@ -1047,7 +1047,7 @@ def do_funcdesc(length, buf, pp, i): hist.inargs = save del save the_args = [chunk(PLAIN, wh, '()'[0])] + pp[i:newi] + \ - [chunk(PLAIN, wh, '()'[1])] + [chunk(PLAIN, wh, '()'[1])] del pp[i:newi] length = length - (newi-i) @@ -1157,9 +1157,9 @@ def do_datadesc(length, buf, pp, i): cat_class = 'data' class_class = string.join(idxsi[2:]) - if not command: - raise error, 'don\'t know what to do with indexsubitem ' + `idxsi` + return length, i + #raise error, 'don\'t know what to do with indexsubitem ' + `idxsi` *) ch.chtype = chunk_type[CSLINE] ch.data = command @@ -1522,8 +1522,11 @@ def changeit(buf, pp): elif len(idxsi) >= 2 and idxsi[1] in \ ('exception', 'object'): command = 'vindex' + elif len(idxsi) == 3 and idxsi[:2] == ['in', 'module']: + command = 'cindex' else: - print 'WARNING: can\'t categorize ' + `idxsi` + ' for \'ttindex\' command' + print 'WARNING: can\'t categorize ' + `idxsi` \ + + ' for \'ttindex\' command' command = 'cindex' if not cat_class: diff --git a/Doc/tools/partparse.py b/Doc/tools/partparse.py index 86bea47..73ca346 100644 --- a/Doc/tools/partparse.py +++ b/Doc/tools/partparse.py @@ -1047,7 +1047,7 @@ def do_funcdesc(length, buf, pp, i): hist.inargs = save del save the_args = [chunk(PLAIN, wh, '()'[0])] + pp[i:newi] + \ - [chunk(PLAIN, wh, '()'[1])] + [chunk(PLAIN, wh, '()'[1])] del pp[i:newi] length = length - (newi-i) @@ -1157,9 +1157,9 @@ def do_datadesc(length, buf, pp, i): cat_class = 'data' class_class = string.join(idxsi[2:]) - if not command: - raise error, 'don\'t know what to do with indexsubitem ' + `idxsi` + return length, i + #raise error, 'don\'t know what to do with indexsubitem ' + `idxsi` *) ch.chtype = chunk_type[CSLINE] ch.data = command @@ -1522,8 +1522,11 @@ def changeit(buf, pp): elif len(idxsi) >= 2 and idxsi[1] in \ ('exception', 'object'): command = 'vindex' + elif len(idxsi) == 3 and idxsi[:2] == ['in', 'module']: + command = 'cindex' else: - print 'WARNING: can\'t categorize ' + `idxsi` + ' for \'ttindex\' command' + print 'WARNING: can\'t categorize ' + `idxsi` \ + + ' for \'ttindex\' command' command = 'cindex' if not cat_class: |