aboutsummaryrefslogtreecommitdiff
path: root/cmd/generator/main.go
diff options
context:
space:
mode:
authorRyo Nihei <nihei.dev@gmail.com>2021-11-23 22:15:54 +0900
committerRyo Nihei <nihei.dev@gmail.com>2021-11-24 01:04:19 +0900
commitbedf0c1c72a2e13e08fbaa221b8a4c3ccf3a57a7 (patch)
tree642095852ff2e1b6d616e1cbc781d07f3d03d833 /cmd/generator/main.go
parentFix key of generalCategoryCodePoints map (diff)
downloadtre-bedf0c1c72a2e13e08fbaa221b8a4c3ccf3a57a7.tar.gz
tre-bedf0c1c72a2e13e08fbaa221b8a4c3ccf3a57a7.tar.xz
Support White_Space property (Meet RL1.2 of UTS #18 partially)
Diffstat (limited to 'cmd/generator/main.go')
-rw-r--r--cmd/generator/main.go14
1 files changed, 14 insertions, 0 deletions
diff --git a/cmd/generator/main.go b/cmd/generator/main.go
index 3edcef5..ae57709 100644
--- a/cmd/generator/main.go
+++ b/cmd/generator/main.go
@@ -43,6 +43,18 @@ func gen() error {
return err
}
}
+ var propList *ucd.PropList
+ {
+ resp, err := http.Get("https://www.unicode.org/Public/13.0.0/ucd/PropList.txt")
+ if err != nil {
+ return err
+ }
+ defer resp.Body.Close()
+ propList, err = ucd.ParsePropList(resp.Body)
+ if err != nil {
+ return err
+ }
+ }
tmpl, err := template.ParseFiles("../compiler/ucd_table.go.tmpl")
if err != nil {
return err
@@ -51,10 +63,12 @@ func gen() error {
err = tmpl.Execute(&b, struct {
GeneratorName string
UnicodeData *ucd.UnicodeData
+ PropList *ucd.PropList
PropertyValueAliases *ucd.PropertyValueAliases
}{
GeneratorName: "generator/main.go",
UnicodeData: unicodeData,
+ PropList: propList,
PropertyValueAliases: propValAliases,
})
if err != nil {