-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathtokens-all.txt
26734 lines (26734 loc) · 277 KB
/
tokens-all.txt
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
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
Earlier jjr o
version nn o
For in o
the dt o
pre-Go1.18 nn o
specification nn o
without in o
generics nns o
support vb o
see vbp o
The dt o
Go nnp o
Programming nnp o
Language nnp o
Specification nnp o
. . o
[ nn o
For in o
reviewers nns o
: : o
Sections nns o
where wrb o
we prp o
know vbp o
of in o
missing jj o
prose nn o
are vbp o
marked vbn o
like in o
this dt o
. . o
The dt o
markers nns o
will md o
be vb o
removed vbn o
before in o
the dt o
release nn o
. . o
] jj o
Introduction nn o
This dt o
is vbz o
a dt o
reference nn o
manual nn o
for in o
the dt o
Go nnp o
programming nn o
language nn o
. . o
For in o
more jjr o
information nn o
and cc o
other jj o
documents nns o
, , o
see vbp o
golang.org nn o
. . o
Go nnp o
is vbz o
a dt o
general-purpose jj o
language nn o
designed vbn o
with in o
systems nns o
programming nn o
in in o
mind nn o
. . o
It prp o
is vbz o
strongly rb o
typed jj o
and cc o
garbage-collected jj o
and cc o
has vbz o
explicit jj o
support vb o
for in o
concurrent jj o
programming nn o
. . o
Programs nns o
are vbp o
constructed vbn o
from in o
packages nns o
, , o
whose wp$ o
properties nns o
allow vbp o
efficient jj o
management nn o
of in o
dependencies nns o
. . o
The dt o
grammar nn o
is vbz o
compact jj o
and cc o
simple nn o
to to o
parse vb o
, , o
allowing vbg o
for in o
easy jj o
analysis nn o
by in o
automatic jj o
tools nns o
such jj o
as in o
integrated jj o
development nn o
environments nns o
. . o
Notation nnp o
The dt o
syntax nn o
is vbz o
specified vbn o
using vbg o
Extended jj o
Backus-Naur jj o
Form nnp o
( ( o
EBNF nnp b-gpe
) ) o
: : o
Production nn o
= nnp o
production_name nn o
" nnp o
= nnp o
" nnp o
[ nnp o
Expression nn o
] nnp o
" nnp o
. . o
" nn o
. . o
Expression nn o
= nnp o
Alternative jj o
{ ( o
" nnp o
| nnp o
" nnp o
Alternative jj o
} ) o
. . o
Alternative jj o
= nnp o
Term nnp b-person
{ ( o
Term nnp b-person
} ) o
. . o
Term nnp b-person
= nnp o
production_name nn o
| vbp o
token nn o
[ nnp o
" nnp o
… nnp o
" nnp o
token nn o
] nnp o
| vbp o
Group nnp b-person
| vbp o
Option nnp b-person
| vbp o
Repetition nnp o
. . o
Group nnp b-person
= nnp o
" nnp o
( ( o
" jj o
Expression nn o
" nnp o
) ) o
" nn o
. . o
Option nnp b-person
= nnp o
" nnp o
[ nnp o
" nnp o
Expression nn o
" nnp o
] nnp o
" nnp o
. . o
Repetition nnp o
= nnp o
" nnp o
{ ( o
" jj o
Expression nn o
" nnp o
} ) o
" nnp o
. . o
Productions nns o
are vbp o
expressions nns o
constructed vbn o
from in o
terms nns o
and cc o
the dt o
following vbg o
operators nns o
, , o
in in o
increasing vbg o
precedence nn o
: : o
| vbp o
alternation nn o
( ( o
) ) o
grouping vbg o
[ jj o
] nn o
option nn o
( ( o
0 -none- o
or cc o
1 cd o
times nns o
) ) o
{} vbp o
repetition nn o
( ( o
0 -none- o
to to o
n in o
times nns o
) ) o
Lower-case nnp o
production nn o
names vbz o
are vbp o
used vbn o
to to o
identify vb o
lexical jj o
tokens nns o
. . o
Non-terminals nns o
are vbp o
in in o
CamelCase nnp b-gpe
. . o
Lexical jj o
tokens nns o
are vbp o
enclosed vbn o
in in o
double jj o
quotes nns o
or cc o
back rb o
quotes nns o
. . o
The dt o
form nn o
represents vbz o
the dt o
set nn o
of in o
characters nns o
from in o
through in o
as in o
alternatives nns o
. . o
The dt o
horizontal jj o
ellipsis nn o
is vbz o
also rb o
used vbn o
elsewhere rb o
in in o
the dt o
spec nn o
to to o
informally rb o
denote vbp o
various jj o
enumerations nns o
or cc o
code nn o
snippets nns o
that wdt o
are vbp o
not rb o
further jj o
specified vbn o
. . o
The dt o
character nn o
( ( o
as in o
opposed vbn o
to to o
the dt o
three cd o
characters nns o
) ) o
is vbz o
not rb o
a dt o
token nn o
of in o
the dt o
Go nnp o
language nn o
. . o
Source nnp b-gpe
code nn o
representation nn o
Source nnp b-gpe
code nn o
is vbz o
Unicode nnp b-gpe
text nn o
encoded vbn o
in in o
UTF-8 nnp b-gpe
. . o
The dt o
text nn o
is vbz o
not rb o
canonicalized vbn o
, , o
so rb o
a dt o
single jj o
accented jj o
code nn o
point nn o
is vbz o
distinct jj o
from in o
the dt o
same jj o
character nn o
constructed vbn o
from in o
combining vbg o
an dt o
accent nn o
and cc o
a dt o
letter nn o
; : o
those dt o
are vbp o
treated vbn o
as in o
two cd o
code nn o
points nns o
. . o
For in o
simplicity nn o
, , o
this dt o
document nn o
will md o
use vbp o
the dt o
unqualified jj o
term nn o
character nn o
to to o
refer vb o
to to o
a dt o
Unicode nnp b-gpe
code nn o
point nn o
in in o
the dt o
source nn o
text nn o
. . o
Each dt o
code nn o
point nn o
is vbz o
distinct jj o
; : o
for in o
instance nn o
, , o
upper jj o
and cc o
lower jjr o
case nn o
letters nns o
are vbp o
different jj o
characters nns o
. . o
Implementation nnp o
restriction nn o
: : o
For in o
compatibility nn o
with in o
other jj o
tools nns o
, , o
a dt o
compiler nn o
may md o
disallow vb o
the dt o
NUL nnp b-gpe
character nn o
( ( o
U+0000 nnp b-gpe
) ) o
in in o
the dt o
source nn o
text nn o
. . o
Implementation nnp o
restriction nn o
: : o
For in o
compatibility nn o
with in o
other jj o
tools nns o
, , o
a dt o
compiler nn o
may md o
ignore vb o
a dt o
UTF-8-encoded jj o
byte nn o
order nn o
mark nn o
( ( o
U+FEFF nnp b-gpe
) ) o
if in o
it prp o
is vbz o
the dt o
first jj o
Unicode nnp b-gpe
code nn o
point nn o
in in o
the dt o
source nn o
text nn o
. . o
A dt o
byte nn o
order nn o
mark nn o
may md o
be vb o
disallowed vbn o
anywhere rb o
else rb o
in in o
the dt o
source nn o
. . o
Characters nnps o
The dt o
following vbg o
terms nns o
are vbp o
used vbn o
to to o
denote vbp o
specific jj o
Unicode nnp b-gpe
character nn o
classes nns o
: : o
In in o
The dt o
Unicode nnp b-gpe
Standard nnp o
8.0 cd o
, , o
Section nn o
4.5 cd o
" nnp o
General nnp o
Category nnp o
" nnp o
defines vbz o
a dt o
set nn o
of in o
character nn o
categories nns o
. . o
Go nnp o
treats in o
all pdt o
characters nns o
in in o
any dt o
of in o
the dt o
Letter nnp o
categories nns o
Lu nnp o
, , o
Ll nnp b-gpe
, , o
Lt nnp b-gpe
, , o
Lm nnp b-gpe
, , o
or cc o
Lo nnp o
as in o
Unicode nnp b-gpe
letters nns o
, , o
and cc o
those dt o
in in o
the dt o
Number nnp o
category nn o
Nd nnp o
as in o
Unicode nnp b-gpe
digits nns o
. . o
Letters nns o
and cc o
digits nns o
The dt o
underscore jj o
character nn o
( ( o
U+005F nnp b-gpe
) ) o
is vbz o
considered vbn o
a dt o
letter nn o
. . o
Lexical jj o
elements nns o
Comments nns o
Comments nns o
serve vbp o
as in o
program nn o
documentation nn o
. . o
There ex o
are vbp o
two cd o
forms nns o
: : o
Line nnp o
comments nns o
start vb o
with in o
the dt o
character nn o
sequence nn o
and cc o
stop vb o
at in o
the dt o
end nn o
of in o
the dt o
line nn o
. . o
General jj o
comments nns o
start vb o
with in o
the dt o
character nn o
sequence nn o
and cc o
stop vb o
with in o
the dt o
first jj o
subsequent jj o
character nn o
sequence nn o
. . o
A dt o
comment nn o
cannot vbp o
start vb o
inside in o
a dt o
rune nns o
or cc o
string vbg o
literal jj o
, , o
or cc o
inside in o
a dt o
comment nn o
. . o
A dt o
general jj o
comment nn o
containing vbg o
no dt o
newlines nns o
acts vbz o
like in o
a dt o
space nn o
. . o
Any dt o
other jj o
comment nn o
acts vbz o
like in o
a dt o
newline nn o
. . o
Tokens jj b-gpe
Tokens jj b-gpe
form nn o
the dt o
vocabulary nn o
of in o
the dt o
Go nnp o
language nn o
. . o
There ex o
are vbp o
four cd o
classes nns o
: : o
identifiers nns o
, , o
keywords nns o
, , o
operators nns o
and cc o
punctuation nn o
, , o
and cc o
literals nns o
. . o
White nnp b-person
space nn o
, , o
formed vbn o
from in o
spaces nns o
( ( o
U+0020 nnp b-gpe
) ) o
, , o
horizontal jj o
tabs nn o
( ( o
U+0009 nnp b-gpe
) ) o
, , o
carriage nn o
returns nns o
( ( o
U+000D nnp b-gpe
) ) o
, , o
and cc o
newlines nns o
( ( o
U+000A nnp b-gpe
) ) o
, , o
is vbz o
ignored vbn o
except vb o
as in o
it prp o
separates vbz o
tokens nns o
that wdt o
would md o
otherwise rb o
combine vb o
into in o
a dt o
single jj o
token nn o
. . o
Also rb o
, , o
a dt o
newline nn o
or cc o
end nn o
of in o
file nn o
may md o
trigger vbp o
the dt o
insertion nn o
of in o
a dt o
semicolon nn o
. . o
While in o
breaking vbg o
the dt o
input nn o
into in o
tokens nns o
, , o
the dt o
next jj o
token nn o
is vbz o
the dt o
longest jjs o
sequence nn o
of in o
characters nns o
that wdt o
form nn o
a dt o
valid jj o
token nn o
. . o
Semicolons nnps o
The dt o
formal jj o
grammar nn o
uses nns o
semicolons nns o
as in o
terminators nns o
in in o
a dt o
number nn o
of in o
productions nns o
. . o
Go nnp o
programs nns o
may md o
omit vb o
most jjs o
of in o
these dt o
semicolons nns o
using vbg o
the dt o
following vbg o
two cd o
rules nns o
: : o
When wrb o
the dt o
input nn o
is vbz o
broken vbn o
into in o
tokens nns o
, , o
a dt o
semicolon nn o
is vbz o
automatically rb o
inserted vbn o
into in o
the dt o
token nn o
stream nn o
immediately rb o
after in o
a dt o
line nn o
's pos o
final jj o
token nn o
if in o
that wdt o
token nn o
is vbz o
an dt o
identifier nn o
an dt o
integer nn o
, , o
floating-point jj o
, , o
imaginary jj o
, , o
rune nn o
, , o
or cc o
string vbg o
literal nn o
one nn o
of in o
the dt o
keywords nns o
, , o
, , o
, , o
or cc o
one nn o
of in o
the dt o
operators nns o
and cc o
punctuation nn o
, , o
, , o
, , o
, , o
or cc o
To to o
allow vbp o
complex jj o
statements nns o
to to o
occupy vb o
a dt o
single jj o
line nn o
, , o
a dt o
semicolon nn o
may md o
be vb o
omitted vbn o
before in o
a dt o
closing vbg o
or cc o
. . o
To to o
reflect vb o
idiomatic jj o
use vb o
, , o
code nn o
examples nns o
in in o
this dt o
document nn o
elide vb o
semicolons nns o
using vbg o
these dt o
rules nns o
. . o
Identifiers nnps o
Identifiers nnps o
name nn o
program nn o
entities nns o
such jj o
as in o
variables nns o
and cc o
types nns o
. . o
An dt o
identifier nn o
is vbz o
a dt o
sequence nn o
of in o
one nn o
or cc o
more jjr o
letters nns o
and cc o
digits nns o
. . o
The dt o
first jj o
character nn o
in in o
an dt o
identifier nn o
must md o
be vb o
a dt o
letter nn o
. . o
Some dt o
identifiers nns o
are vbp o
predeclared vbn o
. . o
Keywords vb o
The dt o
following vbg o
keywords nns o
are vbp o
reserved vbn o
and cc o
may md o
not rb o
be vb o
used vbn o
as in o
identifiers nns o
. . o
break nn o
default nn o
func nn o
interface nn o
select nn o
case nn o
defer nn o
go vbp o
map nn o
struct nn o
chan vbp o
else rb o
goto jj o
package nn o
switch vb o
const nn o
fallthrough in o
if in o
range nn o
type nn o
continue nn o
for in o
import nn o
return vb o
var nn o
Operators nnps o
and cc o
punctuation nn o
The dt o
following vbg o
character nn o
sequences vbz o
represent vbp o
operators nns o
( ( o
including vbg o
assignment nn o
operators nns o
) ) o
and cc o
punctuation nn o
: : o
+ jj o
& cc o
+= vbd o
&= nnp o
&& nnp o
== cc o
!= nn o
( ( o
) ) o
- - o
| vbp o
-= nnp o
|= nnp o
|| nnp o
< nnp o