Skip to content

Commit 9262aa4

Browse files
committed
[GR-34991][GR-28411] Implement pyexpat module
PullRequest: graalpython/2029
2 parents b92c34b + 330253a commit 9262aa4

File tree

46 files changed

+17419
-261
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

46 files changed

+17419
-261
lines changed

CHANGELOG.md

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,13 @@
33
This changelog summarizes major changes between GraalVM versions of the Python
44
language runtime. The main focus is on user-observable behavior of the engine.
55

6+
## Version 22.0.0
7+
* Added support for `pyexpat` module.
8+
* Added partial support for `PYTHONHASHSEED` environment variable (also available via `HashSeed` context option), currently only affecting hashing in `pyexpat` module.
9+
610
## Version 21.3.0
711

8-
* Remove PYPY_VERSION from our C extension emulation, enabling PyGame 2.0 and other extensions to work out of the box.
12+
* Remove `PYPY_VERSION` from our C extension emulation, enabling PyGame 2.0 and other extensions to work out of the box.
913
* Intrinsify and optimize more of the core language for better startup and reduced footprint.
1014
* Implement a new binary compatible backend for HPy 0.0.3, which allows binary HPy wheels to run unmodified on CPython and GraalPython
1115
* Support the `multiprocessing` module via in-process nested contexts, allowing execution on multiple cores within the same process using the Python multiprocessing API

docs/contributor/MISSING.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@ This is just a snapshot as of 2021-07-29.
1717
* **nis**: We should just use the C module
1818
* **syslog**: Access to syslog. We should probably just use this from the C module.
1919
* **termios**: Posix terminal module IO. Use from C
20-
* **pyexpat**: We only have a stub in Java. Should use from C.
2120

