Skip to content

Commit 8db23f8

Browse files
rscgopherbot
authored andcommitted
all: gofmt
Gofmt to update doc comments to the new formatting. For golang/go#51082. Change-Id: I3e3c5666d5e901f2c5303911ddb548e3dd567fce Reviewed-on: https://go-review.googlesource.com/c/text/+/399603 Run-TryBot: Russ Cox <rsc@golang.org> TryBot-Result: Gopher Robot <gobot@golang.org> Auto-Submit: Russ Cox <rsc@golang.org> Reviewed-by: Ian Lance Taylor <iant@google.com>
1 parent d1c84af commit 8db23f8

34 files changed

+528
-453
lines changed

cases/gen_trieval.go

+38-35
Original file line numberDiff line numberDiff line change
@@ -19,19 +19,19 @@ package main
1919
//
2020
// The per-rune values have the following format:
2121
//
22-
// if (exception) {
23-
// 15..4 unsigned exception index
24-
// } else {
25-
// 15..8 XOR pattern or index to XOR pattern for case mapping
26-
// Only 13..8 are used for XOR patterns.
27-
// 7 inverseFold (fold to upper, not to lower)
28-
// 6 index: interpret the XOR pattern as an index
29-
// or isMid if case mode is cIgnorableUncased.
30-
// 5..4 CCC: zero (normal or break), above or other
31-
// }
32-
// 3 exception: interpret this value as an exception index
33-
// (TODO: is this bit necessary? Probably implied from case mode.)
34-
// 2..0 case mode
22+
// if (exception) {
23+
// 15..4 unsigned exception index
24+
// } else {
25+
// 15..8 XOR pattern or index to XOR pattern for case mapping
26+
// Only 13..8 are used for XOR patterns.
27+
// 7 inverseFold (fold to upper, not to lower)
28+
// 6 index: interpret the XOR pattern as an index
29+
// or isMid if case mode is cIgnorableUncased.
30+
// 5..4 CCC: zero (normal or break), above or other
31+
// }
32+
// 3 exception: interpret this value as an exception index
33+
// (TODO: is this bit necessary? Probably implied from case mode.)
34+
// 2..0 case mode
3535
//
3636
// For the non-exceptional cases, a rune must be either uncased, lowercase or
3737
// uppercase. If the rune is cased, the XOR pattern maps either a lowercase
@@ -133,37 +133,40 @@ const (
133133
// The entry is pointed to by the exception index in an entry. It has the
134134
// following format:
135135
//
136-
// Header
137-
// byte 0:
138-
// 7..6 unused
139-
// 5..4 CCC type (same bits as entry)
140-
// 3 unused
141-
// 2..0 length of fold
136+
// Header:
142137
//
143-
// byte 1:
144-
// 7..6 unused
145-
// 5..3 length of 1st mapping of case type
146-
// 2..0 length of 2nd mapping of case type
138+
// byte 0:
139+
// 7..6 unused
140+
// 5..4 CCC type (same bits as entry)
141+
// 3 unused
142+
// 2..0 length of fold
147143
//
148-
// case 1st 2nd
149-
// lower -> upper, title
150-
// upper -> lower, title
151-
// title -> lower, upper
144+
// byte 1:
145+
// 7..6 unused
146+
// 5..3 length of 1st mapping of case type
147+
// 2..0 length of 2nd mapping of case type
148+
//
149+
// case 1st 2nd
150+
// lower -> upper, title
151+
// upper -> lower, title
152+
// title -> lower, upper
152153
//
153154
// Lengths with the value 0x7 indicate no value and implies no change.
154155
// A length of 0 indicates a mapping to zero-length string.
155156
//
156157
// Body bytes:
157-
// case folding bytes
158-
// lowercase mapping bytes
159-
// uppercase mapping bytes
160-
// titlecase mapping bytes
161-
// closure mapping bytes (for NFKC_Casefold). (TODO)
158+
//
159+
// case folding bytes
160+
// lowercase mapping bytes
161+
// uppercase mapping bytes
162+
// titlecase mapping bytes
163+
// closure mapping bytes (for NFKC_Casefold). (TODO)
162164
//
163165
// Fallbacks:
164-
// missing fold -> lower
165-
// missing title -> upper
166-
// all missing -> original rune
166+
//
167+
// missing fold -> lower
168+
// missing title -> upper
169+
// all missing -> original rune
167170
//
168171
// exceptions starts with a dummy byte to enforce that there is no zero index
169172
// value.

cases/trieval.go

+38-35
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

cmd/gotext/doc.go

+13-26
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

collate/build/builder.go

+25-14
Original file line numberDiff line numberDiff line change
@@ -225,26 +225,37 @@ func (t *Tailoring) SetAnchorBefore(anchor string) error {
225225
//
226226
// Examples: create a tailoring for Swedish, where "ä" is ordered after "z"
227227
// at the primary sorting level:
228-
// t := b.Tailoring("se")
229-
// t.SetAnchor("z")
230-
// t.Insert(colltab.Primary, "ä", "")
228+
//
229+
// t := b.Tailoring("se")
230+
// t.SetAnchor("z")
231+
// t.Insert(colltab.Primary, "ä", "")
232+
//
231233
// Order "ü" after "ue" at the secondary sorting level:
232-
// t.SetAnchor("ue")
233-
// t.Insert(colltab.Secondary, "ü","")
234+
//
235+
// t.SetAnchor("ue")
236+
// t.Insert(colltab.Secondary, "ü","")
237+
//
234238
// or
235-
// t.SetAnchor("u")
236-
// t.Insert(colltab.Secondary, "ü", "e")
239+
//
240+
// t.SetAnchor("u")
241+
// t.Insert(colltab.Secondary, "ü", "e")
242+
//
237243
// Order "q" afer "ab" at the secondary level and "Q" after "q"
238244
// at the tertiary level:
239-
// t.SetAnchor("ab")
240-
// t.Insert(colltab.Secondary, "q", "")
241-
// t.Insert(colltab.Tertiary, "Q", "")
245+
//
246+
// t.SetAnchor("ab")
247+
// t.Insert(colltab.Secondary, "q", "")
248+
// t.Insert(colltab.Tertiary, "Q", "")
249+
//
242250
// Order "b" before "a":
243-
// t.SetAnchorBefore("a")
244-
// t.Insert(colltab.Primary, "b", "")
251+
//
252+
// t.SetAnchorBefore("a")
253+
// t.Insert(colltab.Primary, "b", "")
254+
//
245255
// Order "0" after the last primary ignorable:
246-
// t.SetAnchor("<last_primary_ignorable/>")
247-
// t.Insert(colltab.Primary, "0", "")
256+
//
257+
// t.SetAnchor("<last_primary_ignorable/>")
258+
// t.Insert(colltab.Primary, "0", "")
248259
func (t *Tailoring) Insert(level colltab.Level, str, extend string) error {
249260
if t.anchor == nil {
250261
return fmt.Errorf("%s:Insert: no anchor point set for tailoring of %s", t.id, str)

collate/build/colelem.go

+6-2
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,7 @@ func makeCE(ce rawCE) (uint32, error) {
5151
// - n* is the size of the first node in the contraction trie.
5252
// - i* is the index of the first node in the contraction trie.
5353
// - b* is the offset into the contraction collation element table.
54+
//
5455
// See contract.go for details on the contraction trie.
5556
const (
5657
contractID = 0xC0000000
@@ -103,7 +104,8 @@ func makeExpansionHeader(n int) (uint32, error) {
103104
// The collation element, in this case, is of the form
104105
// 11110000 00000000 wwwwwwww vvvvvvvv, where
105106
// - v* is the replacement tertiary weight for the first rune,
106-
// - w* is the replacement tertiary weight for the second rune,
107+
// - w* is the replacement tertiary weight for the second rune.
108+
//
107109
// Tertiary weights of subsequent runes should be replaced with maxTertiary.
108110
// See https://www.unicode.org/reports/tr10/#Compatibility_Decompositions for more details.
109111
const (
@@ -162,7 +164,9 @@ func implicitPrimary(r rune) int {
162164
// primaries (either double primaries or for illegal runes)
163165
// to our own representation.
164166
// A CJK character C is represented in the DUCET as
165-
// [.FBxx.0020.0002.C][.BBBB.0000.0000.C]
167+
//
168+
// [.FBxx.0020.0002.C][.BBBB.0000.0000.C]
169+
//
166170
// We will rewrite these characters to a single CE.
167171
// We assume the CJK values start at 0x8000.
168172
// See https://unicode.org/reports/tr10/#Implicit_Weights

collate/build/contract.go

+14-11
Original file line numberDiff line numberDiff line change
@@ -56,19 +56,22 @@ const (
5656
// entry might still resemble a completed suffix.
5757
// Examples:
5858
// The suffix strings "ab" and "ac" can be represented as:
59-
// []ctEntry{
60-
// {'a', 1, 1, noIndex}, // 'a' by itself does not match, so i is 0xFF.
61-
// {'b', 'c', 0, 1}, // "ab" -> 1, "ac" -> 2
62-
// }
59+
//
60+
// []ctEntry{
61+
// {'a', 1, 1, noIndex}, // 'a' by itself does not match, so i is 0xFF.
62+
// {'b', 'c', 0, 1}, // "ab" -> 1, "ac" -> 2
63+
// }
6364
//
6465
// The suffix strings "ab", "abc", "abd", and "abcd" can be represented as:
65-
// []ctEntry{
66-
// {'a', 1, 1, noIndex}, // 'a' must be followed by 'b'.
67-
// {'b', 1, 2, 1}, // "ab" -> 1, may be followed by 'c' or 'd'.
68-
// {'d', 'd', final, 3}, // "abd" -> 3
69-
// {'c', 4, 1, 2}, // "abc" -> 2, may be followed by 'd'.
70-
// {'d', 'd', final, 4}, // "abcd" -> 4
71-
// }
66+
//
67+
// []ctEntry{
68+
// {'a', 1, 1, noIndex}, // 'a' must be followed by 'b'.
69+
// {'b', 1, 2, 1}, // "ab" -> 1, may be followed by 'c' or 'd'.
70+
// {'d', 'd', final, 3}, // "abd" -> 3
71+
// {'c', 4, 1, 2}, // "abc" -> 2, may be followed by 'd'.
72+
// {'d', 'd', final, 4}, // "abcd" -> 4
73+
// }
74+
//
7275
// See genStateTests in contract_test.go for more examples.
7376
type ctEntry struct {
7477
L uint8 // non-final: byte value to match; final: lowest match in range.

0 commit comments

Comments
 (0)