Skip to content
Projeler
Gruplar
Parçacıklar
Yardım
Yükleniyor...
Oturum aç / Kaydol
Gezinmeyi değiştir
C
cpython
Proje
Proje
Ayrıntılar
Etkinlik
Cycle Analytics
Depo (repository)
Depo (repository)
Dosyalar
Kayıtlar (commit)
Dallar (branch)
Etiketler
Katkıda bulunanlar
Grafik
Karşılaştır
Grafikler
Konular (issue)
0
Konular (issue)
0
Liste
Pano
Etiketler
Kilometre Taşları
Birleştirme (merge) Talepleri
0
Birleştirme (merge) Talepleri
0
CI / CD
CI / CD
İş akışları (pipeline)
İşler
Zamanlamalar
Grafikler
Paketler
Paketler
Wiki
Wiki
Parçacıklar
Parçacıklar
Üyeler
Üyeler
Collapse sidebar
Close sidebar
Etkinlik
Grafik
Grafikler
Yeni bir konu (issue) oluştur
İşler
Kayıtlar (commit)
Konu (issue) Panoları
Kenar çubuğunu aç
Batuhan Osman TASKAYA
cpython
Commits
f79acbda
Kaydet (Commit)
f79acbda
authored
May 07, 1999
tarafından
Fred Drake
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Fix some bugs introduced in the previous checkin.
üst
96c00b0b
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
13 additions
and
9 deletions
+13
-9
latex2esis.py
Doc/tools/sgmlconv/latex2esis.py
+13
-9
No files found.
Doc/tools/sgmlconv/latex2esis.py
Dosyayı görüntüle @
f79acbda
...
...
@@ -41,13 +41,15 @@ _start_optional_rx = re.compile("[ \n]*[[]")
ESCAPED_CHARS
=
"$
%#
^ {}&~"
def
pushing
(
name
,
point
,
depth
):
def
dbgmsg
(
msg
):
if
DEBUG
:
sys
.
stderr
.
write
(
"
%
s<
%
s> at
%
s
\n
"
%
(
" "
*
depth
,
name
,
point
))
sys
.
stderr
.
write
(
msg
+
"
\n
"
)
def
pushing
(
name
,
point
,
depth
):
dbgmsg
(
"
%
s<
%
s> at
%
s"
%
(
" "
*
depth
,
name
,
point
))
def
popping
(
name
,
point
,
depth
):
if
DEBUG
:
sys
.
stderr
.
write
(
"
%
s</
%
s> at
%
s
\n
"
%
(
" "
*
depth
,
name
,
point
))
dbgmsg
(
"
%
s</
%
s> at
%
s"
%
(
" "
*
depth
,
name
,
point
))
class
Conversion
:
...
...
@@ -71,11 +73,11 @@ class Conversion:
self
.
write
=
self
.
ofp
.
write
def
subconvert
(
self
,
endchar
=
None
,
depth
=
0
):
stack
=
[]
line
=
self
.
line
if
DEBUG
and
endchar
:
self
.
err_write
(
"subconvert(
%
s)
\n
line =
%
s
\n
"
%
(
`endchar`
,
`line[:20]`
))
stack
=
[]
line
=
self
.
line
while
line
:
if
line
[
0
]
==
endchar
and
not
stack
:
if
DEBUG
:
...
...
@@ -108,7 +110,7 @@ class Conversion:
# should be more careful, but this is easier to code:
stack
=
[]
self
.
write
(
")document
\n
"
)
elif
envname
==
stack
[
-
1
]:
elif
stack
and
envname
==
stack
[
-
1
]:
self
.
write
(
")
%
s
\n
"
%
envname
)
del
stack
[
-
1
]
popping
(
envname
,
"a"
,
len
(
stack
)
+
depth
)
...
...
@@ -203,7 +205,7 @@ class Conversion:
if
m
:
line
=
line
[
m
.
end
():]
elif
type
(
attrname
)
is
type
([]):
# A normal subelement.
# A normal subelement
: <macroname><attrname>...</>..
.
attrname
=
attrname
[
0
]
if
not
opened
:
opened
=
1
...
...
@@ -212,7 +214,8 @@ class Conversion:
self
.
write
(
"(
%
s
\n
"
%
attrname
)
pushing
(
attrname
,
"sub-elem"
,
len
(
stack
)
+
depth
+
1
)
self
.
line
=
skip_white
(
line
)[
1
:]
line
=
subconvert
(
"}"
,
depth
+
len
(
stack
)
+
2
)
line
=
self
.
subconvert
(
"}"
,
len
(
stack
)
+
depth
+
1
)[
1
:]
dbgmsg
(
"subconvert() ==> "
+
`line[:20]`
)
popping
(
attrname
,
"sub-elem"
,
len
(
stack
)
+
depth
+
1
)
self
.
write
(
")
%
s
\n
"
%
attrname
)
else
:
...
...
@@ -376,6 +379,7 @@ def main():
"item"
:
([(
"leader"
,)],
1
,
0
,
0
,
0
),
"label"
:
([
"id"
],
0
,
1
,
0
,
0
),
"labelwidth"
:
([],
0
,
1
,
0
,
0
),
"large"
:
([],
0
,
1
,
0
,
0
),
"LaTeX"
:
([],
0
,
1
,
0
,
0
),
"leftmargin"
:
([],
0
,
1
,
0
,
0
),
"leq"
:
([],
0
,
1
,
0
,
0
),
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment