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
5aa47443
Kaydet (Commit)
5aa47443
authored
Eki 10, 2014
tarafından
Serhiy Storchaka
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Issue #22584: Got rid of character tables in _sre.c and use standard macros
Py_TOLOWER, Py_ISSPACE, etc.
üst
7438e4b5
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
34 deletions
+6
-34
_sre.c
Modules/_sre.c
+6
-34
No files found.
Modules/_sre.c
Dosyayı görüntüle @
5aa47443
...
@@ -97,48 +97,20 @@ static char copyright[] =
...
@@ -97,48 +97,20 @@ static char copyright[] =
/* -------------------------------------------------------------------- */
/* -------------------------------------------------------------------- */
/* search engine state */
/* search engine state */
/* default character predicates (run sre_chars.py to regenerate tables) */
#define SRE_DIGIT_MASK 1
#define SRE_SPACE_MASK 2
#define SRE_LINEBREAK_MASK 4
#define SRE_ALNUM_MASK 8
#define SRE_WORD_MASK 16
/* FIXME: this assumes ASCII. create tables in init_sre() instead */
static
char
sre_char_info
[
128
]
=
{
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
2
,
6
,
2
,
2
,
2
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
2
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
25
,
25
,
25
,
25
,
25
,
25
,
25
,
25
,
25
,
25
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
24
,
24
,
24
,
24
,
24
,
24
,
24
,
24
,
24
,
24
,
24
,
24
,
24
,
24
,
24
,
24
,
24
,
24
,
24
,
24
,
24
,
24
,
24
,
24
,
24
,
24
,
0
,
0
,
0
,
0
,
16
,
0
,
24
,
24
,
24
,
24
,
24
,
24
,
24
,
24
,
24
,
24
,
24
,
24
,
24
,
24
,
24
,
24
,
24
,
24
,
24
,
24
,
24
,
24
,
24
,
24
,
24
,
24
,
0
,
0
,
0
,
0
,
0
};
static
char
sre_char_lower
[
128
]
=
{
0
,
1
,
2
,
3
,
4
,
5
,
6
,
7
,
8
,
9
,
10
,
11
,
12
,
13
,
14
,
15
,
16
,
17
,
18
,
19
,
20
,
21
,
22
,
23
,
24
,
25
,
26
,
27
,
28
,
29
,
30
,
31
,
32
,
33
,
34
,
35
,
36
,
37
,
38
,
39
,
40
,
41
,
42
,
43
,
44
,
45
,
46
,
47
,
48
,
49
,
50
,
51
,
52
,
53
,
54
,
55
,
56
,
57
,
58
,
59
,
60
,
61
,
62
,
63
,
64
,
97
,
98
,
99
,
100
,
101
,
102
,
103
,
104
,
105
,
106
,
107
,
108
,
109
,
110
,
111
,
112
,
113
,
114
,
115
,
116
,
117
,
118
,
119
,
120
,
121
,
122
,
91
,
92
,
93
,
94
,
95
,
96
,
97
,
98
,
99
,
100
,
101
,
102
,
103
,
104
,
105
,
106
,
107
,
108
,
109
,
110
,
111
,
112
,
113
,
114
,
115
,
116
,
117
,
118
,
119
,
120
,
121
,
122
,
123
,
124
,
125
,
126
,
127
};
#define SRE_IS_DIGIT(ch)\
#define SRE_IS_DIGIT(ch)\
((ch) < 128
? (sre_char_info[(ch)] & SRE_DIGIT_MASK) : 0
)
((ch) < 128
&& Py_ISDIGIT(ch)
)
#define SRE_IS_SPACE(ch)\
#define SRE_IS_SPACE(ch)\
((ch) < 128
? (sre_char_info[(ch)] & SRE_SPACE_MASK) : 0
)
((ch) < 128
&& Py_ISSPACE(ch)
)
#define SRE_IS_LINEBREAK(ch)\
#define SRE_IS_LINEBREAK(ch)\
((ch)
< 128 ? (sre_char_info[(ch)] & SRE_LINEBREAK_MASK) : 0
)
((ch)
== '\n'
)
#define SRE_IS_ALNUM(ch)\
#define SRE_IS_ALNUM(ch)\
((ch) < 128
? (sre_char_info[(ch)] & SRE_ALNUM_MASK) : 0
)
((ch) < 128
&& Py_ISALNUM(ch)
)
#define SRE_IS_WORD(ch)\
#define SRE_IS_WORD(ch)\
((ch) < 128
? (sre_char_info[(ch)] & SRE_WORD_MASK) : 0
)
((ch) < 128
&& (Py_ISALNUM(ch) || (ch) == '_')
)
static
unsigned
int
sre_lower
(
unsigned
int
ch
)
static
unsigned
int
sre_lower
(
unsigned
int
ch
)
{
{
return
((
ch
)
<
128
?
(
unsigned
int
)
sre_char_lower
[
ch
]
:
ch
);
return
((
ch
)
<
128
?
Py_TOLOWER
(
ch
)
:
ch
);
}
}
/* locale-specific character predicates */
/* locale-specific character predicates */
...
...
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