From e9af22730e68908f46c9aee3b35e133d34191bef Mon Sep 17 00:00:00 2001 From: Ryo Nihei Date: Fri, 26 Nov 2021 00:01:16 +0900 Subject: Support Alphabetic property (Meet RL1.2 of UTS #18 partially) --- compiler/ucd.go | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) (limited to 'compiler/ucd.go') diff --git a/compiler/ucd.go b/compiler/ucd.go index 3c0bee1..80b46ab 100644 --- a/compiler/ucd.go +++ b/compiler/ucd.go @@ -33,7 +33,7 @@ func normalizeCharacterProperty(propName, propVal string) (string, error) { fmt.Fprint(&b, prop) } fmt.Fprint(&b, "]") - + return b.String(), nil } @@ -61,6 +61,16 @@ func findCodePointRanges(propName, propVal string) ([]*ucd.CodePointRange, bool, ranges = append(ranges, rs...) } return ranges, false, nil + case "oalpha": + yes, ok := binaryValues[ucd.NormalizeSymbolicValue(propVal)] + if !ok { + return nil, false, fmt.Errorf("unsupported character property value: %v", propVal) + } + if yes { + return otherAlphabeticCodePoints, false, nil + } else { + return otherAlphabeticCodePoints, true, nil + } case "olower": yes, ok := binaryValues[ucd.NormalizeSymbolicValue(propVal)] if !ok { -- cgit v1.2.3