From 71b2e367112fd4333577e29b96cc981e26890808 Mon Sep 17 00:00:00 2001 From: Rob Pike Date: Wed, 26 Aug 2009 16:53:07 -0700 Subject: change IsDecimalDigit to IsDigit because Decimal is redundant R=rsc DELTA=792 (398 added, 383 deleted, 11 changed) OCL=33919 CL=33921 --- src/pkg/go/scanner/scanner.go | 2 +- src/pkg/unicode/Makefile | 2 +- src/pkg/unicode/decimaldigit.go | 10 - src/pkg/unicode/decimaldigit_test.go | 372 ----------------------------------- src/pkg/unicode/digit.go | 13 ++ src/pkg/unicode/digit_test.go | 372 +++++++++++++++++++++++++++++++++++ src/pkg/unicode/digittables.go | 8 +- src/pkg/unicode/letter.go | 16 +- src/pkg/unicode/maketables.go | 8 +- 9 files changed, 409 insertions(+), 394 deletions(-) delete mode 100644 src/pkg/unicode/decimaldigit.go delete mode 100644 src/pkg/unicode/decimaldigit_test.go create mode 100644 src/pkg/unicode/digit.go create mode 100644 src/pkg/unicode/digit_test.go (limited to 'src') diff --git a/src/pkg/go/scanner/scanner.go b/src/pkg/go/scanner/scanner.go index 9a040aa6c..c4a5ad838 100644 --- a/src/pkg/go/scanner/scanner.go +++ b/src/pkg/go/scanner/scanner.go @@ -188,7 +188,7 @@ func isLetter(ch int) bool { func isDigit(ch int) bool { return '0' <= ch && ch <= '9' || - ch >= 0x80 && unicode.IsDecimalDigit(ch); + ch >= 0x80 && unicode.IsDigit(ch); } diff --git a/src/pkg/unicode/Makefile b/src/pkg/unicode/Makefile index da3183039..717af36af 100644 --- a/src/pkg/unicode/Makefile +++ b/src/pkg/unicode/Makefile @@ -6,7 +6,7 @@ include $(GOROOT)/src/Make.$(GOARCH) TARG=unicode GOFILES=\ - decimaldigit.go\ + digit.go\ digittables.go\ letter.go\ lettertables.go\ diff --git a/src/pkg/unicode/decimaldigit.go b/src/pkg/unicode/decimaldigit.go deleted file mode 100644 index b6b438812..000000000 --- a/src/pkg/unicode/decimaldigit.go +++ /dev/null @@ -1,10 +0,0 @@ -// 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 - -// IsDecimalDigit reports whether the rune is a decimal digit. -func IsDecimalDigit(rune int) bool { - return Is(DecimalDigit, rune); -} diff --git a/src/pkg/unicode/decimaldigit_test.go b/src/pkg/unicode/decimaldigit_test.go deleted file mode 100644 index 05d75b4b2..000000000 --- a/src/pkg/unicode/decimaldigit_test.go +++ /dev/null @@ -1,372 +0,0 @@ -// 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 - -import "testing" - -// To get data: -// grep '^....;[^;]*;Nd;' UnicodeData.txt -// To generate this table: -// ,s/([^;]+).+/ 0x\1, \/\/ &/g -var testDecimal = []int{ - 0x0030, // 0030;DIGIT ZERO;Nd;0;EN;;0;0;0;N;;;;; - 0x0031, // 0031;DIGIT ONE;Nd;0;EN;;1;1;1;N;;;;; - 0x0032, // 0032;DIGIT TWO;Nd;0;EN;;2;2;2;N;;;;; - 0x0033, // 0033;DIGIT THREE;Nd;0;EN;;3;3;3;N;;;;; - 0x0034, // 0034;DIGIT FOUR;Nd;0;EN;;4;4;4;N;;;;; - 0x0035, // 0035;DIGIT FIVE;Nd;0;EN;;5;5;5;N;;;;; - 0x0036, // 0036;DIGIT SIX;Nd;0;EN;;6;6;6;N;;;;; - 0x0037, // 0037;DIGIT SEVEN;Nd;0;EN;;7;7;7;N;;;;; - 0x0038, // 0038;DIGIT EIGHT;Nd;0;EN;;8;8;8;N;;;;; - 0x0039, // 0039;DIGIT NINE;Nd;0;EN;;9;9;9;N;;;;; - 0x0660, // 0660;ARABIC-INDIC DIGIT ZERO;Nd;0;AN;;0;0;0;N;;;;; - 0x0661, // 0661;ARABIC-INDIC DIGIT ONE;Nd;0;AN;;1;1;1;N;;;;; - 0x0662, // 0662;ARABIC-INDIC DIGIT TWO;Nd;0;AN;;2;2;2;N;;;;; - 0x0663, // 0663;ARABIC-INDIC DIGIT THREE;Nd;0;AN;;3;3;3;N;;;;; - 0x0664, // 0664;ARABIC-INDIC DIGIT FOUR;Nd;0;AN;;4;4;4;N;;;;; - 0x0665, // 0665;ARABIC-INDIC DIGIT FIVE;Nd;0;AN;;5;5;5;N;;;;; - 0x0666, // 0666;ARABIC-INDIC DIGIT SIX;Nd;0;AN;;6;6;6;N;;;;; - 0x0667, // 0667;ARABIC-INDIC DIGIT SEVEN;Nd;0;AN;;7;7;7;N;;;;; - 0x0668, // 0668;ARABIC-INDIC DIGIT EIGHT;Nd;0;AN;;8;8;8;N;;;;; - 0x0669, // 0669;ARABIC-INDIC DIGIT NINE;Nd;0;AN;;9;9;9;N;;;;; - 0x06F0, // 06F0;EXTENDED ARABIC-INDIC DIGIT ZERO;Nd;0;EN;;0;0;0;N;EASTERN ARABIC-INDIC DIGIT ZERO;;;; - 0x06F1, // 06F1;EXTENDED ARABIC-INDIC DIGIT ONE;Nd;0;EN;;1;1;1;N;EASTERN ARABIC-INDIC DIGIT ONE;;;; - 0x06F2, // 06F2;EXTENDED ARABIC-INDIC DIGIT TWO;Nd;0;EN;;2;2;2;N;EASTERN ARABIC-INDIC DIGIT TWO;;;; - 0x06F3, // 06F3;EXTENDED ARABIC-INDIC DIGIT THREE;Nd;0;EN;;3;3;3;N;EASTERN ARABIC-INDIC DIGIT THREE;;;; - 0x06F4, // 06F4;EXTENDED ARABIC-INDIC DIGIT FOUR;Nd;0;EN;;4;4;4;N;EASTERN ARABIC-INDIC DIGIT FOUR;;;; - 0x06F5, // 06F5;EXTENDED ARABIC-INDIC DIGIT FIVE;Nd;0;EN;;5;5;5;N;EASTERN ARABIC-INDIC DIGIT FIVE;;;; - 0x06F6, // 06F6;EXTENDED ARABIC-INDIC DIGIT SIX;Nd;0;EN;;6;6;6;N;EASTERN ARABIC-INDIC DIGIT SIX;;;; - 0x06F7, // 06F7;EXTENDED ARABIC-INDIC DIGIT SEVEN;Nd;0;EN;;7;7;7;N;EASTERN ARABIC-INDIC DIGIT SEVEN;;;; - 0x06F8, // 06F8;EXTENDED ARABIC-INDIC DIGIT EIGHT;Nd;0;EN;;8;8;8;N;EASTERN ARABIC-INDIC DIGIT EIGHT;;;; - 0x06F9, // 06F9;EXTENDED ARABIC-INDIC DIGIT NINE;Nd;0;EN;;9;9;9;N;EASTERN ARABIC-INDIC DIGIT NINE;;;; - 0x07C0, // 07C0;NKO DIGIT ZERO;Nd;0;R;;0;0;0;N;;;;; - 0x07C1, // 07C1;NKO DIGIT ONE;Nd;0;R;;1;1;1;N;;;;; - 0x07C2, // 07C2;NKO DIGIT TWO;Nd;0;R;;2;2;2;N;;;;; - 0x07C3, // 07C3;NKO DIGIT THREE;Nd;0;R;;3;3;3;N;;;;; - 0x07C4, // 07C4;NKO DIGIT FOUR;Nd;0;R;;4;4;4;N;;;;; - 0x07C5, // 07C5;NKO DIGIT FIVE;Nd;0;R;;5;5;5;N;;;;; - 0x07C6, // 07C6;NKO DIGIT SIX;Nd;0;R;;6;6;6;N;;;;; - 0x07C7, // 07C7;NKO DIGIT SEVEN;Nd;0;R;;7;7;7;N;;;;; - 0x07C8, // 07C8;NKO DIGIT EIGHT;Nd;0;R;;8;8;8;N;;;;; - 0x07C9, // 07C9;NKO DIGIT NINE;Nd;0;R;;9;9;9;N;;;;; - 0x0966, // 0966;DEVANAGARI DIGIT ZERO;Nd;0;L;;0;0;0;N;;;;; - 0x0967, // 0967;DEVANAGARI DIGIT ONE;Nd;0;L;;1;1;1;N;;;;; - 0x0968, // 0968;DEVANAGARI DIGIT TWO;Nd;0;L;;2;2;2;N;;;;; - 0x0969, // 0969;DEVANAGARI DIGIT THREE;Nd;0;L;;3;3;3;N;;;;; - 0x096A, // 096A;DEVANAGARI DIGIT FOUR;Nd;0;L;;4;4;4;N;;;;; - 0x096B, // 096B;DEVANAGARI DIGIT FIVE;Nd;0;L;;5;5;5;N;;;;; - 0x096C, // 096C;DEVANAGARI DIGIT SIX;Nd;0;L;;6;6;6;N;;;;; - 0x096D, // 096D;DEVANAGARI DIGIT SEVEN;Nd;0;L;;7;7;7;N;;;;; - 0x096E, // 096E;DEVANAGARI DIGIT EIGHT;Nd;0;L;;8;8;8;N;;;;; - 0x096F, // 096F;DEVANAGARI DIGIT NINE;Nd;0;L;;9;9;9;N;;;;; - 0x09E6, // 09E6;BENGALI DIGIT ZERO;Nd;0;L;;0;0;0;N;;;;; - 0x09E7, // 09E7;BENGALI DIGIT ONE;Nd;0;L;;1;1;1;N;;;;; - 0x09E8, // 09E8;BENGALI DIGIT TWO;Nd;0;L;;2;2;2;N;;;;; - 0x09E9, // 09E9;BENGALI DIGIT THREE;Nd;0;L;;3;3;3;N;;;;; - 0x09EA, // 09EA;BENGALI DIGIT FOUR;Nd;0;L;;4;4;4;N;;;;; - 0x09EB, // 09EB;BENGALI DIGIT FIVE;Nd;0;L;;5;5;5;N;;;;; - 0x09EC, // 09EC;BENGALI DIGIT SIX;Nd;0;L;;6;6;6;N;;;;; - 0x09ED, // 09ED;BENGALI DIGIT SEVEN;Nd;0;L;;7;7;7;N;;;;; - 0x09EE, // 09EE;BENGALI DIGIT EIGHT;Nd;0;L;;8;8;8;N;;;;; - 0x09EF, // 09EF;BENGALI DIGIT NINE;Nd;0;L;;9;9;9;N;;;;; - 0x0A66, // 0A66;GURMUKHI DIGIT ZERO;Nd;0;L;;0;0;0;N;;;;; - 0x0A67, // 0A67;GURMUKHI DIGIT ONE;Nd;0;L;;1;1;1;N;;;;; - 0x0A68, // 0A68;GURMUKHI DIGIT TWO;Nd;0;L;;2;2;2;N;;;;; - 0x0A69, // 0A69;GURMUKHI DIGIT THREE;Nd;0;L;;3;3;3;N;;;;; - 0x0A6A, // 0A6A;GURMUKHI DIGIT FOUR;Nd;0;L;;4;4;4;N;;;;; - 0x0A6B, // 0A6B;GURMUKHI DIGIT FIVE;Nd;0;L;;5;5;5;N;;;;; - 0x0A6C, // 0A6C;GURMUKHI DIGIT SIX;Nd;0;L;;6;6;6;N;;;;; - 0x0A6D, // 0A6D;GURMUKHI DIGIT SEVEN;Nd;0;L;;7;7;7;N;;;;; - 0x0A6E, // 0A6E;GURMUKHI DIGIT EIGHT;Nd;0;L;;8;8;8;N;;;;; - 0x0A6F, // 0A6F;GURMUKHI DIGIT NINE;Nd;0;L;;9;9;9;N;;;;; - 0x0AE6, // 0AE6;GUJARATI DIGIT ZERO;Nd;0;L;;0;0;0;N;;;;; - 0x0AE7, // 0AE7;GUJARATI DIGIT ONE;Nd;0;L;;1;1;1;N;;;;; - 0x0AE8, // 0AE8;GUJARATI DIGIT TWO;Nd;0;L;;2;2;2;N;;;;; - 0x0AE9, // 0AE9;GUJARATI DIGIT THREE;Nd;0;L;;3;3;3;N;;;;; - 0x0AEA, // 0AEA;GUJARATI DIGIT FOUR;Nd;0;L;;4;4;4;N;;;;; - 0x0AEB, // 0AEB;GUJARATI DIGIT FIVE;Nd;0;L;;5;5;5;N;;;;; - 0x0AEC, // 0AEC;GUJARATI DIGIT SIX;Nd;0;L;;6;6;6;N;;;;; - 0x0AED, // 0AED;GUJARATI DIGIT SEVEN;Nd;0;L;;7;7;7;N;;;;; - 0x0AEE, // 0AEE;GUJARATI DIGIT EIGHT;Nd;0;L;;8;8;8;N;;;;; - 0x0AEF, // 0AEF;GUJARATI DIGIT NINE;Nd;0;L;;9;9;9;N;;;;; - 0x0B66, // 0B66;ORIYA DIGIT ZERO;Nd;0;L;;0;0;0;N;;;;; - 0x0B67, // 0B67;ORIYA DIGIT ONE;Nd;0;L;;1;1;1;N;;;;; - 0x0B68, // 0B68;ORIYA DIGIT TWO;Nd;0;L;;2;2;2;N;;;;; - 0x0B69, // 0B69;ORIYA DIGIT THREE;Nd;0;L;;3;3;3;N;;;;; - 0x0B6A, // 0B6A;ORIYA DIGIT FOUR;Nd;0;L;;4;4;4;N;;;;; - 0x0B6B, // 0B6B;ORIYA DIGIT FIVE;Nd;0;L;;5;5;5;N;;;;; - 0x0B6C, // 0B6C;ORIYA DIGIT SIX;Nd;0;L;;6;6;6;N;;;;; - 0x0B6D, // 0B6D;ORIYA DIGIT SEVEN;Nd;0;L;;7;7;7;N;;;;; - 0x0B6E, // 0B6E;ORIYA DIGIT EIGHT;Nd;0;L;;8;8;8;N;;;;; - 0x0B6F, // 0B6F;ORIYA DIGIT NINE;Nd;0;L;;9;9;9;N;;;;; - 0x0BE6, // 0BE6;TAMIL DIGIT ZERO;Nd;0;L;;0;0;0;N;;;;; - 0x0BE7, // 0BE7;TAMIL DIGIT ONE;Nd;0;L;;1;1;1;N;;;;; - 0x0BE8, // 0BE8;TAMIL DIGIT TWO;Nd;0;L;;2;2;2;N;;;;; - 0x0BE9, // 0BE9;TAMIL DIGIT THREE;Nd;0;L;;3;3;3;N;;;;; - 0x0BEA, // 0BEA;TAMIL DIGIT FOUR;Nd;0;L;;4;4;4;N;;;;; - 0x0BEB, // 0BEB;TAMIL DIGIT FIVE;Nd;0;L;;5;5;5;N;;;;; - 0x0BEC, // 0BEC;TAMIL DIGIT SIX;Nd;0;L;;6;6;6;N;;;;; - 0x0BED, // 0BED;TAMIL DIGIT SEVEN;Nd;0;L;;7;7;7;N;;;;; - 0x0BEE, // 0BEE;TAMIL DIGIT EIGHT;Nd;0;L;;8;8;8;N;;;;; - 0x0BEF, // 0BEF;TAMIL DIGIT NINE;Nd;0;L;;9;9;9;N;;;;; - 0x0C66, // 0C66;TELUGU DIGIT ZERO;Nd;0;L;;0;0;0;N;;;;; - 0x0C67, // 0C67;TELUGU DIGIT ONE;Nd;0;L;;1;1;1;N;;;;; - 0x0C68, // 0C68;TELUGU DIGIT TWO;Nd;0;L;;2;2;2;N;;;;; - 0x0C69, // 0C69;TELUGU DIGIT THREE;Nd;0;L;;3;3;3;N;;;;; - 0x0C6A, // 0C6A;TELUGU DIGIT FOUR;Nd;0;L;;4;4;4;N;;;;; - 0x0C6B, // 0C6B;TELUGU DIGIT FIVE;Nd;0;L;;5;5;5;N;;;;; - 0x0C6C, // 0C6C;TELUGU DIGIT SIX;Nd;0;L;;6;6;6;N;;;;; - 0x0C6D, // 0C6D;TELUGU DIGIT SEVEN;Nd;0;L;;7;7;7;N;;;;; - 0x0C6E, // 0C6E;TELUGU DIGIT EIGHT;Nd;0;L;;8;8;8;N;;;;; - 0x0C6F, // 0C6F;TELUGU DIGIT NINE;Nd;0;L;;9;9;9;N;;;;; - 0x0CE6, // 0CE6;KANNADA DIGIT ZERO;Nd;0;L;;0;0;0;N;;;;; - 0x0CE7, // 0CE7;KANNADA DIGIT ONE;Nd;0;L;;1;1;1;N;;;;; - 0x0CE8, // 0CE8;KANNADA DIGIT TWO;Nd;0;L;;2;2;2;N;;;;; - 0x0CE9, // 0CE9;KANNADA DIGIT THREE;Nd;0;L;;3;3;3;N;;;;; - 0x0CEA, // 0CEA;KANNADA DIGIT FOUR;Nd;0;L;;4;4;4;N;;;;; - 0x0CEB, // 0CEB;KANNADA DIGIT FIVE;Nd;0;L;;5;5;5;N;;;;; - 0x0CEC, // 0CEC;KANNADA DIGIT SIX;Nd;0;L;;6;6;6;N;;;;; - 0x0CED, // 0CED;KANNADA DIGIT SEVEN;Nd;0;L;;7;7;7;N;;;;; - 0x0CEE, // 0CEE;KANNADA DIGIT EIGHT;Nd;0;L;;8;8;8;N;;;;; - 0x0CEF, // 0CEF;KANNADA DIGIT NINE;Nd;0;L;;9;9;9;N;;;;; - 0x0D66, // 0D66;MALAYALAM DIGIT ZERO;Nd;0;L;;0;0;0;N;;;;; - 0x0D67, // 0D67;MALAYALAM DIGIT ONE;Nd;0;L;;1;1;1;N;;;;; - 0x0D68, // 0D68;MALAYALAM DIGIT TWO;Nd;0;L;;2;2;2;N;;;;; - 0x0D69, // 0D69;MALAYALAM DIGIT THREE;Nd;0;L;;3;3;3;N;;;;; - 0x0D6A, // 0D6A;MALAYALAM DIGIT FOUR;Nd;0;L;;4;4;4;N;;;;; - 0x0D6B, // 0D6B;MALAYALAM DIGIT FIVE;Nd;0;L;;5;5;5;N;;;;; - 0x0D6C, // 0D6C;MALAYALAM DIGIT SIX;Nd;0;L;;6;6;6;N;;;;; - 0x0D6D, // 0D6D;MALAYALAM DIGIT SEVEN;Nd;0;L;;7;7;7;N;;;;; - 0x0D6E, // 0D6E;MALAYALAM DIGIT EIGHT;Nd;0;L;;8;8;8;N;;;;; - 0x0D6F, // 0D6F;MALAYALAM DIGIT NINE;Nd;0;L;;9;9;9;N;;;;; - 0x0E50, // 0E50;THAI DIGIT ZERO;Nd;0;L;;0;0;0;N;;;;; - 0x0E51, // 0E51;THAI DIGIT ONE;Nd;0;L;;1;1;1;N;;;;; - 0x0E52, // 0E52;THAI DIGIT TWO;Nd;0;L;;2;2;2;N;;;;; - 0x0E53, // 0E53;THAI DIGIT THREE;Nd;0;L;;3;3;3;N;;;;; - 0x0E54, // 0E54;THAI DIGIT FOUR;Nd;0;L;;4;4;4;N;;;;; - 0x0E55, // 0E55;THAI DIGIT FIVE;Nd;0;L;;5;5;5;N;;;;; - 0x0E56, // 0E56;THAI DIGIT SIX;Nd;0;L;;6;6;6;N;;;;; - 0x0E57, // 0E57;THAI DIGIT SEVEN;Nd;0;L;;7;7;7;N;;;;; - 0x0E58, // 0E58;THAI DIGIT EIGHT;Nd;0;L;;8;8;8;N;;;;; - 0x0E59, // 0E59;THAI DIGIT NINE;Nd;0;L;;9;9;9;N;;;;; - 0x0ED0, // 0ED0;LAO DIGIT ZERO;Nd;0;L;;0;0;0;N;;;;; - 0x0ED1, // 0ED1;LAO DIGIT ONE;Nd;0;L;;1;1;1;N;;;;; - 0x0ED2, // 0ED2;LAO DIGIT TWO;Nd;0;L;;2;2;2;N;;;;; - 0x0ED3, // 0ED3;LAO DIGIT THREE;Nd;0;L;;3;3;3;N;;;;; - 0x0ED4, // 0ED4;LAO DIGIT FOUR;Nd;0;L;;4;4;4;N;;;;; - 0x0ED5, // 0ED5;LAO DIGIT FIVE;Nd;0;L;;5;5;5;N;;;;; - 0x0ED6, // 0ED6;LAO DIGIT SIX;Nd;0;L;;6;6;6;N;;;;; - 0x0ED7, // 0ED7;LAO DIGIT SEVEN;Nd;0;L;;7;7;7;N;;;;; - 0x0ED8, // 0ED8;LAO DIGIT EIGHT;Nd;0;L;;8;8;8;N;;;;; - 0x0ED9, // 0ED9;LAO DIGIT NINE;Nd;0;L;;9;9;9;N;;;;; - 0x0F20, // 0F20;TIBETAN DIGIT ZERO;Nd;0;L;;0;0;0;N;;;;; - 0x0F21, // 0F21;TIBETAN DIGIT ONE;Nd;0;L;;1;1;1;N;;;;; - 0x0F22, // 0F22;TIBETAN DIGIT TWO;Nd;0;L;;2;2;2;N;;;;; - 0x0F23, // 0F23;TIBETAN DIGIT THREE;Nd;0;L;;3;3;3;N;;;;; - 0x0F24, // 0F24;TIBETAN DIGIT FOUR;Nd;0;L;;4;4;4;N;;;;; - 0x0F25, // 0F25;TIBETAN DIGIT FIVE;Nd;0;L;;5;5;5;N;;;;; - 0x0F26, // 0F26;TIBETAN DIGIT SIX;Nd;0;L;;6;6;6;N;;;;; - 0x0F27, // 0F27;TIBETAN DIGIT SEVEN;Nd;0;L;;7;7;7;N;;;;; - 0x0F28, // 0F28;TIBETAN DIGIT EIGHT;Nd;0;L;;8;8;8;N;;;;; - 0x0F29, // 0F29;TIBETAN DIGIT NINE;Nd;0;L;;9;9;9;N;;;;; - 0x1040, // 1040;MYANMAR DIGIT ZERO;Nd;0;L;;0;0;0;N;;;;; - 0x1041, // 1041;MYANMAR DIGIT ONE;Nd;0;L;;1;1;1;N;;;;; - 0x1042, // 1042;MYANMAR DIGIT TWO;Nd;0;L;;2;2;2;N;;;;; - 0x1043, // 1043;MYANMAR DIGIT THREE;Nd;0;L;;3;3;3;N;;;;; - 0x1044, // 1044;MYANMAR DIGIT FOUR;Nd;0;L;;4;4;4;N;;;;; - 0x1045, // 1045;MYANMAR DIGIT FIVE;Nd;0;L;;5;5;5;N;;;;; - 0x1046, // 1046;MYANMAR DIGIT SIX;Nd;0;L;;6;6;6;N;;;;; - 0x1047, // 1047;MYANMAR DIGIT SEVEN;Nd;0;L;;7;7;7;N;;;;; - 0x1048, // 1048;MYANMAR DIGIT EIGHT;Nd;0;L;;8;8;8;N;;;;; - 0x1049, // 1049;MYANMAR DIGIT NINE;Nd;0;L;;9;9;9;N;;;;; - 0x1090, // 1090;MYANMAR SHAN DIGIT ZERO;Nd;0;L;;0;0;0;N;;;;; - 0x1091, // 1091;MYANMAR SHAN DIGIT ONE;Nd;0;L;;1;1;1;N;;;;; - 0x1092, // 1092;MYANMAR SHAN DIGIT TWO;Nd;0;L;;2;2;2;N;;;;; - 0x1093, // 1093;MYANMAR SHAN DIGIT THREE;Nd;0;L;;3;3;3;N;;;;; - 0x1094, // 1094;MYANMAR SHAN DIGIT FOUR;Nd;0;L;;4;4;4;N;;;;; - 0x1095, // 1095;MYANMAR SHAN DIGIT FIVE;Nd;0;L;;5;5;5;N;;;;; - 0x1096, // 1096;MYANMAR SHAN DIGIT SIX;Nd;0;L;;6;6;6;N;;;;; - 0x1097, // 1097;MYANMAR SHAN DIGIT SEVEN;Nd;0;L;;7;7;7;N;;;;; - 0x1098, // 1098;MYANMAR SHAN DIGIT EIGHT;Nd;0;L;;8;8;8;N;;;;; - 0x1099, // 1099;MYANMAR SHAN DIGIT NINE;Nd;0;L;;9;9;9;N;;;;; - 0x17E0, // 17E0;KHMER DIGIT ZERO;Nd;0;L;;0;0;0;N;;;;; - 0x17E1, // 17E1;KHMER DIGIT ONE;Nd;0;L;;1;1;1;N;;;;; - 0x17E2, // 17E2;KHMER DIGIT TWO;Nd;0;L;;2;2;2;N;;;;; - 0x17E3, // 17E3;KHMER DIGIT THREE;Nd;0;L;;3;3;3;N;;;;; - 0x17E4, // 17E4;KHMER DIGIT FOUR;Nd;0;L;;4;4;4;N;;;;; - 0x17E5, // 17E5;KHMER DIGIT FIVE;Nd;0;L;;5;5;5;N;;;;; - 0x17E6, // 17E6;KHMER DIGIT SIX;Nd;0;L;;6;6;6;N;;;;; - 0x17E7, // 17E7;KHMER DIGIT SEVEN;Nd;0;L;;7;7;7;N;;;;; - 0x17E8, // 17E8;KHMER DIGIT EIGHT;Nd;0;L;;8;8;8;N;;;;; - 0x17E9, // 17E9;KHMER DIGIT NINE;Nd;0;L;;9;9;9;N;;;;; - 0x1810, // 1810;MONGOLIAN DIGIT ZERO;Nd;0;L;;0;0;0;N;;;;; - 0x1811, // 1811;MONGOLIAN DIGIT ONE;Nd;0;L;;1;1;1;N;;;;; - 0x1812, // 1812;MONGOLIAN DIGIT TWO;Nd;0;L;;2;2;2;N;;;;; - 0x1813, // 1813;MONGOLIAN DIGIT THREE;Nd;0;L;;3;3;3;N;;;;; - 0x1814, // 1814;MONGOLIAN DIGIT FOUR;Nd;0;L;;4;4;4;N;;;;; - 0x1815, // 1815;MONGOLIAN DIGIT FIVE;Nd;0;L;;5;5;5;N;;;;; - 0x1816, // 1816;MONGOLIAN DIGIT SIX;Nd;0;L;;6;6;6;N;;;;; - 0x1817, // 1817;MONGOLIAN DIGIT SEVEN;Nd;0;L;;7;7;7;N;;;;; - 0x1818, // 1818;MONGOLIAN DIGIT EIGHT;Nd;0;L;;8;8;8;N;;;;; - 0x1819, // 1819;MONGOLIAN DIGIT NINE;Nd;0;L;;9;9;9;N;;;;; - 0x1946, // 1946;LIMBU DIGIT ZERO;Nd;0;L;;0;0;0;N;;;;; - 0x1947, // 1947;LIMBU DIGIT ONE;Nd;0;L;;1;1;1;N;;;;; - 0x1948, // 1948;LIMBU DIGIT TWO;Nd;0;L;;2;2;2;N;;;;; - 0x1949, // 1949;LIMBU DIGIT THREE;Nd;0;L;;3;3;3;N;;;;; - 0x194A, // 194A;LIMBU DIGIT FOUR;Nd;0;L;;4;4;4;N;;;;; - 0x194B, // 194B;LIMBU DIGIT FIVE;Nd;0;L;;5;5;5;N;;;;; - 0x194C, // 194C;LIMBU DIGIT SIX;Nd;0;L;;6;6;6;N;;;;; - 0x194D, // 194D;LIMBU DIGIT SEVEN;Nd;0;L;;7;7;7;N;;;;; - 0x194E, // 194E;LIMBU DIGIT EIGHT;Nd;0;L;;8;8;8;N;;;;; - 0x194F, // 194F;LIMBU DIGIT NINE;Nd;0;L;;9;9;9;N;;;;; - 0x19D0, // 19D0;NEW TAI LUE DIGIT ZERO;Nd;0;L;;0;0;0;N;;;;; - 0x19D1, // 19D1;NEW TAI LUE DIGIT ONE;Nd;0;L;;1;1;1;N;;;;; - 0x19D2, // 19D2;NEW TAI LUE DIGIT TWO;Nd;0;L;;2;2;2;N;;;;; - 0x19D3, // 19D3;NEW TAI LUE DIGIT THREE;Nd;0;L;;3;3;3;N;;;;; - 0x19D4, // 19D4;NEW TAI LUE DIGIT FOUR;Nd;0;L;;4;4;4;N;;;;; - 0x19D5, // 19D5;NEW TAI LUE DIGIT FIVE;Nd;0;L;;5;5;5;N;;;;; - 0x19D6, // 19D6;NEW TAI LUE DIGIT SIX;Nd;0;L;;6;6;6;N;;;;; - 0x19D7, // 19D7;NEW TAI LUE DIGIT SEVEN;Nd;0;L;;7;7;7;N;;;;; - 0x19D8, // 19D8;NEW TAI LUE DIGIT EIGHT;Nd;0;L;;8;8;8;N;;;;; - 0x19D9, // 19D9;NEW TAI LUE DIGIT NINE;Nd;0;L;;9;9;9;N;;;;; - 0x1B50, // 1B50;BALINESE DIGIT ZERO;Nd;0;L;;0;0;0;N;;;;; - 0x1B51, // 1B51;BALINESE DIGIT ONE;Nd;0;L;;1;1;1;N;;;;; - 0x1B52, // 1B52;BALINESE DIGIT TWO;Nd;0;L;;2;2;2;N;;;;; - 0x1B53, // 1B53;BALINESE DIGIT THREE;Nd;0;L;;3;3;3;N;;;;; - 0x1B54, // 1B54;BALINESE DIGIT FOUR;Nd;0;L;;4;4;4;N;;;;; - 0x1B55, // 1B55;BALINESE DIGIT FIVE;Nd;0;L;;5;5;5;N;;;;; - 0x1B56, // 1B56;BALINESE DIGIT SIX;Nd;0;L;;6;6;6;N;;;;; - 0x1B57, // 1B57;BALINESE DIGIT SEVEN;Nd;0;L;;7;7;7;N;;;;; - 0x1B58, // 1B58;BALINESE DIGIT EIGHT;Nd;0;L;;8;8;8;N;;;;; - 0x1B59, // 1B59;BALINESE DIGIT NINE;Nd;0;L;;9;9;9;N;;;;; - 0x1BB0, // 1BB0;SUNDANESE DIGIT ZERO;Nd;0;L;;0;0;0;N;;;;; - 0x1BB1, // 1BB1;SUNDANESE DIGIT ONE;Nd;0;L;;1;1;1;N;;;;; - 0x1BB2, // 1BB2;SUNDANESE DIGIT TWO;Nd;0;L;;2;2;2;N;;;;; - 0x1BB3, // 1BB3;SUNDANESE DIGIT THREE;Nd;0;L;;3;3;3;N;;;;; - 0x1BB4, // 1BB4;SUNDANESE DIGIT FOUR;Nd;0;L;;4;4;4;N;;;;; - 0x1BB5, // 1BB5;SUNDANESE DIGIT FIVE;Nd;0;L;;5;5;5;N;;;;; - 0x1BB6, // 1BB6;SUNDANESE DIGIT SIX;Nd;0;L;;6;6;6;N;;;;; - 0x1BB7, // 1BB7;SUNDANESE DIGIT SEVEN;Nd;0;L;;7;7;7;N;;;;; - 0x1BB8, // 1BB8;SUNDANESE DIGIT EIGHT;Nd;0;L;;8;8;8;N;;;;; - 0x1BB9, // 1BB9;SUNDANESE DIGIT NINE;Nd;0;L;;9;9;9;N;;;;; - 0x1C40, // 1C40;LEPCHA DIGIT ZERO;Nd;0;L;;0;0;0;N;;;;; - 0x1C41, // 1C41;LEPCHA DIGIT ONE;Nd;0;L;;1;1;1;N;;;;; - 0x1C42, // 1C42;LEPCHA DIGIT TWO;Nd;0;L;;2;2;2;N;;;;; - 0x1C43, // 1C43;LEPCHA DIGIT THREE;Nd;0;L;;3;3;3;N;;;;; - 0x1C44, // 1C44;LEPCHA DIGIT FOUR;Nd;0;L;;4;4;4;N;;;;; - 0x1C45, // 1C45;LEPCHA DIGIT FIVE;Nd;0;L;;5;5;5;N;;;;; - 0x1C46, // 1C46;LEPCHA DIGIT SIX;Nd;0;L;;6;6;6;N;;;;; - 0x1C47, // 1C47;LEPCHA DIGIT SEVEN;Nd;0;L;;7;7;7;N;;;;; - 0x1C48, // 1C48;LEPCHA DIGIT EIGHT;Nd;0;L;;8;8;8;N;;;;; - 0x1C49, // 1C49;LEPCHA DIGIT NINE;Nd;0;L;;9;9;9;N;;;;; - 0x1C50, // 1C50;OL CHIKI DIGIT ZERO;Nd;0;L;;0;0;0;N;;;;; - 0x1C51, // 1C51;OL CHIKI DIGIT ONE;Nd;0;L;;1;1;1;N;;;;; - 0x1C52, // 1C52;OL CHIKI DIGIT TWO;Nd;0;L;;2;2;2;N;;;;; - 0x1C53, // 1C53;OL CHIKI DIGIT THREE;Nd;0;L;;3;3;3;N;;;;; - 0x1C54, // 1C54;OL CHIKI DIGIT FOUR;Nd;0;L;;4;4;4;N;;;;; - 0x1C55, // 1C55;OL CHIKI DIGIT FIVE;Nd;0;L;;5;5;5;N;;;;; - 0x1C56, // 1C56;OL CHIKI DIGIT SIX;Nd;0;L;;6;6;6;N;;;;; - 0x1C57, // 1C57;OL CHIKI DIGIT SEVEN;Nd;0;L;;7;7;7;N;;;;; - 0x1C58, // 1C58;OL CHIKI DIGIT EIGHT;Nd;0;L;;8;8;8;N;;;;; - 0x1C59, // 1C59;OL CHIKI DIGIT NINE;Nd;0;L;;9;9;9;N;;;;; - 0xA620, // A620;VAI DIGIT ZERO;Nd;0;L;;0;0;0;N;;;;; - 0xA621, // A621;VAI DIGIT ONE;Nd;0;L;;1;1;1;N;;;;; - 0xA622, // A622;VAI DIGIT TWO;Nd;0;L;;2;2;2;N;;;;; - 0xA623, // A623;VAI DIGIT THREE;Nd;0;L;;3;3;3;N;;;;; - 0xA624, // A624;VAI DIGIT FOUR;Nd;0;L;;4;4;4;N;;;;; - 0xA625, // A625;VAI DIGIT FIVE;Nd;0;L;;5;5;5;N;;;;; - 0xA626, // A626;VAI DIGIT SIX;Nd;0;L;;6;6;6;N;;;;; - 0xA627, // A627;VAI DIGIT SEVEN;Nd;0;L;;7;7;7;N;;;;; - 0xA628, // A628;VAI DIGIT EIGHT;Nd;0;L;;8;8;8;N;;;;; - 0xA629, // A629;VAI DIGIT NINE;Nd;0;L;;9;9;9;N;;;;; - 0xA8D0, // A8D0;SAURASHTRA DIGIT ZERO;Nd;0;L;;0;0;0;N;;;;; - 0xA8D1, // A8D1;SAURASHTRA DIGIT ONE;Nd;0;L;;1;1;1;N;;;;; - 0xA8D2, // A8D2;SAURASHTRA DIGIT TWO;Nd;0;L;;2;2;2;N;;;;; - 0xA8D3, // A8D3;SAURASHTRA DIGIT THREE;Nd;0;L;;3;3;3;N;;;;; - 0xA8D4, // A8D4;SAURASHTRA DIGIT FOUR;Nd;0;L;;4;4;4;N;;;;; - 0xA8D5, // A8D5;SAURASHTRA DIGIT FIVE;Nd;0;L;;5;5;5;N;;;;; - 0xA8D6, // A8D6;SAURASHTRA DIGIT SIX;Nd;0;L;;6;6;6;N;;;;; - 0xA8D7, // A8D7;SAURASHTRA DIGIT SEVEN;Nd;0;L;;7;7;7;N;;;;; - 0xA8D8, // A8D8;SAURASHTRA DIGIT EIGHT;Nd;0;L;;8;8;8;N;;;;; - 0xA8D9, // A8D9;SAURASHTRA DIGIT NINE;Nd;0;L;;9;9;9;N;;;;; - 0xA900, // A900;KAYAH LI DIGIT ZERO;Nd;0;L;;0;0;0;N;;;;; - 0xA901, // A901;KAYAH LI DIGIT ONE;Nd;0;L;;1;1;1;N;;;;; - 0xA902, // A902;KAYAH LI DIGIT TWO;Nd;0;L;;2;2;2;N;;;;; - 0xA903, // A903;KAYAH LI DIGIT THREE;Nd;0;L;;3;3;3;N;;;;; - 0xA904, // A904;KAYAH LI DIGIT FOUR;Nd;0;L;;4;4;4;N;;;;; - 0xA905, // A905;KAYAH LI DIGIT FIVE;Nd;0;L;;5;5;5;N;;;;; - 0xA906, // A906;KAYAH LI DIGIT SIX;Nd;0;L;;6;6;6;N;;;;; - 0xA907, // A907;KAYAH LI DIGIT SEVEN;Nd;0;L;;7;7;7;N;;;;; - 0xA908, // A908;KAYAH LI DIGIT EIGHT;Nd;0;L;;8;8;8;N;;;;; - 0xA909, // A909;KAYAH LI DIGIT NINE;Nd;0;L;;9;9;9;N;;;;; - 0xAA50, // AA50;CHAM DIGIT ZERO;Nd;0;L;;0;0;0;N;;;;; - 0xAA51, // AA51;CHAM DIGIT ONE;Nd;0;L;;1;1;1;N;;;;; - 0xAA52, // AA52;CHAM DIGIT TWO;Nd;0;L;;2;2;2;N;;;;; - 0xAA53, // AA53;CHAM DIGIT THREE;Nd;0;L;;3;3;3;N;;;;; - 0xAA54, // AA54;CHAM DIGIT FOUR;Nd;0;L;;4;4;4;N;;;;; - 0xAA55, // AA55;CHAM DIGIT FIVE;Nd;0;L;;5;5;5;N;;;;; - 0xAA56, // AA56;CHAM DIGIT SIX;Nd;0;L;;6;6;6;N;;;;; - 0xAA57, // AA57;CHAM DIGIT SEVEN;Nd;0;L;;7;7;7;N;;;;; - 0xAA58, // AA58;CHAM DIGIT EIGHT;Nd;0;L;;8;8;8;N;;;;; - 0xAA59, // AA59;CHAM DIGIT NINE;Nd;0;L;;9;9;9;N;;;;; - 0xFF10, // FF10;FULLWIDTH DIGIT ZERO;Nd;0;EN; 0030;0;0;0;N;;;;; - 0xFF11, // FF11;FULLWIDTH DIGIT ONE;Nd;0;EN; 0031;1;1;1;N;;;;; - 0xFF12, // FF12;FULLWIDTH DIGIT TWO;Nd;0;EN; 0032;2;2;2;N;;;;; - 0xFF13, // FF13;FULLWIDTH DIGIT THREE;Nd;0;EN; 0033;3;3;3;N;;;;; - 0xFF14, // FF14;FULLWIDTH DIGIT FOUR;Nd;0;EN; 0034;4;4;4;N;;;;; - 0xFF15, // FF15;FULLWIDTH DIGIT FIVE;Nd;0;EN; 0035;5;5;5;N;;;;; - 0xFF16, // FF16;FULLWIDTH DIGIT SIX;Nd;0;EN; 0036;6;6;6;N;;;;; - 0xFF17, // FF17;FULLWIDTH DIGIT SEVEN;Nd;0;EN; 0037;7;7;7;N;;;;; - 0xFF18, // FF18;FULLWIDTH DIGIT EIGHT;Nd;0;EN; 0038;8;8;8;N;;;;; - 0xFF19, // FF19;FULLWIDTH DIGIT NINE;Nd;0;EN; 0039;9;9;9;N;;;;; -} - -var testLetter = []int{ - 0x41, - 0x61, - 0xaa, - 0xba, - 0xc8, - 0xdb, - 0xf9, - 0x2ec, - 0x535, - 0x6e6, - 0x93d, - 0xa15, - 0xb99, - 0xdc0, - 0xedd, - 0x1000, - 0x1200, - 0x1312, - 0x1401, - 0x1885, - 0x2c00, - 0xa800, - 0xf900, - 0xfa30, - 0xffda, - 0xffdc, - 0x10000, - 0x10300, - 0x10400, - 0x20000, - 0x2f800, - 0x2fa1d, -} - -func TestIsDecimalDigit(t *testing.T) { - for i, r := range testDecimal { - if !IsDecimalDigit(r) { - t.Errorf("IsDecimalDigit(%#x) = false, want true\n", r); - } - } - for i, r := range testLetter { - if IsDecimalDigit(r) { - t.Errorf("IsDecimalDigit(%#x) = true, want false\n", r); - } - } -} diff --git a/src/pkg/unicode/digit.go b/src/pkg/unicode/digit.go new file mode 100644 index 000000000..b12ada2d6 --- /dev/null +++ b/src/pkg/unicode/digit.go @@ -0,0 +1,13 @@ +// 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 + +// IsDigit reports whether the rune is a decimal digit. +func IsDigit(rune int) bool { + if rune < 0x100 { // quick ASCII (Latin-1, really) check + return '0' <= rune && rune <= '9' + } + return Is(Digit, rune); +} diff --git a/src/pkg/unicode/digit_test.go b/src/pkg/unicode/digit_test.go new file mode 100644 index 000000000..02d063746 --- /dev/null +++ b/src/pkg/unicode/digit_test.go @@ -0,0 +1,372 @@ +// 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 + +import "testing" + +// To get data: +// grep '^....;[^;]*;Nd;' UnicodeData.txt +// To generate this table: +// ,s/([^;]+).+/ 0x\1, \/\/ &/g +var testDigit = []int{ + 0x0030, // 0030;DIGIT ZERO;Nd;0;EN;;0;0;0;N;;;;; + 0x0031, // 0031;DIGIT ONE;Nd;0;EN;;1;1;1;N;;;;; + 0x0032, // 0032;DIGIT TWO;Nd;0;EN;;2;2;2;N;;;;; + 0x0033, // 0033;DIGIT THREE;Nd;0;EN;;3;3;3;N;;;;; + 0x0034, // 0034;DIGIT FOUR;Nd;0;EN;;4;4;4;N;;;;; + 0x0035, // 0035;DIGIT FIVE;Nd;0;EN;;5;5;5;N;;;;; + 0x0036, // 0036;DIGIT SIX;Nd;0;EN;;6;6;6;N;;;;; + 0x0037, // 0037;DIGIT SEVEN;Nd;0;EN;;7;7;7;N;;;;; + 0x0038, // 0038;DIGIT EIGHT;Nd;0;EN;;8;8;8;N;;;;; + 0x0039, // 0039;DIGIT NINE;Nd;0;EN;;9;9;9;N;;;;; + 0x0660, // 0660;ARABIC-INDIC DIGIT ZERO;Nd;0;AN;;0;0;0;N;;;;; + 0x0661, // 0661;ARABIC-INDIC DIGIT ONE;Nd;0;AN;;1;1;1;N;;;;; + 0x0662, // 0662;ARABIC-INDIC DIGIT TWO;Nd;0;AN;;2;2;2;N;;;;; + 0x0663, // 0663;ARABIC-INDIC DIGIT THREE;Nd;0;AN;;3;3;3;N;;;;; + 0x0664, // 0664;ARABIC-INDIC DIGIT FOUR;Nd;0;AN;;4;4;4;N;;;;; + 0x0665, // 0665;ARABIC-INDIC DIGIT FIVE;Nd;0;AN;;5;5;5;N;;;;; + 0x0666, // 0666;ARABIC-INDIC DIGIT SIX;Nd;0;AN;;6;6;6;N;;;;; + 0x0667, // 0667;ARABIC-INDIC DIGIT SEVEN;Nd;0;AN;;7;7;7;N;;;;; + 0x0668, // 0668;ARABIC-INDIC DIGIT EIGHT;Nd;0;AN;;8;8;8;N;;;;; + 0x0669, // 0669;ARABIC-INDIC DIGIT NINE;Nd;0;AN;;9;9;9;N;;;;; + 0x06F0, // 06F0;EXTENDED ARABIC-INDIC DIGIT ZERO;Nd;0;EN;;0;0;0;N;EASTERN ARABIC-INDIC DIGIT ZERO;;;; + 0x06F1, // 06F1;EXTENDED ARABIC-INDIC DIGIT ONE;Nd;0;EN;;1;1;1;N;EASTERN ARABIC-INDIC DIGIT ONE;;;; + 0x06F2, // 06F2;EXTENDED ARABIC-INDIC DIGIT TWO;Nd;0;EN;;2;2;2;N;EASTERN ARABIC-INDIC DIGIT TWO;;;; + 0x06F3, // 06F3;EXTENDED ARABIC-INDIC DIGIT THREE;Nd;0;EN;;3;3;3;N;EASTERN ARABIC-INDIC DIGIT THREE;;;; + 0x06F4, // 06F4;EXTENDED ARABIC-INDIC DIGIT FOUR;Nd;0;EN;;4;4;4;N;EASTERN ARABIC-INDIC DIGIT FOUR;;;; + 0x06F5, // 06F5;EXTENDED ARABIC-INDIC DIGIT FIVE;Nd;0;EN;;5;5;5;N;EASTERN ARABIC-INDIC DIGIT FIVE;;;; + 0x06F6, // 06F6;EXTENDED ARABIC-INDIC DIGIT SIX;Nd;0;EN;;6;6;6;N;EASTERN ARABIC-INDIC DIGIT SIX;;;; + 0x06F7, // 06F7;EXTENDED ARABIC-INDIC DIGIT SEVEN;Nd;0;EN;;7;7;7;N;EASTERN ARABIC-INDIC DIGIT SEVEN;;;; + 0x06F8, // 06F8;EXTENDED ARABIC-INDIC DIGIT EIGHT;Nd;0;EN;;8;8;8;N;EASTERN ARABIC-INDIC DIGIT EIGHT;;;; + 0x06F9, // 06F9;EXTENDED ARABIC-INDIC DIGIT NINE;Nd;0;EN;;9;9;9;N;EASTERN ARABIC-INDIC DIGIT NINE;;;; + 0x07C0, // 07C0;NKO DIGIT ZERO;Nd;0;R;;0;0;0;N;;;;; + 0x07C1, // 07C1;NKO DIGIT ONE;Nd;0;R;;1;1;1;N;;;;; + 0x07C2, // 07C2;NKO DIGIT TWO;Nd;0;R;;2;2;2;N;;;;; + 0x07C3, // 07C3;NKO DIGIT THREE;Nd;0;R;;3;3;3;N;;;;; + 0x07C4, // 07C4;NKO DIGIT FOUR;Nd;0;R;;4;4;4;N;;;;; + 0x07C5, // 07C5;NKO DIGIT FIVE;Nd;0;R;;5;5;5;N;;;;; + 0x07C6, // 07C6;NKO DIGIT SIX;Nd;0;R;;6;6;6;N;;;;; + 0x07C7, // 07C7;NKO DIGIT SEVEN;Nd;0;R;;7;7;7;N;;;;; + 0x07C8, // 07C8;NKO DIGIT EIGHT;Nd;0;R;;8;8;8;N;;;;; + 0x07C9, // 07C9;NKO DIGIT NINE;Nd;0;R;;9;9;9;N;;;;; + 0x0966, // 0966;DEVANAGARI DIGIT ZERO;Nd;0;L;;0;0;0;N;;;;; + 0x0967, // 0967;DEVANAGARI DIGIT ONE;Nd;0;L;;1;1;1;N;;;;; + 0x0968, // 0968;DEVANAGARI DIGIT TWO;Nd;0;L;;2;2;2;N;;;;; + 0x0969, // 0969;DEVANAGARI DIGIT THREE;Nd;0;L;;3;3;3;N;;;;; + 0x096A, // 096A;DEVANAGARI DIGIT FOUR;Nd;0;L;;4;4;4;N;;;;; + 0x096B, // 096B;DEVANAGARI DIGIT FIVE;Nd;0;L;;5;5;5;N;;;;; + 0x096C, // 096C;DEVANAGARI DIGIT SIX;Nd;0;L;;6;6;6;N;;;;; + 0x096D, // 096D;DEVANAGARI DIGIT SEVEN;Nd;0;L;;7;7;7;N;;;;; + 0x096E, // 096E;DEVANAGARI DIGIT EIGHT;Nd;0;L;;8;8;8;N;;;;; + 0x096F, // 096F;DEVANAGARI DIGIT NINE;Nd;0;L;;9;9;9;N;;;;; + 0x09E6, // 09E6;BENGALI DIGIT ZERO;Nd;0;L;;0;0;0;N;;;;; + 0x09E7, // 09E7;BENGALI DIGIT ONE;Nd;0;L;;1;1;1;N;;;;; + 0x09E8, // 09E8;BENGALI DIGIT TWO;Nd;0;L;;2;2;2;N;;;;; + 0x09E9, // 09E9;BENGALI DIGIT THREE;Nd;0;L;;3;3;3;N;;;;; + 0x09EA, // 09EA;BENGALI DIGIT FOUR;Nd;0;L;;4;4;4;N;;;;; + 0x09EB, // 09EB;BENGALI DIGIT FIVE;Nd;0;L;;5;5;5;N;;;;; + 0x09EC, // 09EC;BENGALI DIGIT SIX;Nd;0;L;;6;6;6;N;;;;; + 0x09ED, // 09ED;BENGALI DIGIT SEVEN;Nd;0;L;;7;7;7;N;;;;; + 0x09EE, // 09EE;BENGALI DIGIT EIGHT;Nd;0;L;;8;8;8;N;;;;; + 0x09EF, // 09EF;BENGALI DIGIT NINE;Nd;0;L;;9;9;9;N;;;;; + 0x0A66, // 0A66;GURMUKHI DIGIT ZERO;Nd;0;L;;0;0;0;N;;;;; + 0x0A67, // 0A67;GURMUKHI DIGIT ONE;Nd;0;L;;1;1;1;N;;;;; + 0x0A68, // 0A68;GURMUKHI DIGIT TWO;Nd;0;L;;2;2;2;N;;;;; + 0x0A69, // 0A69;GURMUKHI DIGIT THREE;Nd;0;L;;3;3;3;N;;;;; + 0x0A6A, // 0A6A;GURMUKHI DIGIT FOUR;Nd;0;L;;4;4;4;N;;;;; + 0x0A6B, // 0A6B;GURMUKHI DIGIT FIVE;Nd;0;L;;5;5;5;N;;;;; + 0x0A6C, // 0A6C;GURMUKHI DIGIT SIX;Nd;0;L;;6;6;6;N;;;;; + 0x0A6D, // 0A6D;GURMUKHI DIGIT SEVEN;Nd;0;L;;7;7;7;N;;;;; + 0x0A6E, // 0A6E;GURMUKHI DIGIT EIGHT;Nd;0;L;;8;8;8;N;;;;; + 0x0A6F, // 0A6F;GURMUKHI DIGIT NINE;Nd;0;L;;9;9;9;N;;;;; + 0x0AE6, // 0AE6;GUJARATI DIGIT ZERO;Nd;0;L;;0;0;0;N;;;;; + 0x0AE7, // 0AE7;GUJARATI DIGIT ONE;Nd;0;L;;1;1;1;N;;;;; + 0x0AE8, // 0AE8;GUJARATI DIGIT TWO;Nd;0;L;;2;2;2;N;;;;; + 0x0AE9, // 0AE9;GUJARATI DIGIT THREE;Nd;0;L;;3;3;3;N;;;;; + 0x0AEA, // 0AEA;GUJARATI DIGIT FOUR;Nd;0;L;;4;4;4;N;;;;; + 0x0AEB, // 0AEB;GUJARATI DIGIT FIVE;Nd;0;L;;5;5;5;N;;;;; + 0x0AEC, // 0AEC;GUJARATI DIGIT SIX;Nd;0;L;;6;6;6;N;;;;; + 0x0AED, // 0AED;GUJARATI DIGIT SEVEN;Nd;0;L;;7;7;7;N;;;;; + 0x0AEE, // 0AEE;GUJARATI DIGIT EIGHT;Nd;0;L;;8;8;8;N;;;;; + 0x0AEF, // 0AEF;GUJARATI DIGIT NINE;Nd;0;L;;9;9;9;N;;;;; + 0x0B66, // 0B66;ORIYA DIGIT ZERO;Nd;0;L;;0;0;0;N;;;;; + 0x0B67, // 0B67;ORIYA DIGIT ONE;Nd;0;L;;1;1;1;N;;;;; + 0x0B68, // 0B68;ORIYA DIGIT TWO;Nd;0;L;;2;2;2;N;;;;; + 0x0B69, // 0B69;ORIYA DIGIT THREE;Nd;0;L;;3;3;3;N;;;;; + 0x0B6A, // 0B6A;ORIYA DIGIT FOUR;Nd;0;L;;4;4;4;N;;;;; + 0x0B6B, // 0B6B;ORIYA DIGIT FIVE;Nd;0;L;;5;5;5;N;;;;; + 0x0B6C, // 0B6C;ORIYA DIGIT SIX;Nd;0;L;;6;6;6;N;;;;; + 0x0B6D, // 0B6D;ORIYA DIGIT SEVEN;Nd;0;L;;7;7;7;N;;;;; + 0x0B6E, // 0B6E;ORIYA DIGIT EIGHT;Nd;0;L;;8;8;8;N;;;;; + 0x0B6F, // 0B6F;ORIYA DIGIT NINE;Nd;0;L;;9;9;9;N;;;;; + 0x0BE6, // 0BE6;TAMIL DIGIT ZERO;Nd;0;L;;0;0;0;N;;;;; + 0x0BE7, // 0BE7;TAMIL DIGIT ONE;Nd;0;L;;1;1;1;N;;;;; + 0x0BE8, // 0BE8;TAMIL DIGIT TWO;Nd;0;L;;2;2;2;N;;;;; + 0x0BE9, // 0BE9;TAMIL DIGIT THREE;Nd;0;L;;3;3;3;N;;;;; + 0x0BEA, // 0BEA;TAMIL DIGIT FOUR;Nd;0;L;;4;4;4;N;;;;; + 0x0BEB, // 0BEB;TAMIL DIGIT FIVE;Nd;0;L;;5;5;5;N;;;;; + 0x0BEC, // 0BEC;TAMIL DIGIT SIX;Nd;0;L;;6;6;6;N;;;;; + 0x0BED, // 0BED;TAMIL DIGIT SEVEN;Nd;0;L;;7;7;7;N;;;;; + 0x0BEE, // 0BEE;TAMIL DIGIT EIGHT;Nd;0;L;;8;8;8;N;;;;; + 0x0BEF, // 0BEF;TAMIL DIGIT NINE;Nd;0;L;;9;9;9;N;;;;; + 0x0C66, // 0C66;TELUGU DIGIT ZERO;Nd;0;L;;0;0;0;N;;;;; + 0x0C67, // 0C67;TELUGU DIGIT ONE;Nd;0;L;;1;1;1;N;;;;; + 0x0C68, // 0C68;TELUGU DIGIT TWO;Nd;0;L;;2;2;2;N;;;;; + 0x0C69, // 0C69;TELUGU DIGIT THREE;Nd;0;L;;3;3;3;N;;;;; + 0x0C6A, // 0C6A;TELUGU DIGIT FOUR;Nd;0;L;;4;4;4;N;;;;; + 0x0C6B, // 0C6B;TELUGU DIGIT FIVE;Nd;0;L;;5;5;5;N;;;;; + 0x0C6C, // 0C6C;TELUGU DIGIT SIX;Nd;0;L;;6;6;6;N;;;;; + 0x0C6D, // 0C6D;TELUGU DIGIT SEVEN;Nd;0;L;;7;7;7;N;;;;; + 0x0C6E, // 0C6E;TELUGU DIGIT EIGHT;Nd;0;L;;8;8;8;N;;;;; + 0x0C6F, // 0C6F;TELUGU DIGIT NINE;Nd;0;L;;9;9;9;N;;;;; + 0x0CE6, // 0CE6;KANNADA DIGIT ZERO;Nd;0;L;;0;0;0;N;;;;; + 0x0CE7, // 0CE7;KANNADA DIGIT ONE;Nd;0;L;;1;1;1;N;;;;; + 0x0CE8, // 0CE8;KANNADA DIGIT TWO;Nd;0;L;;2;2;2;N;;;;; + 0x0CE9, // 0CE9;KANNADA DIGIT THREE;Nd;0;L;;3;3;3;N;;;;; + 0x0CEA, // 0CEA;KANNADA DIGIT FOUR;Nd;0;L;;4;4;4;N;;;;; + 0x0CEB, // 0CEB;KANNADA DIGIT FIVE;Nd;0;L;;5;5;5;N;;;;; + 0x0CEC, // 0CEC;KANNADA DIGIT SIX;Nd;0;L;;6;6;6;N;;;;; + 0x0CED, // 0CED;KANNADA DIGIT SEVEN;Nd;0;L;;7;7;7;N;;;;; + 0x0CEE, // 0CEE;KANNADA DIGIT EIGHT;Nd;0;L;;8;8;8;N;;;;; + 0x0CEF, // 0CEF;KANNADA DIGIT NINE;Nd;0;L;;9;9;9;N;;;;; + 0x0D66, // 0D66;MALAYALAM DIGIT ZERO;Nd;0;L;;0;0;0;N;;;;; + 0x0D67, // 0D67;MALAYALAM DIGIT ONE;Nd;0;L;;1;1;1;N;;;;; + 0x0D68, // 0D68;MALAYALAM DIGIT TWO;Nd;0;L;;2;2;2;N;;;;; + 0x0D69, // 0D69;MALAYALAM DIGIT THREE;Nd;0;L;;3;3;3;N;;;;; + 0x0D6A, // 0D6A;MALAYALAM DIGIT FOUR;Nd;0;L;;4;4;4;N;;;;; + 0x0D6B, // 0D6B;MALAYALAM DIGIT FIVE;Nd;0;L;;5;5;5;N;;;;; + 0x0D6C, // 0D6C;MALAYALAM DIGIT SIX;Nd;0;L;;6;6;6;N;;;;; + 0x0D6D, // 0D6D;MALAYALAM DIGIT SEVEN;Nd;0;L;;7;7;7;N;;;;; + 0x0D6E, // 0D6E;MALAYALAM DIGIT EIGHT;Nd;0;L;;8;8;8;N;;;;; + 0x0D6F, // 0D6F;MALAYALAM DIGIT NINE;Nd;0;L;;9;9;9;N;;;;; + 0x0E50, // 0E50;THAI DIGIT ZERO;Nd;0;L;;0;0;0;N;;;;; + 0x0E51, // 0E51;THAI DIGIT ONE;Nd;0;L;;1;1;1;N;;;;; + 0x0E52, // 0E52;THAI DIGIT TWO;Nd;0;L;;2;2;2;N;;;;; + 0x0E53, // 0E53;THAI DIGIT THREE;Nd;0;L;;3;3;3;N;;;;; + 0x0E54, // 0E54;THAI DIGIT FOUR;Nd;0;L;;4;4;4;N;;;;; + 0x0E55, // 0E55;THAI DIGIT FIVE;Nd;0;L;;5;5;5;N;;;;; + 0x0E56, // 0E56;THAI DIGIT SIX;Nd;0;L;;6;6;6;N;;;;; + 0x0E57, // 0E57;THAI DIGIT SEVEN;Nd;0;L;;7;7;7;N;;;;; + 0x0E58, // 0E58;THAI DIGIT EIGHT;Nd;0;L;;8;8;8;N;;;;; + 0x0E59, // 0E59;THAI DIGIT NINE;Nd;0;L;;9;9;9;N;;;;; + 0x0ED0, // 0ED0;LAO DIGIT ZERO;Nd;0;L;;0;0;0;N;;;;; + 0x0ED1, // 0ED1;LAO DIGIT ONE;Nd;0;L;;1;1;1;N;;;;; + 0x0ED2, // 0ED2;LAO DIGIT TWO;Nd;0;L;;2;2;2;N;;;;; + 0x0ED3, // 0ED3;LAO DIGIT THREE;Nd;0;L;;3;3;3;N;;;;; + 0x0ED4, // 0ED4;LAO DIGIT FOUR;Nd;0;L;;4;4;4;N;;;;; + 0x0ED5, // 0ED5;LAO DIGIT FIVE;Nd;0;L;;5;5;5;N;;;;; + 0x0ED6, // 0ED6;LAO DIGIT SIX;Nd;0;L;;6;6;6;N;;;;; + 0x0ED7, // 0ED7;LAO DIGIT SEVEN;Nd;0;L;;7;7;7;N;;;;; + 0x0ED8, // 0ED8;LAO DIGIT EIGHT;Nd;0;L;;8;8;8;N;;;;; + 0x0ED9, // 0ED9;LAO DIGIT NINE;Nd;0;L;;9;9;9;N;;;;; + 0x0F20, // 0F20;TIBETAN DIGIT ZERO;Nd;0;L;;0;0;0;N;;;;; + 0x0F21, // 0F21;TIBETAN DIGIT ONE;Nd;0;L;;1;1;1;N;;;;; + 0x0F22, // 0F22;TIBETAN DIGIT TWO;Nd;0;L;;2;2;2;N;;;;; + 0x0F23, // 0F23;TIBETAN DIGIT THREE;Nd;0;L;;3;3;3;N;;;;; + 0x0F24, // 0F24;TIBETAN DIGIT FOUR;Nd;0;L;;4;4;4;N;;;;; + 0x0F25, // 0F25;TIBETAN DIGIT FIVE;Nd;0;L;;5;5;5;N;;;;; + 0x0F26, // 0F26;TIBETAN DIGIT SIX;Nd;0;L;;6;6;6;N;;;;; + 0x0F27, // 0F27;TIBETAN DIGIT SEVEN;Nd;0;L;;7;7;7;N;;;;; + 0x0F28, // 0F28;TIBETAN DIGIT EIGHT;Nd;0;L;;8;8;8;N;;;;; + 0x0F29, // 0F29;TIBETAN DIGIT NINE;Nd;0;L;;9;9;9;N;;;;; + 0x1040, // 1040;MYANMAR DIGIT ZERO;Nd;0;L;;0;0;0;N;;;;; + 0x1041, // 1041;MYANMAR DIGIT ONE;Nd;0;L;;1;1;1;N;;;;; + 0x1042, // 1042;MYANMAR DIGIT TWO;Nd;0;L;;2;2;2;N;;;;; + 0x1043, // 1043;MYANMAR DIGIT THREE;Nd;0;L;;3;3;3;N;;;;; + 0x1044, // 1044;MYANMAR DIGIT FOUR;Nd;0;L;;4;4;4;N;;;;; + 0x1045, // 1045;MYANMAR DIGIT FIVE;Nd;0;L;;5;5;5;N;;;;; + 0x1046, // 1046;MYANMAR DIGIT SIX;Nd;0;L;;6;6;6;N;;;;; + 0x1047, // 1047;MYANMAR DIGIT SEVEN;Nd;0;L;;7;7;7;N;;;;; + 0x1048, // 1048;MYANMAR DIGIT EIGHT;Nd;0;L;;8;8;8;N;;;;; + 0x1049, // 1049;MYANMAR DIGIT NINE;Nd;0;L;;9;9;9;N;;;;; + 0x1090, // 1090;MYANMAR SHAN DIGIT ZERO;Nd;0;L;;0;0;0;N;;;;; + 0x1091, // 1091;MYANMAR SHAN DIGIT ONE;Nd;0;L;;1;1;1;N;;;;; + 0x1092, // 1092;MYANMAR SHAN DIGIT TWO;Nd;0;L;;2;2;2;N;;;;; + 0x1093, // 1093;MYANMAR SHAN DIGIT THREE;Nd;0;L;;3;3;3;N;;;;; + 0x1094, // 1094;MYANMAR SHAN DIGIT FOUR;Nd;0;L;;4;4;4;N;;;;; + 0x1095, // 1095;MYANMAR SHAN DIGIT FIVE;Nd;0;L;;5;5;5;N;;;;; + 0x1096, // 1096;MYANMAR SHAN DIGIT SIX;Nd;0;L;;6;6;6;N;;;;; + 0x1097, // 1097;MYANMAR SHAN DIGIT SEVEN;Nd;0;L;;7;7;7;N;;;;; + 0x1098, // 1098;MYANMAR SHAN DIGIT EIGHT;Nd;0;L;;8;8;8;N;;;;; + 0x1099, // 1099;MYANMAR SHAN DIGIT NINE;Nd;0;L;;9;9;9;N;;;;; + 0x17E0, // 17E0;KHMER DIGIT ZERO;Nd;0;L;;0;0;0;N;;;;; + 0x17E1, // 17E1;KHMER DIGIT ONE;Nd;0;L;;1;1;1;N;;;;; + 0x17E2, // 17E2;KHMER DIGIT TWO;Nd;0;L;;2;2;2;N;;;;; + 0x17E3, // 17E3;KHMER DIGIT THREE;Nd;0;L;;3;3;3;N;;;;; + 0x17E4, // 17E4;KHMER DIGIT FOUR;Nd;0;L;;4;4;4;N;;;;; + 0x17E5, // 17E5;KHMER DIGIT FIVE;Nd;0;L;;5;5;5;N;;;;; + 0x17E6, // 17E6;KHMER DIGIT SIX;Nd;0;L;;6;6;6;N;;;;; + 0x17E7, // 17E7;KHMER DIGIT SEVEN;Nd;0;L;;7;7;7;N;;;;; + 0x17E8, // 17E8;KHMER DIGIT EIGHT;Nd;0;L;;8;8;8;N;;;;; + 0x17E9, // 17E9;KHMER DIGIT NINE;Nd;0;L;;9;9;9;N;;;;; + 0x1810, // 1810;MONGOLIAN DIGIT ZERO;Nd;0;L;;0;0;0;N;;;;; + 0x1811, // 1811;MONGOLIAN DIGIT ONE;Nd;0;L;;1;1;1;N;;;;; + 0x1812, // 1812;MONGOLIAN DIGIT TWO;Nd;0;L;;2;2;2;N;;;;; + 0x1813, // 1813;MONGOLIAN DIGIT THREE;Nd;0;L;;3;3;3;N;;;;; + 0x1814, // 1814;MONGOLIAN DIGIT FOUR;Nd;0;L;;4;4;4;N;;;;; + 0x1815, // 1815;MONGOLIAN DIGIT FIVE;Nd;0;L;;5;5;5;N;;;;; + 0x1816, // 1816;MONGOLIAN DIGIT SIX;Nd;0;L;;6;6;6;N;;;;; + 0x1817, // 1817;MONGOLIAN DIGIT SEVEN;Nd;0;L;;7;7;7;N;;;;; + 0x1818, // 1818;MONGOLIAN DIGIT EIGHT;Nd;0;L;;8;8;8;N;;;;; + 0x1819, // 1819;MONGOLIAN DIGIT NINE;Nd;0;L;;9;9;9;N;;;;; + 0x1946, // 1946;LIMBU DIGIT ZERO;Nd;0;L;;0;0;0;N;;;;; + 0x1947, // 1947;LIMBU DIGIT ONE;Nd;0;L;;1;1;1;N;;;;; + 0x1948, // 1948;LIMBU DIGIT TWO;Nd;0;L;;2;2;2;N;;;;; + 0x1949, // 1949;LIMBU DIGIT THREE;Nd;0;L;;3;3;3;N;;;;; + 0x194A, // 194A;LIMBU DIGIT FOUR;Nd;0;L;;4;4;4;N;;;;; + 0x194B, // 194B;LIMBU DIGIT FIVE;Nd;0;L;;5;5;5;N;;;;; + 0x194C, // 194C;LIMBU DIGIT SIX;Nd;0;L;;6;6;6;N;;;;; + 0x194D, // 194D;LIMBU DIGIT SEVEN;Nd;0;L;;7;7;7;N;;;;; + 0x194E, // 194E;LIMBU DIGIT EIGHT;Nd;0;L;;8;8;8;N;;;;; + 0x194F, // 194F;LIMBU DIGIT NINE;Nd;0;L;;9;9;9;N;;;;; + 0x19D0, // 19D0;NEW TAI LUE DIGIT ZERO;Nd;0;L;;0;0;0;N;;;;; + 0x19D1, // 19D1;NEW TAI LUE DIGIT ONE;Nd;0;L;;1;1;1;N;;;;; + 0x19D2, // 19D2;NEW TAI LUE DIGIT TWO;Nd;0;L;;2;2;2;N;;;;; + 0x19D3, // 19D3;NEW TAI LUE DIGIT THREE;Nd;0;L;;3;3;3;N;;;;; + 0x19D4, // 19D4;NEW TAI LUE DIGIT FOUR;Nd;0;L;;4;4;4;N;;;;; + 0x19D5, // 19D5;NEW TAI LUE DIGIT FIVE;Nd;0;L;;5;5;5;N;;;;; + 0x19D6, // 19D6;NEW TAI LUE DIGIT SIX;Nd;0;L;;6;6;6;N;;;;; + 0x19D7, // 19D7;NEW TAI LUE DIGIT SEVEN;Nd;0;L;;7;7;7;N;;;;; + 0x19D8, // 19D8;NEW TAI LUE DIGIT EIGHT;Nd;0;L;;8;8;8;N;;;;; + 0x19D9, // 19D9;NEW TAI LUE DIGIT NINE;Nd;0;L;;9;9;9;N;;;;; + 0x1B50, // 1B50;BALINESE DIGIT ZERO;Nd;0;L;;0;0;0;N;;;;; + 0x1B51, // 1B51;BALINESE DIGIT ONE;Nd;0;L;;1;1;1;N;;;;; + 0x1B52, // 1B52;BALINESE DIGIT TWO;Nd;0;L;;2;2;2;N;;;;; + 0x1B53, // 1B53;BALINESE DIGIT THREE;Nd;0;L;;3;3;3;N;;;;; + 0x1B54, // 1B54;BALINESE DIGIT FOUR;Nd;0;L;;4;4;4;N;;;;; + 0x1B55, // 1B55;BALINESE DIGIT FIVE;Nd;0;L;;5;5;5;N;;;;; + 0x1B56, // 1B56;BALINESE DIGIT SIX;Nd;0;L;;6;6;6;N;;;;; + 0x1B57, // 1B57;BALINESE DIGIT SEVEN;Nd;0;L;;7;7;7;N;;;;; + 0x1B58, // 1B58;BALINESE DIGIT EIGHT;Nd;0;L;;8;8;8;N;;;;; + 0x1B59, // 1B59;BALINESE DIGIT NINE;Nd;0;L;;9;9;9;N;;;;; + 0x1BB0, // 1BB0;SUNDANESE DIGIT ZERO;Nd;0;L;;0;0;0;N;;;;; + 0x1BB1, // 1BB1;SUNDANESE DIGIT ONE;Nd;0;L;;1;1;1;N;;;;; + 0x1BB2, // 1BB2;SUNDANESE DIGIT TWO;Nd;0;L;;2;2;2;N;;;;; + 0x1BB3, // 1BB3;SUNDANESE DIGIT THREE;Nd;0;L;;3;3;3;N;;;;; + 0x1BB4, // 1BB4;SUNDANESE DIGIT FOUR;Nd;0;L;;4;4;4;N;;;;; + 0x1BB5, // 1BB5;SUNDANESE DIGIT FIVE;Nd;0;L;;5;5;5;N;;;;; + 0x1BB6, // 1BB6;SUNDANESE DIGIT SIX;Nd;0;L;;6;6;6;N;;;;; + 0x1BB7, // 1BB7;SUNDANESE DIGIT SEVEN;Nd;0;L;;7;7;7;N;;;;; + 0x1BB8, // 1BB8;SUNDANESE DIGIT EIGHT;Nd;0;L;;8;8;8;N;;;;; + 0x1BB9, // 1BB9;SUNDANESE DIGIT NINE;Nd;0;L;;9;9;9;N;;;;; + 0x1C40, // 1C40;LEPCHA DIGIT ZERO;Nd;0;L;;0;0;0;N;;;;; + 0x1C41, // 1C41;LEPCHA DIGIT ONE;Nd;0;L;;1;1;1;N;;;;; + 0x1C42, // 1C42;LEPCHA DIGIT TWO;Nd;0;L;;2;2;2;N;;;;; + 0x1C43, // 1C43;LEPCHA DIGIT THREE;Nd;0;L;;3;3;3;N;;;;; + 0x1C44, // 1C44;LEPCHA DIGIT FOUR;Nd;0;L;;4;4;4;N;;;;; + 0x1C45, // 1C45;LEPCHA DIGIT FIVE;Nd;0;L;;5;5;5;N;;;;; + 0x1C46, // 1C46;LEPCHA DIGIT SIX;Nd;0;L;;6;6;6;N;;;;; + 0x1C47, // 1C47;LEPCHA DIGIT SEVEN;Nd;0;L;;7;7;7;N;;;;; + 0x1C48, // 1C48;LEPCHA DIGIT EIGHT;Nd;0;L;;8;8;8;N;;;;; + 0x1C49, // 1C49;LEPCHA DIGIT NINE;Nd;0;L;;9;9;9;N;;;;; + 0x1C50, // 1C50;OL CHIKI DIGIT ZERO;Nd;0;L;;0;0;0;N;;;;; + 0x1C51, // 1C51;OL CHIKI DIGIT ONE;Nd;0;L;;1;1;1;N;;;;; + 0x1C52, // 1C52;OL CHIKI DIGIT TWO;Nd;0;L;;2;2;2;N;;;;; + 0x1C53, // 1C53;OL CHIKI DIGIT THREE;Nd;0;L;;3;3;3;N;;;;; + 0x1C54, // 1C54;OL CHIKI DIGIT FOUR;Nd;0;L;;4;4;4;N;;;;; + 0x1C55, // 1C55;OL CHIKI DIGIT FIVE;Nd;0;L;;5;5;5;N;;;;; + 0x1C56, // 1C56;OL CHIKI DIGIT SIX;Nd;0;L;;6;6;6;N;;;;; + 0x1C57, // 1C57;OL CHIKI DIGIT SEVEN;Nd;0;L;;7;7;7;N;;;;; + 0x1C58, // 1C58;OL CHIKI DIGIT EIGHT;Nd;0;L;;8;8;8;N;;;;; + 0x1C59, // 1C59;OL CHIKI DIGIT NINE;Nd;0;L;;9;9;9;N;;;;; + 0xA620, // A620;VAI DIGIT ZERO;Nd;0;L;;0;0;0;N;;;;; + 0xA621, // A621;VAI DIGIT ONE;Nd;0;L;;1;1;1;N;;;;; + 0xA622, // A622;VAI DIGIT TWO;Nd;0;L;;2;2;2;N;;;;; + 0xA623, // A623;VAI DIGIT THREE;Nd;0;L;;3;3;3;N;;;;; + 0xA624, // A624;VAI DIGIT FOUR;Nd;0;L;;4;4;4;N;;;;; + 0xA625, // A625;VAI DIGIT FIVE;Nd;0;L;;5;5;5;N;;;;; + 0xA626, // A626;VAI DIGIT SIX;Nd;0;L;;6;6;6;N;;;;; + 0xA627, // A627;VAI DIGIT SEVEN;Nd;0;L;;7;7;7;N;;;;; + 0xA628, // A628;VAI DIGIT EIGHT;Nd;0;L;;8;8;8;N;;;;; + 0xA629, // A629;VAI DIGIT NINE;Nd;0;L;;9;9;9;N;;;;; + 0xA8D0, // A8D0;SAURASHTRA DIGIT ZERO;Nd;0;L;;0;0;0;N;;;;; + 0xA8D1, // A8D1;SAURASHTRA DIGIT ONE;Nd;0;L;;1;1;1;N;;;;; + 0xA8D2, // A8D2;SAURASHTRA DIGIT TWO;Nd;0;L;;2;2;2;N;;;;; + 0xA8D3, // A8D3;SAURASHTRA DIGIT THREE;Nd;0;L;;3;3;3;N;;;;; + 0xA8D4, // A8D4;SAURASHTRA DIGIT FOUR;Nd;0;L;;4;4;4;N;;;;; + 0xA8D5, // A8D5;SAURASHTRA DIGIT FIVE;Nd;0;L;;5;5;5;N;;;;; + 0xA8D6, // A8D6;SAURASHTRA DIGIT SIX;Nd;0;L;;6;6;6;N;;;;; + 0xA8D7, // A8D7;SAURASHTRA DIGIT SEVEN;Nd;0;L;;7;7;7;N;;;;; + 0xA8D8, // A8D8;SAURASHTRA DIGIT EIGHT;Nd;0;L;;8;8;8;N;;;;; + 0xA8D9, // A8D9;SAURASHTRA DIGIT NINE;Nd;0;L;;9;9;9;N;;;;; + 0xA900, // A900;KAYAH LI DIGIT ZERO;Nd;0;L;;0;0;0;N;;;;; + 0xA901, // A901;KAYAH LI DIGIT ONE;Nd;0;L;;1;1;1;N;;;;; + 0xA902, // A902;KAYAH LI DIGIT TWO;Nd;0;L;;2;2;2;N;;;;; + 0xA903, // A903;KAYAH LI DIGIT THREE;Nd;0;L;;3;3;3;N;;;;; + 0xA904, // A904;KAYAH LI DIGIT FOUR;Nd;0;L;;4;4;4;N;;;;; + 0xA905, // A905;KAYAH LI DIGIT FIVE;Nd;0;L;;5;5;5;N;;;;; + 0xA906, // A906;KAYAH LI DIGIT SIX;Nd;0;L;;6;6;6;N;;;;; + 0xA907, // A907;KAYAH LI DIGIT SEVEN;Nd;0;L;;7;7;7;N;;;;; + 0xA908, // A908;KAYAH LI DIGIT EIGHT;Nd;0;L;;8;8;8;N;;;;; + 0xA909, // A909;KAYAH LI DIGIT NINE;Nd;0;L;;9;9;9;N;;;;; + 0xAA50, // AA50;CHAM DIGIT ZERO;Nd;0;L;;0;0;0;N;;;;; + 0xAA51, // AA51;CHAM DIGIT ONE;Nd;0;L;;1;1;1;N;;;;; + 0xAA52, // AA52;CHAM DIGIT TWO;Nd;0;L;;2;2;2;N;;;;; + 0xAA53, // AA53;CHAM DIGIT THREE;Nd;0;L;;3;3;3;N;;;;; + 0xAA54, // AA54;CHAM DIGIT FOUR;Nd;0;L;;4;4;4;N;;;;; + 0xAA55, // AA55;CHAM DIGIT FIVE;Nd;0;L;;5;5;5;N;;;;; + 0xAA56, // AA56;CHAM DIGIT SIX;Nd;0;L;;6;6;6;N;;;;; + 0xAA57, // AA57;CHAM DIGIT SEVEN;Nd;0;L;;7;7;7;N;;;;; + 0xAA58, // AA58;CHAM DIGIT EIGHT;Nd;0;L;;8;8;8;N;;;;; + 0xAA59, // AA59;CHAM DIGIT NINE;Nd;0;L;;9;9;9;N;;;;; + 0xFF10, // FF10;FULLWIDTH DIGIT ZERO;Nd;0;EN; 0030;0;0;0;N;;;;; + 0xFF11, // FF11;FULLWIDTH DIGIT ONE;Nd;0;EN; 0031;1;1;1;N;;;;; + 0xFF12, // FF12;FULLWIDTH DIGIT TWO;Nd;0;EN; 0032;2;2;2;N;;;;; + 0xFF13, // FF13;FULLWIDTH DIGIT THREE;Nd;0;EN; 0033;3;3;3;N;;;;; + 0xFF14, // FF14;FULLWIDTH DIGIT FOUR;Nd;0;EN; 0034;4;4;4;N;;;;; + 0xFF15, // FF15;FULLWIDTH DIGIT FIVE;Nd;0;EN; 0035;5;5;5;N;;;;; + 0xFF16, // FF16;FULLWIDTH DIGIT SIX;Nd;0;EN; 0036;6;6;6;N;;;;; + 0xFF17, // FF17;FULLWIDTH DIGIT SEVEN;Nd;0;EN; 0037;7;7;7;N;;;;; + 0xFF18, // FF18;FULLWIDTH DIGIT EIGHT;Nd;0;EN; 0038;8;8;8;N;;;;; + 0xFF19, // FF19;FULLWIDTH DIGIT NINE;Nd;0;EN; 0039;9;9;9;N;;;;; +} + +var testLetter = []int{ + 0x41, + 0x61, + 0xaa, + 0xba, + 0xc8, + 0xdb, + 0xf9, + 0x2ec, + 0x535, + 0x6e6, + 0x93d, + 0xa15, + 0xb99, + 0xdc0, + 0xedd, + 0x1000, + 0x1200, + 0x1312, + 0x1401, + 0x1885, + 0x2c00, + 0xa800, + 0xf900, + 0xfa30, + 0xffda, + 0xffdc, + 0x10000, + 0x10300, + 0x10400, + 0x20000, + 0x2f800, + 0x2fa1d, +} + +func TestDigit(t *testing.T) { + for i, r := range testDigit { + if !IsDigit(r) { + t.Errorf("IsDigit(%#x) = false, want true\n", r); + } + } + for i, r := range testLetter { + if IsDigit(r) { + t.Errorf("IsDigit(%#x) = true, want false\n", r); + } + } +} diff --git a/src/pkg/unicode/digittables.go b/src/pkg/unicode/digittables.go index f0b11a5b6..eaea4253a 100644 --- a/src/pkg/unicode/digittables.go +++ b/src/pkg/unicode/digittables.go @@ -1,12 +1,12 @@ // Generated by running -// tables --digits=true --url=http://www.unicode.org/Public/5.1.0/ucd/UnicodeData.txt +// maketables --digits=true --url=http://www.unicode.org/Public/5.1.0/ucd/UnicodeData.txt // DO NOT EDIT package unicode -// DecimalDigit is the set of Unicode characters with the "decimal digit" property. -var DecimalDigit = decimalDigit -var decimalDigit = []Range { +// Digit is the set of Unicode characters with the "decimal digit" (Nd) property. +var Digit = digit +var digit = []Range { Range{0x0030, 0x0039, 1}, Range{0x0660, 0x0669, 1}, Range{0x06f0, 0x06f9, 1}, diff --git a/src/pkg/unicode/letter.go b/src/pkg/unicode/letter.go index f0e9db2ae..c625e9068 100644 --- a/src/pkg/unicode/letter.go +++ b/src/pkg/unicode/letter.go @@ -18,8 +18,7 @@ type Range struct { func Is(ranges []Range, rune int) bool { // common case: rune is ASCII or Latin-1 if rune < 0x100 { - for i := 0; i < len(ranges); i++ { - r := ranges[i]; + for i, r := range ranges { if rune > r.Hi { continue; } @@ -51,20 +50,33 @@ func Is(ranges []Range, rune int) bool { // IsUpper reports whether the rune is an upper case letter. func IsUpper(rune int) bool { + if rune < 0x80 { // quick ASCII check + return 'A' <= rune && rune <= 'Z'; + } return Is(Upper, rune); } // IsLower reports whether the rune is a lower case letter. func IsLower(rune int) bool { + if rune < 0x80 { // quick ASCII check + return 'a' <= rune && rune <= 'z'; + } return Is(Lower, rune); } // IsTitle reports whether the rune is a title case letter. func IsTitle(rune int) bool { + if rune < 0x80 { // quick ASCII check + return false; + } return Is(Title, rune); } // IsLetter reports whether the rune is a letter. func IsLetter(rune int) bool { + if rune < 0x80 { // quick ASCII check + rune &^= ' '; + return 'A' <= rune && rune <= 'Z'; + } return Is(Letter, rune); } diff --git a/src/pkg/unicode/maketables.go b/src/pkg/unicode/maketables.go index 466813611..6a7ac3d32 100644 --- a/src/pkg/unicode/maketables.go +++ b/src/pkg/unicode/maketables.go @@ -172,7 +172,7 @@ func main() { resp.Body.Close(); fmt.Printf( "// Generated by running\n" - "// tables --digits=%t --url=%s\n" + "// maketables --digits=%t --url=%s\n" "// DO NOT EDIT\n\n" "package unicode\n", *digits, @@ -183,9 +183,9 @@ func main() { // available to clients. if *digits { dumpRange( - "\n// DecimalDigit is the set of Unicode characters with the \"decimal digit\" property.\n" - "var DecimalDigit = decimalDigit\n" - "var decimalDigit = []Range {\n", + "\n// Digit is the set of Unicode characters with the \"decimal digit\" (Nd) property.\n" + "var Digit = digit\n" + "var digit = []Range {\n", func(code int) bool { return chars[code].category == "Nd" }, "}\n" ); -- cgit v1.2.3