Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit ef05803

Browse files
committed
Support environments {fulllineitems} and {classdesc}, more of the new logical
markup. The info generation now works, yet again.
1 parent c927407 commit ef05803

2 files changed

Lines changed: 14 additions & 24 deletions

File tree

Doc/partparse.py

Lines changed: 7 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1334,7 +1334,7 @@ def changeit(buf, pp):
13341334
chunk(GROUP, ch.where, [])]
13351335
length, i = length+2, i+2
13361336

1337-
elif envname in ('itemize', 'list'):
1337+
elif envname in ('itemize', 'list', 'fulllineitems'):
13381338
if hist.itemizenesting > len(itemizesymbols):
13391339
raise error, 'too deep itemize nesting'
13401340
if envname == 'list':
@@ -1419,12 +1419,11 @@ def changeit(buf, pp):
14191419
if length != len(pp):
14201420
raise 'STILL, SOMETHING wrong', `i`
14211421

1422-
1423-
elif envname in ('funcdesc', 'funcdescni'):
1422+
elif envname in ('funcdesc', 'funcdescni', 'classdesc'):
14241423
pp.insert(i, chunk(PLAIN, ch.where, ''))
14251424
i, length = i+1, length+1
14261425
length, i = do_funcdesc(length, buf, pp, i,
1427-
envname=="funcdesc")
1426+
envname[-2:] != "ni")
14281427

14291428
elif envname == 'excdesc':
14301429
pp.insert(i, chunk(PLAIN, ch.where, ''))
@@ -1435,7 +1434,7 @@ def changeit(buf, pp):
14351434
pp.insert(i, chunk(PLAIN, ch.where, ''))
14361435
i, length = i+1, length+1
14371436
length, i = do_datadesc(length, buf, pp, i,
1438-
envname=="datadesc")
1437+
envname[-2:] != "ni")
14391438

14401439
elif envname == 'opcodedesc':
14411440
pp.insert(i, chunk(PLAIN, ch.where, ''))
@@ -1472,7 +1471,7 @@ def changeit(buf, pp):
14721471
chunk(GROUP, ch.where, [
14731472
chunk(PLAIN, ch.where, 'example')])]
14741473
i, length = i+2, length+2
1475-
elif envname in ('itemize', 'list'):
1474+
elif envname in ('itemize', 'list', 'fulllineitems'):
14761475
hist.itemizenesting = hist.itemizenesting - 1
14771476
pp[i:i] = [chunk(CSLINE, ch.where, 'end'),
14781477
chunk(GROUP, ch.where, [
@@ -1497,7 +1496,7 @@ def changeit(buf, pp):
14971496
pp.insert(i, chunk(DENDLINE, ch.where, '\n'))
14981497
i, length = i+1, length+1
14991498

1500-
elif envname in ('funcdesc', 'excdesc', 'datadesc',
1499+
elif envname in ('funcdesc', 'excdesc', 'datadesc', 'classdesc',
15011500
'funcdescni', 'datadescni'):
15021501
pp[i:i] = [chunk(CSLINE, ch.where, 'end'),
15031502
chunk(GROUP, ch.where, [
@@ -1597,10 +1596,6 @@ def changeit(buf, pp):
15971596
elif s_buf_data == 'program':
15981597
ch.data = "strong"
15991598

1600-
elif s_buf_data == "fulllineitems":
1601-
del pp[i-1]
1602-
i, length = i-1, length-1
1603-
16041599
elif s_buf_data == 'item':
16051600
ch.chtype = chunk_type[CSLINE]
16061601
length, newi = getoptarg(length, buf, pp, i)
@@ -2093,7 +2088,7 @@ def changeit(buf, pp):
20932088

20942089
elif s_buf_data in ('url', 'module', 'function', 'cfunction',
20952090
'keyword', 'method', 'exception', 'constant',
2096-
'email', 'class'):
2091+
'email', 'class', 'member', 'cdata', 'ctype'):
20972092
ch.data = "code"
20982093

20992094
elif s_buf_data == 'label':

Doc/tools/partparse.py

Lines changed: 7 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1334,7 +1334,7 @@ def changeit(buf, pp):
13341334
chunk(GROUP, ch.where, [])]
13351335
length, i = length+2, i+2
13361336

1337-
elif envname in ('itemize', 'list'):
1337+
elif envname in ('itemize', 'list', 'fulllineitems'):
13381338
if hist.itemizenesting > len(itemizesymbols):
13391339
raise error, 'too deep itemize nesting'
13401340
if envname == 'list':
@@ -1419,12 +1419,11 @@ def changeit(buf, pp):
14191419
if length != len(pp):
14201420
raise 'STILL, SOMETHING wrong', `i`
14211421

1422-
1423-
elif envname in ('funcdesc', 'funcdescni'):
1422+
elif envname in ('funcdesc', 'funcdescni', 'classdesc'):
14241423
pp.insert(i, chunk(PLAIN, ch.where, ''))
14251424
i, length = i+1, length+1
14261425
length, i = do_funcdesc(length, buf, pp, i,
1427-
envname=="funcdesc")
1426+
envname[-2:] != "ni")
14281427

14291428
elif envname == 'excdesc':
14301429
pp.insert(i, chunk(PLAIN, ch.where, ''))
@@ -1435,7 +1434,7 @@ def changeit(buf, pp):
14351434
pp.insert(i, chunk(PLAIN, ch.where, ''))
14361435
i, length = i+1, length+1
14371436
length, i = do_datadesc(length, buf, pp, i,
1438-
envname=="datadesc")
1437+
envname[-2:] != "ni")
14391438

14401439
elif envname == 'opcodedesc':
14411440
pp.insert(i, chunk(PLAIN, ch.where, ''))
@@ -1472,7 +1471,7 @@ def changeit(buf, pp):
14721471
chunk(GROUP, ch.where, [
14731472
chunk(PLAIN, ch.where, 'example')])]
14741473
i, length = i+2, length+2
1475-
elif envname in ('itemize', 'list'):
1474+
elif envname in ('itemize', 'list', 'fulllineitems'):
14761475
hist.itemizenesting = hist.itemizenesting - 1
14771476
pp[i:i] = [chunk(CSLINE, ch.where, 'end'),
14781477
chunk(GROUP, ch.where, [
@@ -1497,7 +1496,7 @@ def changeit(buf, pp):
14971496
pp.insert(i, chunk(DENDLINE, ch.where, '\n'))
14981497
i, length = i+1, length+1
14991498

1500-
elif envname in ('funcdesc', 'excdesc', 'datadesc',
1499+
elif envname in ('funcdesc', 'excdesc', 'datadesc', 'classdesc',
15011500
'funcdescni', 'datadescni'):
15021501
pp[i:i] = [chunk(CSLINE, ch.where, 'end'),
15031502
chunk(GROUP, ch.where, [
@@ -1597,10 +1596,6 @@ def changeit(buf, pp):
15971596
elif s_buf_data == 'program':
15981597
ch.data = "strong"
15991598

1600-
elif s_buf_data == "fulllineitems":
1601-
del pp[i-1]
1602-
i, length = i-1, length-1
1603-
16041599
elif s_buf_data == 'item':
16051600
ch.chtype = chunk_type[CSLINE]
16061601
length, newi = getoptarg(length, buf, pp, i)
@@ -2093,7 +2088,7 @@ def changeit(buf, pp):
20932088

20942089
elif s_buf_data in ('url', 'module', 'function', 'cfunction',
20952090
'keyword', 'method', 'exception', 'constant',
2096-
'email', 'class'):
2091+
'email', 'class', 'member', 'cdata', 'ctype'):
20972092
ch.data = "code"
20982093

20992094
elif s_buf_data == 'label':

0 commit comments

Comments
 (0)