diff options
Diffstat (limited to 'ucd/unicode_data.go')
-rw-r--r-- | ucd/unicode_data.go | 19 |
1 files changed, 1 insertions, 18 deletions
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)] |