Skip to content

Commit 49aca48

Browse files
committed
Update Tools/build/generate_token.py for token.py
1 parent 1637c04 commit 49aca48

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

Tools/build/generate_token.py

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -269,14 +269,15 @@ def make_rst(infile, outfile='Doc/library/token-list.inc',
269269
# Special definitions for cooperation with parser
270270
NT_OFFSET = %d
271271
272-
tok_name = {value: name
273-
for name, value in globals().items()
274-
if isinstance(value, int) and not name.startswith('_')}
272+
tok_name = frozendict({
273+
value: name
274+
for name, value in globals().items()
275+
if isinstance(value, int) and not name.startswith('_')})
275276
__all__.extend(tok_name.values())
276277
277-
EXACT_TOKEN_TYPES = {
278+
EXACT_TOKEN_TYPES = frozendict({
278279
%s
279-
}
280+
})
280281
281282
def ISTERMINAL(x: int) -> bool:
282283
return x < NT_OFFSET

0 commit comments

Comments
 (0)