From 5ebc2f4e9aa55bb77d82da7d9915a4140cddfbfb Mon Sep 17 00:00:00 2001 From: Ryo Nihei Date: Sat, 27 Nov 2021 21:39:42 +0900 Subject: Move all UCD-related processes to ucd package --- compiler/parser.go | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'compiler/parser.go') 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() -- cgit v1.2.3