aboutsummaryrefslogtreecommitdiff
path: root/ucd
diff options
context:
space:
mode:
authorRyo Nihei <nihei.dev@gmail.com>2021-11-26 00:01:16 +0900
committerRyo Nihei <nihei.dev@gmail.com>2021-11-26 00:01:16 +0900
commite9af22730e68908f46c9aee3b35e133d34191bef (patch)
tree7c8b2a738453ca7e26c1aebc4375800b8842d3aa /ucd
parentMake character properties available in an inverse expression (Make [^\p{...}]... (diff)
downloadtre-e9af22730e68908f46c9aee3b35e133d34191bef.tar.gz
tre-e9af22730e68908f46c9aee3b35e133d34191bef.tar.xz
Support Alphabetic property (Meet RL1.2 of UTS #18 partially)
Diffstat (limited to 'ucd')
-rw-r--r--ucd/prop_list.go17
1 files changed, 11 insertions, 6 deletions
diff --git a/ucd/prop_list.go b/ucd/prop_list.go
index 1ceaaea..31db70c 100644
--- a/ucd/prop_list.go
+++ b/ucd/prop_list.go
@@ -3,13 +3,15 @@ package ucd
import "io"
type PropList struct {
- OtherLowercase []*CodePointRange
- OtherUppercase []*CodePointRange
- WhiteSpace []*CodePointRange
+ OtherAlphabetic []*CodePointRange
+ OtherLowercase []*CodePointRange
+ OtherUppercase []*CodePointRange
+ WhiteSpace []*CodePointRange
}
// ParsePropList parses the PropList.txt.
func ParsePropList(r io.Reader) (*PropList, error) {
+ var oa []*CodePointRange
var ol []*CodePointRange
var ou []*CodePointRange
var ws []*CodePointRange
@@ -25,6 +27,8 @@ func ParsePropList(r io.Reader) (*PropList, error) {
}
switch p.fields[1].symbol() {
+ case "Other_Alphabetic":
+ oa = append(oa, cp)
case "Other_Lowercase":
ol = append(ol, cp)
case "Other_Uppercase":
@@ -38,8 +42,9 @@ func ParsePropList(r io.Reader) (*PropList, error) {
}
return &PropList{
- OtherLowercase: ol,
- OtherUppercase: ou,
- WhiteSpace: ws,
+ OtherAlphabetic: oa,
+ OtherLowercase: ol,
+ OtherUppercase: ou,
+ WhiteSpace: ws,
}, nil
}