diff options
author | Ryo Nihei <nihei.dev@gmail.com> | 2021-11-23 22:15:54 +0900 |
---|---|---|
committer | Ryo Nihei <nihei.dev@gmail.com> | 2021-11-24 01:04:19 +0900 |
commit | bedf0c1c72a2e13e08fbaa221b8a4c3ccf3a57a7 (patch) | |
tree | 642095852ff2e1b6d616e1cbc781d07f3d03d833 /compiler/ucd_table.go | |
parent | Fix key of generalCategoryCodePoints map (diff) | |
download | tre-bedf0c1c72a2e13e08fbaa221b8a4c3ccf3a57a7.tar.gz tre-bedf0c1c72a2e13e08fbaa221b8a4c3ccf3a57a7.tar.xz |
Support White_Space property (Meet RL1.2 of UTS #18 partially)
Diffstat (limited to 'compiler/ucd_table.go')
-rw-r--r-- | compiler/ucd_table.go | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/compiler/ucd_table.go b/compiler/ucd_table.go index c941f4c..4c3c723 100644 --- a/compiler/ucd_table.go +++ b/compiler/ucd_table.go @@ -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 @@ -4087,3 +4103,18 @@ var generalCategoryCodePoints = map[string][]*ucd.CodePointRange{ &ucd.CodePointRange{From: rune(12288), To: rune(12288)}, }, } + +// https://www.unicode.org/Public/13.0.0/ucd/PropList.txt +var whiteSpaceCodePoints = []*ucd.CodePointRange{ + &ucd.CodePointRange{From: rune(9), To: rune(13)}, + &ucd.CodePointRange{From: rune(32), To: rune(32)}, + &ucd.CodePointRange{From: rune(133), To: rune(133)}, + &ucd.CodePointRange{From: rune(160), To: rune(160)}, + &ucd.CodePointRange{From: rune(5760), To: rune(5760)}, + &ucd.CodePointRange{From: rune(8192), To: rune(8202)}, + &ucd.CodePointRange{From: rune(8232), To: rune(8232)}, + &ucd.CodePointRange{From: rune(8233), To: rune(8233)}, + &ucd.CodePointRange{From: rune(8239), To: rune(8239)}, + &ucd.CodePointRange{From: rune(8287), To: rune(8287)}, + &ucd.CodePointRange{From: rune(12288), To: rune(12288)}, +} |