File: basiclit.txt

package info (click to toggle)
golang-golang-x-tools 1%3A0.25.0%2Bds-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, trixie
  • size: 22,724 kB
  • sloc: javascript: 2,027; asm: 1,645; sh: 166; yacc: 155; makefile: 49; ansic: 8
file content (87 lines) | stat: -rw-r--r-- 2,925 bytes parent folder | download | duplicates (2)
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
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
This test checks gopls behavior when hovering over basic literals.

Skipped on ppc64 as there appears to be a bug on aix-ppc64: golang/go#67526.

-- flags --
-skip_goarch=ppc64

-- basiclit.go --
package basiclit

func _() {
	_ = 'a' //@hover("'a'", "'a'", latinA)
	_ = 0x61 //@hover("0x61", "0x61", latinAHex)

	_ = '\u2211' //@hover("'\\u2211'", "'\\u2211'", summation)
	_ = 0x2211 //@hover("0x2211", "0x2211", summationHex)
	_ = "foo \u2211 bar" //@hover("\\u2211", "\\u2211", summation)

	_ = '\a' //@hover("'\\a'", "'\\a'", control)
	_ = "foo \a bar" //@hover("\\a", "\\a", control)

	_ = '\U0001F30A' //@hover("'\\U0001F30A'", "'\\U0001F30A'", waterWave)
	_ = 0x0001F30A //@hover("0x0001F30A", "0x0001F30A", waterWaveHex)
	_ = 0X0001F30A //@hover("0X0001F30A", "0X0001F30A", waterWaveHex)
	_ = "foo \U0001F30A bar" //@hover("\\U0001F30A", "\\U0001F30A", waterWave)

	_ = '\x7E' //@hover("'\\x7E'", "'\\x7E'", tilde)
	_ = "foo \x7E bar" //@hover("\\x7E", "\\x7E", tilde)
	_ = "foo \a bar" //@hover("\\a", "\\a", control)

	_ = '\173' //@hover("'\\173'", "'\\173'", leftCurly)
	_ = "foo \173 bar" //@hover("\\173","\\173", leftCurly)
	_ = "foo \173 bar \u2211 baz" //@hover("\\173","\\173", leftCurly)
	_ = "foo \173 bar \u2211 baz" //@hover("\\u2211","\\u2211", summation)
	_ = "foo\173bar\u2211baz" //@hover("\\173","\\173", leftCurly)
	_ = "foo\173bar\u2211baz" //@hover("\\u2211","\\u2211", summation)

	// search for runes in string only if there is an escaped sequence
	_ = "hello" //@hover(`"hello"`, _, _)

	// incorrect escaped rune sequences
	_ = '\0' //@hover("'\\0'", _, _),diag(re`\\0()'`, re"illegal character")
	_ = '\u22111' //@hover("'\\u22111'", _, _)
	_ = '\U00110000' //@hover("'\\U00110000'", _, _)
	_ = '\u12e45'//@hover("'\\u12e45'", _, _)
	_ = '\xa' //@hover("'\\xa'", _, _)
	_ = 'aa' //@hover("'aa'", _, _)

	// other basic lits
	_ = 1 //@hover("1", _, _)
	_ = 1.2 //@hover("1.2", _, _)
	_ = 1.2i //@hover("1.2i", _, _)
	_ = 0123 //@hover("0123", _, _)
	_ = 0b1001 //@hover("0b", "0b1001", binaryNumber)
	_ = 0B1001 //@hover("0B", "0B1001", binaryNumber)
	_ = 0o77 //@hover("0o", "0o77", octalNumber)
	_ = 0O77 //@hover("0O", "0O77", octalNumber)
	_ = 0x1234567890 //@hover("0x1234567890", "0x1234567890", hexNumber)
	_ = 0X1234567890 //@hover("0X1234567890", "0X1234567890", hexNumber)
	_ = 0x1000000000000000000 //@hover("0x1", "0x1000000000000000000", bigHex)
)
-- @bigHex --
4722366482869645213696
-- @binaryNumber --
9
-- @control --
U+0007, control
-- @hexNumber --
78187493520
-- @latinA --
'a', U+0061, LATIN SMALL LETTER A
-- @latinAHex --
97, 'a', U+0061, LATIN SMALL LETTER A
-- @leftCurly --
'{', U+007B, LEFT CURLY BRACKET
-- @octalNumber --
63
-- @summation --
'∑', U+2211, N-ARY SUMMATION
-- @summationHex --
8721, '∑', U+2211, N-ARY SUMMATION
-- @tilde --
'~', U+007E, TILDE
-- @waterWave --
'🌊', U+1F30A, WATER WAVE
-- @waterWaveHex --
127754, '🌊', U+1F30A, WATER WAVE