2221
#### These are not strictly needed for now
2322
* **_abc**: Just a performance optimization, not necessary.
Lines changed: 120 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,120 @@
1+
/*
2+
__ __ _
3+
___\ \/ /_ __ __ _| |_
4+
/ _ \\ /| '_ \ / _` | __|
5+
| __// \| |_) | (_| | |_
6+
\___/_/\_\ .__/ \__,_|\__|
7+
|_| XML parser
8+
9+
Copyright (c) 1997-2000 Thai Open Source Software Center Ltd
10+
Copyright (c) 2000-2017 Expat development team
11+
Licensed under the MIT license:
12+
13+
Permission is hereby granted, free of charge, to any person obtaining
14+
a copy of this software and associated documentation files (the
15+
"Software"), to deal in the Software without restriction, including
16+
without limitation the rights to use, copy, modify, merge, publish,
17+
distribute, sublicense, and/or sell copies of the Software, and to permit
18+
persons to whom the Software is furnished to do so, subject to the
19+
following conditions:
20+
21+
The above copyright notice and this permission notice shall be included
22+
in all copies or substantial portions of the Software.
23+
24+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
25+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
26+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN
27+
NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
28+
DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
29+
OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
30+
USE OR OTHER DEALINGS IN THE SOFTWARE.
31+
*/
32+
33+
#define ASCII_A 0x41
34+
#define ASCII_B 0x42
35+
#define ASCII_C 0x43
36+
#define ASCII_D 0x44
37+
#define ASCII_E 0x45
38+
#define ASCII_F 0x46
39+
#define ASCII_G 0x47
40+
#define ASCII_H 0x48
41+
#define ASCII_I 0x49
42+
#define ASCII_J 0x4A
43+
#define ASCII_K 0x4B
44+
#define ASCII_L 0x4C
45+
#define ASCII_M 0x4D
46+
#define ASCII_N 0x4E
47+
#define ASCII_O 0x4F
48+
#define ASCII_P 0x50
49+
#define ASCII_Q 0x51
50+
#define ASCII_R 0x52
51+
#define ASCII_S 0x53
52+
#define ASCII_T 0x54
53+
#define ASCII_U 0x55
54+
#define ASCII_V 0x56
55+
#define ASCII_W 0x57
56+
#define ASCII_X 0x58
57+
#define ASCII_Y 0x59
58+
#define ASCII_Z 0x5A
59+
60+
#define ASCII_a 0x61
61+
#define ASCII_b 0x62
62+
#define ASCII_c 0x63
63+
#define ASCII_d 0x64
64+
#define ASCII_e 0x65
65+
#define ASCII_f 0x66
66+
#define ASCII_g 0x67
67+
#define ASCII_h 0x68
68+
#define ASCII_i 0x69
69+
#define ASCII_j 0x6A
70+
#define ASCII_k 0x6B
71+
#define ASCII_l 0x6C
72+
#define ASCII_m 0x6D
73+
#define ASCII_n 0x6E
74+
#define ASCII_o 0x6F
75+
#define ASCII_p 0x70
76+
#define ASCII_q 0x71
77+
#define ASCII_r 0x72
78+
#define ASCII_s 0x73
79+
#define ASCII_t 0x74
80+
#define ASCII_u 0x75
81+
#define ASCII_v 0x76
82+
#define ASCII_w 0x77
83+
#define ASCII_x 0x78
84+
#define ASCII_y 0x79
85+
#define ASCII_z 0x7A
86+
87+
#define ASCII_0 0x30
88+
#define ASCII_1 0x31
89+
#define ASCII_2 0x32
90+
#define ASCII_3 0x33
91+
#define ASCII_4 0x34
92+
#define ASCII_5 0x35
93+
#define ASCII_6 0x36
94+
#define ASCII_7 0x37
95+
#define ASCII_8 0x38
96+
#define ASCII_9 0x39
97+
98+
#define ASCII_TAB 0x09
99+
#define ASCII_SPACE 0x20
100+
#define ASCII_EXCL 0x21
101+
#define ASCII_QUOT 0x22
102+
#define ASCII_AMP 0x26
103+
#define ASCII_APOS 0x27
104+
#define ASCII_MINUS 0x2D
105+
#define ASCII_PERIOD 0x2E
106+
#define ASCII_COLON 0x3A
107+
#define ASCII_SEMI 0x3B
108+
#define ASCII_LT 0x3C
109+
#define ASCII_EQUALS 0x3D
110+
#define ASCII_GT 0x3E
111+
#define ASCII_LSQB 0x5B
112+
#define ASCII_RSQB 0x5D
113+
#define ASCII_UNDERSCORE 0x5F
114+
#define ASCII_LPAREN 0x28
115+
#define ASCII_RPAREN 0x29
116+
#define ASCII_FF 0x0C
117+
#define ASCII_SLASH 0x2F
118+
#define ASCII_HASH 0x23
119+
#define ASCII_PIPE 0x7C
120+
#define ASCII_COMMA 0x2C
Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
/*
2+
__ __ _
3+
___\ \/ /_ __ __ _| |_
4+
/ _ \\ /| '_ \ / _` | __|
5+
| __// \| |_) | (_| | |_
6+
\___/_/\_\ .__/ \__,_|\__|
7+
|_| XML parser
8+
9+
Copyright (c) 1997-2000 Thai Open Source Software Center Ltd
10+
Copyright (c) 2000-2017 Expat development team
11+
Licensed under the MIT license:
12+
13+
Permission is hereby granted, free of charge, to any person obtaining
14+
a copy of this software and associated documentation files (the
15+
"Software"), to deal in the Software without restriction, including
16+
without limitation the rights to use, copy, modify, merge, publish,
17+
distribute, sublicense, and/or sell copies of the Software, and to permit
18+
persons to whom the Software is furnished to do so, subject to the
19+
following conditions:
20+
21+
The above copyright notice and this permission notice shall be included
22+
in all copies or substantial portions of the Software.
23+
24+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
25+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
26+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN
27+
NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
28+
DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
29+
OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
30+
USE OR OTHER DEALINGS IN THE SOFTWARE.
31+
*/
32+
33+
/* 0x00 */ BT_NONXML, BT_NONXML, BT_NONXML, BT_NONXML,
34+
/* 0x04 */ BT_NONXML, BT_NONXML, BT_NONXML, BT_NONXML,
35+
/* 0x08 */ BT_NONXML, BT_S, BT_LF, BT_NONXML,
36+
/* 0x0C */ BT_NONXML, BT_CR, BT_NONXML, BT_NONXML,
37+
/* 0x10 */ BT_NONXML, BT_NONXML, BT_NONXML, BT_NONXML,
38+
/* 0x14 */ BT_NONXML, BT_NONXML, BT_NONXML, BT_NONXML,
39+
/* 0x18 */ BT_NONXML, BT_NONXML, BT_NONXML, BT_NONXML,
40+
/* 0x1C */ BT_NONXML, BT_NONXML, BT_NONXML, BT_NONXML,
41+
/* 0x20 */ BT_S, BT_EXCL, BT_QUOT, BT_NUM,
42+
/* 0x24 */ BT_OTHER, BT_PERCNT, BT_AMP, BT_APOS,
43+
/* 0x28 */ BT_LPAR, BT_RPAR, BT_AST, BT_PLUS,
44+
/* 0x2C */ BT_COMMA, BT_MINUS, BT_NAME, BT_SOL,
45+
/* 0x30 */ BT_DIGIT, BT_DIGIT, BT_DIGIT, BT_DIGIT,
46+
/* 0x34 */ BT_DIGIT, BT_DIGIT, BT_DIGIT, BT_DIGIT,
47+
/* 0x38 */ BT_DIGIT, BT_DIGIT, BT_COLON, BT_SEMI,
48+
/* 0x3C */ BT_LT, BT_EQUALS, BT_GT, BT_QUEST,
49+
/* 0x40 */ BT_OTHER, BT_HEX, BT_HEX, BT_HEX,
50+
/* 0x44 */ BT_HEX, BT_HEX, BT_HEX, BT_NMSTRT,
51+
/* 0x48 */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_NMSTRT,
52+
/* 0x4C */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_NMSTRT,
53+
/* 0x50 */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_NMSTRT,
54+
/* 0x54 */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_NMSTRT,
55+
/* 0x58 */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_LSQB,
56+
/* 0x5C */ BT_OTHER, BT_RSQB, BT_OTHER, BT_NMSTRT,
57+
/* 0x60 */ BT_OTHER, BT_HEX, BT_HEX, BT_HEX,
58+
/* 0x64 */ BT_HEX, BT_HEX, BT_HEX, BT_NMSTRT,
59+
/* 0x68 */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_NMSTRT,
60+
/* 0x6C */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_NMSTRT,
61+
/* 0x70 */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_NMSTRT,
62+
/* 0x74 */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_NMSTRT,
63+
/* 0x78 */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_OTHER,
64+
/* 0x7C */ BT_VERBAR, BT_OTHER, BT_OTHER, BT_OTHER,

0 commit comments

Comments
 (0)