diff options
author | Ryo Nihei <nihei.dev@gmail.com> | 2021-11-27 21:39:42 +0900 |
---|---|---|
committer | Ryo Nihei <nihei.dev@gmail.com> | 2021-11-27 22:02:52 +0900 |
commit | 5ebc2f4e9aa55bb77d82da7d9915a4140cddfbfb (patch) | |
tree | fa6d3cd57636290caa5a8f7deec25477c0caf01f /compiler/parser.go | |
parent | Support Alphabetic property (Meet RL1.2 of UTS #18 partially) (diff) | |
download | tre-5ebc2f4e9aa55bb77d82da7d9915a4140cddfbfb.tar.gz tre-5ebc2f4e9aa55bb77d82da7d9915a4140cddfbfb.tar.xz |
Move all UCD-related processes to ucd package
Diffstat (limited to 'compiler/parser.go')
-rw-r--r-- | compiler/parser.go | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/compiler/parser.go b/compiler/parser.go index 5d1a38d..980e65c 100644 --- a/compiler/parser.go +++ b/compiler/parser.go @@ -9,6 +9,7 @@ import ( "strings" "github.com/nihei9/maleeni/spec" + "github.com/nihei9/maleeni/ucd" ) type ParseErrors struct { @@ -544,10 +545,10 @@ func (p *parser) parseCharProp() astNode { propName = sym1 propVal = sym2 } else { - propName = "gc" + propName = "" propVal = sym1 } - pat, err := normalizeCharacterProperty(propName, propVal) + pat, err := ucd.NormalizeCharacterProperty(propName, propVal) if err != nil { p.errMsgDetails = fmt.Sprintf("%v", err) raiseSyntaxError(synErrCharPropUnsupported) @@ -560,7 +561,7 @@ func (p *parser) parseCharProp() astNode { } alt = ast } else { - cpRanges, inverse, err := findCodePointRanges(propName, propVal) + cpRanges, inverse, err := ucd.FindCodePointRanges(propName, propVal) if err != nil { p.errMsgDetails = fmt.Sprintf("%v", err) raiseSyntaxError(synErrCharPropUnsupported) @@ -655,7 +656,7 @@ func exclude(symbol, base astNode) astNode { if alt, ok := symbol.(*altNode); ok { return exclude(alt.right, exclude(alt.left, base)) } - + switch base.(type) { case *altNode: left, right := base.children() |