aboutsummaryrefslogtreecommitdiff
path: root/compiler/ucd_table.go.tmpl
blob: a364191338612323e184af096088d3cb4d76f2ae (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
// Code generated by {{ .GeneratorName }}; DO NOT EDIT.

package compiler

import "github.com/nihei9/maleeni/ucd"

// https://www.unicode.org/reports/tr44/#GC_Values_Table
var compositGeneralCategories = map[string][]string{
	// Cased_Letter
	"lc": {"lu", "ll", "lt"},
	// Letter
	"l": {"lu", "ll", "lt", "lm", "lo"},
	// Mark
	"m": {"mm", "mc", "me"},
	// Number
	"n": {"nd", "nl", "no"},
	// Punctuation
	"p": {"pc", "pd", "ps", "pi", "pe", "pf", "po"},
	// Symbol
	"s": {"sm", "sc", "sk", "so"},
	// Separator
	"z": {"zs", "zl", "zp"},
	// Other
	"c": {"cc", "cf", "cs", "co", "cn"},
}

// https://www.unicode.org/Public/13.0.0/ucd/PropertyAliases.txt
var propertyNameAbbs = map[string]string{
    "generalcategory": "gc",
    "gc": "gc",
}

// https://www.unicode.org/Public/13.0.0/ucd/PropertyValueAliases.txt
var generalCategoryValueAbbs = map[string]string{ {{ range $long, $abb := .PropertyValueAliases.GeneralCategory }}
    "{{ $long }}": "{{ $abb }}",{{ end }}
}

// https://www.unicode.org/Public/13.0.0/ucd/UnicodeData.txt
var generalCategoryCodePoints = map[string][]*ucd.CodePointRange{ {{ range $propName, $codePoints := .UnicodeData.GeneralCategory }}
	"{{ $propName }}": { {{ range $codePoints }}
	   &ucd.CodePointRange{From: rune({{ .From }}), To: rune({{ .To }})},{{ end }}
	},{{ end }}
}