From bedf0c1c72a2e13e08fbaa221b8a4c3ccf3a57a7 Mon Sep 17 00:00:00 2001 From: Ryo Nihei Date: Tue, 23 Nov 2021 22:15:54 +0900 Subject: Support White_Space property (Meet RL1.2 of UTS #18 partially) --- compiler/ucd_table.go.tmpl | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) (limited to 'compiler/ucd_table.go.tmpl') diff --git a/compiler/ucd_table.go.tmpl b/compiler/ucd_table.go.tmpl index a364191..80142c7 100644 --- a/compiler/ucd_table.go.tmpl +++ b/compiler/ucd_table.go.tmpl @@ -28,6 +28,22 @@ var compositGeneralCategories = map[string][]string{ var propertyNameAbbs = map[string]string{ "generalcategory": "gc", "gc": "gc", + "whitespace": "wspace", + "wspace": "wspace", + "space": "wspace", +} + +// https://www.unicode.org/reports/tr44/#Type_Key_Table +// https://www.unicode.org/reports/tr44/#Binary_Values_Table +var binaryValues = map[string]bool{ + "yes": true, + "y": true, + "true": true, + "t": true, + "no": false, + "n": false, + "false": false, + "f": false, } // https://www.unicode.org/Public/13.0.0/ucd/PropertyValueAliases.txt @@ -41,3 +57,8 @@ var generalCategoryCodePoints = map[string][]*ucd.CodePointRange{ {{ range $prop &ucd.CodePointRange{From: rune({{ .From }}), To: rune({{ .To }})},{{ end }} },{{ end }} } + +// https://www.unicode.org/Public/13.0.0/ucd/PropList.txt +var whiteSpaceCodePoints = []*ucd.CodePointRange{ {{ range .PropList.WhiteSpace }} + &ucd.CodePointRange{From: rune({{ .From }}), To: rune({{ .To }})},{{ end }} +} -- cgit v1.2.3