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
c08cb04c
Kaydet (Commit)
c08cb04c
authored
Tem 01, 2000
tarafından
Guido van Rossum
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
the usual
üst
880066a9
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
14 additions
and
12 deletions
+14
-12
sre_comp.py
Lib/dos-8x3/sre_comp.py
+3
-3
sre_pars.py
Lib/dos-8x3/sre_pars.py
+11
-9
No files found.
Lib/dos-8x3/sre_comp.py
Dosyayı görüntüle @
c08cb04c
...
...
@@ -39,7 +39,7 @@ def _compile(code, pattern, flags):
return
_sre
.
getlower
(
literal
,
flags
)
else
:
emit
(
OPCODES
[
op
])
fixup
=
lambda
x
:
x
fixup
=
lambda
x
:
x
skip
=
len
(
code
);
emit
(
0
)
for
op
,
av
in
av
:
emit
(
OPCODES
[
op
])
...
...
@@ -118,7 +118,7 @@ def _compile(code, pattern, flags):
elif
op
is
AT
:
emit
(
OPCODES
[
op
])
if
flags
&
SRE_FLAG_MULTILINE
:
emit
(
ATCODES
[
AT_MULTILINE
[
av
]
])
emit
(
ATCODES
[
AT_MULTILINE
.
get
(
av
,
av
)
])
else
:
emit
(
ATCODES
[
av
])
elif
op
is
BRANCH
:
...
...
@@ -203,7 +203,7 @@ def compile(p, flags=0):
if
type
(
p
)
in
(
type
(
""
),
type
(
u""
)):
import
sre_parse
pattern
=
p
p
=
sre_parse
.
parse
(
p
)
p
=
sre_parse
.
parse
(
p
,
flags
)
else
:
pattern
=
None
...
...
Lib/dos-8x3/sre_pars.py
Dosyayı görüntüle @
c08cb04c
...
...
@@ -19,8 +19,9 @@ from sre_constants import *
# FIXME: should be 65535, but the arraymodule is still broken
MAXREPEAT
=
32767
# FIXME: same here
CHARMASK
=
0x7fff
# FIXME: might change in 2.0 final. but for now, this seems
# to be the best way to be compatible with 1.5.2
CHARMASK
=
0xff
SPECIAL_CHARS
=
".
\\
[{()*+?^$|"
REPEAT_CHARS
=
"*+?{"
...
...
@@ -30,7 +31,7 @@ DIGITS = tuple(string.digits)
OCTDIGITS
=
tuple
(
"01234567"
)
HEXDIGITS
=
tuple
(
"0123456789abcdefABCDEF"
)
WHITESPACE
=
string
.
whitespace
WHITESPACE
=
tuple
(
string
.
whitespace
)
ESCAPES
=
{
r"\a"
:
(
LITERAL
,
7
),
...
...
@@ -295,7 +296,7 @@ def _branch(pattern, items):
subpattern
.
append
((
BRANCH
,
(
None
,
items
)))
return
subpattern
def
_parse
(
source
,
state
,
flags
=
0
):
def
_parse
(
source
,
state
):
# parse regular expression pattern into an operator list.
...
...
@@ -467,7 +468,7 @@ def _parse(source, state, flags=0):
char
=
source
.
get
()
b
=
[]
while
1
:
p
=
_parse
(
source
,
state
,
flags
)
p
=
_parse
(
source
,
state
)
if
source
.
next
==
")"
:
if
b
:
b
.
append
(
p
)
...
...
@@ -494,7 +495,7 @@ def _parse(source, state, flags=0):
else
:
group
=
state
.
getgroup
(
name
)
while
1
:
p
=
_parse
(
source
,
state
,
flags
)
p
=
_parse
(
source
,
state
)
if
source
.
match
(
")"
):
if
b
:
b
.
append
(
p
)
...
...
@@ -531,9 +532,10 @@ def parse(pattern, flags=0):
# parse 're' pattern into list of (opcode, argument) tuples
source
=
Tokenizer
(
pattern
)
state
=
State
()
state
.
flags
=
flags
b
=
[]
while
1
:
p
=
_parse
(
source
,
state
,
flags
)
p
=
_parse
(
source
,
state
)
tail
=
source
.
get
()
if
tail
==
"|"
:
b
.
append
(
p
)
...
...
@@ -616,9 +618,9 @@ def expand_template(template, match):
a
=
p
.
append
sep
=
match
.
string
[:
0
]
if
type
(
sep
)
is
type
(
""
):
char
=
chr
char
=
chr
else
:
char
=
unichr
char
=
unichr
for
c
,
s
in
template
:
if
c
is
LITERAL
:
a
(
char
(
s
))
...
...
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