summaryrefslogtreecommitdiff
path: root/src/pkg/unicode/decimaldigit.go
blob: ab65b433d4f7d5b324c34d45cb777070b77d4fb3 (plain)
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
// Copyright 2009 The Go Authors. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.

package unicode

// TODO: Generated by hand starting with
// http://www.unicode.org/Public/UNIDATA/UnicodeData.txt
// These ranges are the characters with the third field "Nd".
// Should generate automatically etc.

// Decimal digit is the set of Unicode characters with the "decimal digit" property.
var DecimalDigit = []Range{
	Range{0x0030, 0x0039, 1},
	Range{0x0660, 0x0669, 1},
	Range{0x06F0, 0x06F9, 1},
	Range{0x07C0, 0x07C9, 1},
	Range{0x0966, 0x096F, 1},
	Range{0x09E6, 0x09EF, 1},
	Range{0x0A66, 0x0A6F, 1},
	Range{0x0AE6, 0x0AEF, 1},
	Range{0x0B66, 0x0B6F, 1},
	Range{0x0BE6, 0x0BEF, 1},
	Range{0x0C66, 0x0C6F, 1},
	Range{0x0CE6, 0x0CEF, 1},
	Range{0x0D66, 0x0D6F, 1},
	Range{0x0E50, 0x0E59, 1},
	Range{0x0ED0, 0x0ED9, 1},
	Range{0x0F20, 0x0F29, 1},
	Range{0x1040, 0x1049, 1},
	Range{0x1090, 0x1099, 1},
	Range{0x17E0, 0x17E9, 1},
	Range{0x1810, 0x1819, 1},
	Range{0x1946, 0x194F, 1},
	Range{0x19D0, 0x19D9, 1},
	Range{0x1B50, 0x1B59, 1},
	Range{0x1BB0, 0x1BB9, 1},
	Range{0x1C40, 0x1C49, 1},
	Range{0x1C50, 0x1C59, 1},
	Range{0xA620, 0xA629, 1},
	Range{0xA8D0, 0xA8D9, 1},
	Range{0xA900, 0xA909, 1},
	Range{0xAA50, 0xAA59, 1},
	Range{0xFF10, 0xFF19, 1},
}

// IsDecimalDigit reports whether the rune is a decimal digit.
func IsDecimalDigit(rune int) bool {
	return Is(DecimalDigit, rune);
}