Debian Codegraph @

tests/snippets/python/test_pep_515.txt

raw
1 # Tests that the lexer can parse numeric literals with underscores
2
3 ---input---
4 1_000_000
5 1_000.000_001
6 1_000e1_000j
7 0xCAFE_F00D
8 0b_0011_1111_0100_1110
9 0o_777_123
10
11 ---tokens---
12 '1_000_000' Literal.Number.Integer
13 '\n' Text.Whitespace
14
15 '1_000.000_001' Literal.Number.Float
16 '\n' Text.Whitespace
17
18 '1_000e1_000j' Literal.Number.Float
19 '\n' Text.Whitespace
20
21 '0xCAFE_F00D' Literal.Number.Hex
22 '\n' Text.Whitespace
23
24 '0b_0011_1111_0100_1110' Literal.Number.Bin
25 '\n' Text.Whitespace
26
27 '0o_777_123' Literal.Number.Oct
28 '\n' Text.Whitespace