File: test_pep_515.txt

package info (click to toggle)
pygments 2.14.0%2Bdfsg-1
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 8,496 kB
  • sloc: python: 96,379; javascript: 238; makefile: 191; sh: 80; lisp: 74
file content (28 lines) | stat: -rw-r--r-- 582 bytes parent folder | download | duplicates (2)
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
# Tests that the lexer can parse numeric literals with underscores

---input---
1_000_000
1_000.000_001
1_000e1_000j
0xCAFE_F00D
0b_0011_1111_0100_1110
0o_777_123

---tokens---
'1_000_000'   Literal.Number.Integer
'\n'          Text.Whitespace

'1_000.000_001' Literal.Number.Float
'\n'          Text.Whitespace

'1_000e1_000j' Literal.Number.Float
'\n'          Text.Whitespace

'0xCAFE_F00D' Literal.Number.Hex
'\n'          Text.Whitespace

'0b_0011_1111_0100_1110' Literal.Number.Bin
'\n'          Text.Whitespace

'0o_777_123'  Literal.Number.Oct
'\n'          Text.Whitespace