From f0870a4d2ec589bf5de268a54d51c1da197ed882 Mon Sep 17 00:00:00 2001 From: Ryo Nihei Date: Sun, 28 Nov 2021 17:50:38 +0900 Subject: Remove default value's code points of General_Category --- ucd/unicode_data.go | 19 +------------------ 1 file changed, 1 insertion(+), 18 deletions(-) (limited to 'ucd/unicode_data.go') diff --git a/ucd/unicode_data.go b/ucd/unicode_data.go index d45ee39..e2a8e87 100644 --- a/ucd/unicode_data.go +++ b/ucd/unicode_data.go @@ -15,7 +15,6 @@ func ParseUnicodeData(r io.Reader, propValAliases *PropertyValueAliases) (*Unico propValAliases: propValAliases, } - lastCPTo := rune(-1) p := newParser(r) for p.parse() { if len(p.fields) == 0 { @@ -25,25 +24,12 @@ func ParseUnicodeData(r io.Reader, propValAliases *PropertyValueAliases) (*Unico if err != nil { return nil, err } - if cp.From-lastCPTo > 1 { - unicodeData.addGC(propValAliases.GeneralCategoryDefaultValue, &CodePointRange{ - From: lastCPTo + 1, - To: cp.From - 1, - }) - } - lastCPTo = cp.To gc := p.fields[2].normalizedSymbol() unicodeData.addGC(gc, cp) } if p.err != nil { return nil, p.err } - if lastCPTo < propValAliases.GeneralCategoryDefaultRange.To { - unicodeData.addGC(propValAliases.GeneralCategoryDefaultValue, &CodePointRange{ - From: lastCPTo + 1, - To: propValAliases.GeneralCategoryDefaultRange.To, - }) - } return unicodeData, nil } @@ -53,10 +39,7 @@ func (u *UnicodeData) addGC(gc string, cp *CodePointRange) { // > The data file UnicodeData.txt defines many property values in each record. When a field in a data line // > for a code point is empty, that indicates that the property takes the default value for that code point. if gc == "" { - if cp.From < u.propValAliases.GeneralCategoryDefaultRange.From || cp.To > u.propValAliases.GeneralCategoryDefaultRange.To { - return - } - gc = u.propValAliases.GeneralCategoryDefaultValue + return } cps, ok := u.GeneralCategory[u.propValAliases.gcAbb(gc)] -- cgit v1.2.3