Commit 4cbfcae3 authored by Rob Pike's avatar Rob Pike

add unicode data for decimal digit, preparatory to allowing them in identifiers.

R=rsc
DELTA=431  (430 added, 0 deleted, 1 changed)
OCL=25975
CL=26059
parent 6906e3b8
......@@ -34,16 +34,24 @@ coverage: packages
O1=\
letter.$O\
unicode.a: a1
O2=\
decimaldigit.$O\
unicode.a: a1 a2
a1: $(O1)
$(AR) grc unicode.a letter.$O
rm -f $(O1)
a2: $(O2)
$(AR) grc unicode.a decimaldigit.$O
rm -f $(O2)
newpkg: clean
$(AR) grc unicode.a
$(O1): newpkg
$(O2): a1
nuke: clean
rm -f $(GOROOT)/pkg/unicode.a
......
// 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.
import "unicode"
// 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);
}
This diff is collapsed.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment