1// Copyright 2015 The Go Authors. All rights reserved.
2// Use of this source code is governed by a BSD-style
3// license that can be found in the LICENSE file.
4
5//go:build ignore
6// +build ignore
7
8package main
9
10// entry is the entry of a trie table
11// 7..6   property (unassigned, disallowed, maybe, valid)
12// 5..0   category
13type entry uint8
14
15const (
16	propShift = 6
17	propMask  = 0xc0
18	catMask   = 0x3f
19)
20
21func (e entry) property() property { return property(e & propMask) }
22func (e entry) category() category { return category(e & catMask) }
23
24type property uint8
25
26// The order of these constants matter. A Profile may consider runes to be
27// allowed either from pValid or idDisOrFreePVal.
28const (
29	unassigned property = iota << propShift
30	disallowed
31	idDisOrFreePVal // disallowed for Identifier, pValid for FreeForm
32	pValid
33)
34
35// compute permutations of all properties and specialCategories.
36type category uint8
37
38const (
39	other category = iota
40
41	// Special rune types
42	joiningL
43	joiningD
44	joiningT
45	joiningR
46	viramaModifier
47	viramaJoinT // Virama + JoiningT
48	latinSmallL // U+006c
49	greek
50	greekJoinT // Greek + JoiningT
51	hebrew
52	hebrewJoinT // Hebrew + JoiningT
53	japanese    // hirigana, katakana, han
54
55	// Special rune types associated with contextual rules defined in
56	// https://tools.ietf.org/html/rfc5892#appendix-A.
57	// ContextO
58	zeroWidthNonJoiner // rule 1
59	zeroWidthJoiner    // rule 2
60	// ContextJ
61	middleDot                // rule 3
62	greekLowerNumeralSign    // rule 4
63	hebrewPreceding          // rule 5 and 6
64	katakanaMiddleDot        // rule 7
65	arabicIndicDigit         // rule 8
66	extendedArabicIndicDigit // rule 9
67
68	numCategories
69)
70