-
Notifications
You must be signed in to change notification settings - Fork 148
/
Copy pathgo_ast.htm
3143 lines (1554 loc) · 206 KB
/
go_ast.htm
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
<!DOCTYPE html>
<html lang="en">
<head profile="http://a9.com/-/spec/opensearch/1.1/">
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link href="../assets/site.css" rel="stylesheet">
<title>go/ast</title>
<meta name="twitter:title" content="Package ast">
<meta property="og:title" content="Package ast">
<meta name="description" content="Package ast declares the types used to represent syntax trees for Go packages.">
<meta name="twitter:description" content="Package ast declares the types used to represent syntax trees for Go packages.">
<meta property="og:description" content="Package ast declares the types used to represent syntax trees for Go packages.">
<meta name="twitter:card" content="summary">
<meta name="twitter:site" content="@golang">
</head>
<body>
<div class="container">
<h2 id="pkg-overview">package ast</h2>
<p><code>import "go/ast"</code>
<p>
Package ast declares the types used to represent syntax trees for Go
packages.</p>
<h3 id="pkg-index" class="section-header">Index <a class="permalink" href="#pkg-index">¶</a></h3>
<ul class="list-unstyled">
<li><a href="#FileExports">func FileExports(src *File) bool</a></li><li><a href="#FilterDecl">func FilterDecl(decl Decl, f Filter) bool</a></li><li><a href="#FilterFile">func FilterFile(src *File, f Filter) bool</a></li><li><a href="#FilterPackage">func FilterPackage(pkg *Package, f Filter) bool</a></li><li><a href="#Fprint">func Fprint(w io.Writer, fset *token.FileSet, x interface{}, f FieldFilter) error</a></li><li><a href="#Inspect">func Inspect(node Node, f func(Node) bool)</a></li><li><a href="#IsExported">func IsExported(name string) bool</a></li><li><a href="#NotNilFilter">func NotNilFilter(_ string, v reflect.Value) bool</a></li><li><a href="#PackageExports">func PackageExports(pkg *Package) bool</a></li><li><a href="#Print">func Print(fset *token.FileSet, x interface{}) error</a></li><li><a href="#SortImports">func SortImports(fset *token.FileSet, f *File)</a></li><li><a href="#Walk">func Walk(v Visitor, node Node)</a></li>
<li><a href="#ArrayType">type ArrayType</a></li>
<ul>
<li><a href="#ArrayType.End">func (x *ArrayType) End() token.Pos</a></li><li><a href="#ArrayType.Pos">func (x *ArrayType) Pos() token.Pos</a></li>
</ul>
<li><a href="#AssignStmt">type AssignStmt</a></li>
<ul>
<li><a href="#AssignStmt.End">func (s *AssignStmt) End() token.Pos</a></li><li><a href="#AssignStmt.Pos">func (s *AssignStmt) Pos() token.Pos</a></li>
</ul>
<li><a href="#BadDecl">type BadDecl</a></li>
<ul>
<li><a href="#BadDecl.End">func (d *BadDecl) End() token.Pos</a></li><li><a href="#BadDecl.Pos">func (d *BadDecl) Pos() token.Pos</a></li>
</ul>
<li><a href="#BadExpr">type BadExpr</a></li>
<ul>
<li><a href="#BadExpr.End">func (x *BadExpr) End() token.Pos</a></li><li><a href="#BadExpr.Pos">func (x *BadExpr) Pos() token.Pos</a></li>
</ul>
<li><a href="#BadStmt">type BadStmt</a></li>
<ul>
<li><a href="#BadStmt.End">func (s *BadStmt) End() token.Pos</a></li><li><a href="#BadStmt.Pos">func (s *BadStmt) Pos() token.Pos</a></li>
</ul>
<li><a href="#BasicLit">type BasicLit</a></li>
<ul>
<li><a href="#BasicLit.End">func (x *BasicLit) End() token.Pos</a></li><li><a href="#BasicLit.Pos">func (x *BasicLit) Pos() token.Pos</a></li>
</ul>
<li><a href="#BinaryExpr">type BinaryExpr</a></li>
<ul>
<li><a href="#BinaryExpr.End">func (x *BinaryExpr) End() token.Pos</a></li><li><a href="#BinaryExpr.Pos">func (x *BinaryExpr) Pos() token.Pos</a></li>
</ul>
<li><a href="#BlockStmt">type BlockStmt</a></li>
<ul>
<li><a href="#BlockStmt.End">func (s *BlockStmt) End() token.Pos</a></li><li><a href="#BlockStmt.Pos">func (s *BlockStmt) Pos() token.Pos</a></li>
</ul>
<li><a href="#BranchStmt">type BranchStmt</a></li>
<ul>
<li><a href="#BranchStmt.End">func (s *BranchStmt) End() token.Pos</a></li><li><a href="#BranchStmt.Pos">func (s *BranchStmt) Pos() token.Pos</a></li>
</ul>
<li><a href="#CallExpr">type CallExpr</a></li>
<ul>
<li><a href="#CallExpr.End">func (x *CallExpr) End() token.Pos</a></li><li><a href="#CallExpr.Pos">func (x *CallExpr) Pos() token.Pos</a></li>
</ul>
<li><a href="#CaseClause">type CaseClause</a></li>
<ul>
<li><a href="#CaseClause.End">func (s *CaseClause) End() token.Pos</a></li><li><a href="#CaseClause.Pos">func (s *CaseClause) Pos() token.Pos</a></li>
</ul>
<li><a href="#ChanDir">type ChanDir</a></li>
<li><a href="#ChanType">type ChanType</a></li>
<ul>
<li><a href="#ChanType.End">func (x *ChanType) End() token.Pos</a></li><li><a href="#ChanType.Pos">func (x *ChanType) Pos() token.Pos</a></li>
</ul>
<li><a href="#CommClause">type CommClause</a></li>
<ul>
<li><a href="#CommClause.End">func (s *CommClause) End() token.Pos</a></li><li><a href="#CommClause.Pos">func (s *CommClause) Pos() token.Pos</a></li>
</ul>
<li><a href="#Comment">type Comment</a></li>
<ul>
<li><a href="#Comment.End">func (c *Comment) End() token.Pos</a></li><li><a href="#Comment.Pos">func (c *Comment) Pos() token.Pos</a></li>
</ul>
<li><a href="#CommentGroup">type CommentGroup</a></li>
<ul>
<li><a href="#CommentGroup.End">func (g *CommentGroup) End() token.Pos</a></li><li><a href="#CommentGroup.Pos">func (g *CommentGroup) Pos() token.Pos</a></li><li><a href="#CommentGroup.Text">func (g *CommentGroup) Text() string</a></li>
</ul>
<li><a href="#CommentMap">type CommentMap</a></li>
<ul>
<li><a href="#NewCommentMap">func NewCommentMap(fset *token.FileSet, node Node, comments []*CommentGroup) CommentMap</a></li>
<li><a href="#CommentMap.Comments">func (cmap CommentMap) Comments() []*CommentGroup</a></li><li><a href="#CommentMap.Filter">func (cmap CommentMap) Filter(node Node) CommentMap</a></li><li><a href="#CommentMap.String">func (cmap CommentMap) String() string</a></li><li><a href="#CommentMap.Update">func (cmap CommentMap) Update(old, new Node) Node</a></li>
</ul>
<li><a href="#CompositeLit">type CompositeLit</a></li>
<ul>
<li><a href="#CompositeLit.End">func (x *CompositeLit) End() token.Pos</a></li><li><a href="#CompositeLit.Pos">func (x *CompositeLit) Pos() token.Pos</a></li>
</ul>
<li><a href="#Decl">type Decl</a></li>
<li><a href="#DeclStmt">type DeclStmt</a></li>
<ul>
<li><a href="#DeclStmt.End">func (s *DeclStmt) End() token.Pos</a></li><li><a href="#DeclStmt.Pos">func (s *DeclStmt) Pos() token.Pos</a></li>
</ul>
<li><a href="#DeferStmt">type DeferStmt</a></li>
<ul>
<li><a href="#DeferStmt.End">func (s *DeferStmt) End() token.Pos</a></li><li><a href="#DeferStmt.Pos">func (s *DeferStmt) Pos() token.Pos</a></li>
</ul>
<li><a href="#Ellipsis">type Ellipsis</a></li>
<ul>
<li><a href="#Ellipsis.End">func (x *Ellipsis) End() token.Pos</a></li><li><a href="#Ellipsis.Pos">func (x *Ellipsis) Pos() token.Pos</a></li>
</ul>
<li><a href="#EmptyStmt">type EmptyStmt</a></li>
<ul>
<li><a href="#EmptyStmt.End">func (s *EmptyStmt) End() token.Pos</a></li><li><a href="#EmptyStmt.Pos">func (s *EmptyStmt) Pos() token.Pos</a></li>
</ul>
<li><a href="#Expr">type Expr</a></li>
<li><a href="#ExprStmt">type ExprStmt</a></li>
<ul>
<li><a href="#ExprStmt.End">func (s *ExprStmt) End() token.Pos</a></li><li><a href="#ExprStmt.Pos">func (s *ExprStmt) Pos() token.Pos</a></li>
</ul>
<li><a href="#Field">type Field</a></li>
<ul>
<li><a href="#Field.End">func (f *Field) End() token.Pos</a></li><li><a href="#Field.Pos">func (f *Field) Pos() token.Pos</a></li>
</ul>
<li><a href="#FieldFilter">type FieldFilter</a></li>
<li><a href="#FieldList">type FieldList</a></li>
<ul>
<li><a href="#FieldList.End">func (f *FieldList) End() token.Pos</a></li><li><a href="#FieldList.NumFields">func (f *FieldList) NumFields() int</a></li><li><a href="#FieldList.Pos">func (f *FieldList) Pos() token.Pos</a></li>
</ul>
<li><a href="#File">type File</a></li>
<ul>
<li><a href="#MergePackageFiles">func MergePackageFiles(pkg *Package, mode MergeMode) *File</a></li>
<li><a href="#File.End">func (f *File) End() token.Pos</a></li><li><a href="#File.Pos">func (f *File) Pos() token.Pos</a></li>
</ul>
<li><a href="#Filter">type Filter</a></li>
<li><a href="#ForStmt">type ForStmt</a></li>
<ul>
<li><a href="#ForStmt.End">func (s *ForStmt) End() token.Pos</a></li><li><a href="#ForStmt.Pos">func (s *ForStmt) Pos() token.Pos</a></li>
</ul>
<li><a href="#FuncDecl">type FuncDecl</a></li>
<ul>
<li><a href="#FuncDecl.End">func (d *FuncDecl) End() token.Pos</a></li><li><a href="#FuncDecl.Pos">func (d *FuncDecl) Pos() token.Pos</a></li>
</ul>
<li><a href="#FuncLit">type FuncLit</a></li>
<ul>
<li><a href="#FuncLit.End">func (x *FuncLit) End() token.Pos</a></li><li><a href="#FuncLit.Pos">func (x *FuncLit) Pos() token.Pos</a></li>
</ul>
<li><a href="#FuncType">type FuncType</a></li>
<ul>
<li><a href="#FuncType.End">func (x *FuncType) End() token.Pos</a></li><li><a href="#FuncType.Pos">func (x *FuncType) Pos() token.Pos</a></li>
</ul>
<li><a href="#GenDecl">type GenDecl</a></li>
<ul>
<li><a href="#GenDecl.End">func (d *GenDecl) End() token.Pos</a></li><li><a href="#GenDecl.Pos">func (d *GenDecl) Pos() token.Pos</a></li>
</ul>
<li><a href="#GoStmt">type GoStmt</a></li>
<ul>
<li><a href="#GoStmt.End">func (s *GoStmt) End() token.Pos</a></li><li><a href="#GoStmt.Pos">func (s *GoStmt) Pos() token.Pos</a></li>
</ul>
<li><a href="#Ident">type Ident</a></li>
<ul>
<li><a href="#NewIdent">func NewIdent(name string) *Ident</a></li>
<li><a href="#Ident.End">func (x *Ident) End() token.Pos</a></li><li><a href="#Ident.IsExported">func (id *Ident) IsExported() bool</a></li><li><a href="#Ident.Pos">func (x *Ident) Pos() token.Pos</a></li><li><a href="#Ident.String">func (id *Ident) String() string</a></li>
</ul>
<li><a href="#IfStmt">type IfStmt</a></li>
<ul>
<li><a href="#IfStmt.End">func (s *IfStmt) End() token.Pos</a></li><li><a href="#IfStmt.Pos">func (s *IfStmt) Pos() token.Pos</a></li>
</ul>
<li><a href="#ImportSpec">type ImportSpec</a></li>
<ul>
<li><a href="#ImportSpec.End">func (s *ImportSpec) End() token.Pos</a></li><li><a href="#ImportSpec.Pos">func (s *ImportSpec) Pos() token.Pos</a></li>
</ul>
<li><a href="#Importer">type Importer</a></li>
<li><a href="#IncDecStmt">type IncDecStmt</a></li>
<ul>
<li><a href="#IncDecStmt.End">func (s *IncDecStmt) End() token.Pos</a></li><li><a href="#IncDecStmt.Pos">func (s *IncDecStmt) Pos() token.Pos</a></li>
</ul>
<li><a href="#IndexExpr">type IndexExpr</a></li>
<ul>
<li><a href="#IndexExpr.End">func (x *IndexExpr) End() token.Pos</a></li><li><a href="#IndexExpr.Pos">func (x *IndexExpr) Pos() token.Pos</a></li>
</ul>
<li><a href="#InterfaceType">type InterfaceType</a></li>
<ul>
<li><a href="#InterfaceType.End">func (x *InterfaceType) End() token.Pos</a></li><li><a href="#InterfaceType.Pos">func (x *InterfaceType) Pos() token.Pos</a></li>
</ul>
<li><a href="#KeyValueExpr">type KeyValueExpr</a></li>
<ul>
<li><a href="#KeyValueExpr.End">func (x *KeyValueExpr) End() token.Pos</a></li><li><a href="#KeyValueExpr.Pos">func (x *KeyValueExpr) Pos() token.Pos</a></li>
</ul>
<li><a href="#LabeledStmt">type LabeledStmt</a></li>
<ul>
<li><a href="#LabeledStmt.End">func (s *LabeledStmt) End() token.Pos</a></li><li><a href="#LabeledStmt.Pos">func (s *LabeledStmt) Pos() token.Pos</a></li>
</ul>
<li><a href="#MapType">type MapType</a></li>
<ul>
<li><a href="#MapType.End">func (x *MapType) End() token.Pos</a></li><li><a href="#MapType.Pos">func (x *MapType) Pos() token.Pos</a></li>
</ul>
<li><a href="#MergeMode">type MergeMode</a></li>
<li><a href="#Node">type Node</a></li>
<li><a href="#ObjKind">type ObjKind</a></li>
<ul>
<li><a href="#ObjKind.String">func (kind ObjKind) String() string</a></li>
</ul>
<li><a href="#Object">type Object</a></li>
<ul>
<li><a href="#NewObj">func NewObj(kind ObjKind, name string) *Object</a></li>
<li><a href="#Object.Pos">func (obj *Object) Pos() token.Pos</a></li>
</ul>
<li><a href="#Package">type Package</a></li>
<ul>
<li><a href="#NewPackage">func NewPackage(fset *token.FileSet, files map[string]*File, importer Importer, universe *Scope) (*Package, error)</a></li>
<li><a href="#Package.End">func (p *Package) End() token.Pos</a></li><li><a href="#Package.Pos">func (p *Package) Pos() token.Pos</a></li>
</ul>
<li><a href="#ParenExpr">type ParenExpr</a></li>
<ul>
<li><a href="#ParenExpr.End">func (x *ParenExpr) End() token.Pos</a></li><li><a href="#ParenExpr.Pos">func (x *ParenExpr) Pos() token.Pos</a></li>
</ul>
<li><a href="#RangeStmt">type RangeStmt</a></li>
<ul>
<li><a href="#RangeStmt.End">func (s *RangeStmt) End() token.Pos</a></li><li><a href="#RangeStmt.Pos">func (s *RangeStmt) Pos() token.Pos</a></li>
</ul>
<li><a href="#ReturnStmt">type ReturnStmt</a></li>
<ul>
<li><a href="#ReturnStmt.End">func (s *ReturnStmt) End() token.Pos</a></li><li><a href="#ReturnStmt.Pos">func (s *ReturnStmt) Pos() token.Pos</a></li>
</ul>
<li><a href="#Scope">type Scope</a></li>
<ul>
<li><a href="#NewScope">func NewScope(outer *Scope) *Scope</a></li>
<li><a href="#Scope.Insert">func (s *Scope) Insert(obj *Object) (alt *Object)</a></li><li><a href="#Scope.Lookup">func (s *Scope) Lookup(name string) *Object</a></li><li><a href="#Scope.String">func (s *Scope) String() string</a></li>
</ul>
<li><a href="#SelectStmt">type SelectStmt</a></li>
<ul>
<li><a href="#SelectStmt.End">func (s *SelectStmt) End() token.Pos</a></li><li><a href="#SelectStmt.Pos">func (s *SelectStmt) Pos() token.Pos</a></li>
</ul>
<li><a href="#SelectorExpr">type SelectorExpr</a></li>
<ul>
<li><a href="#SelectorExpr.End">func (x *SelectorExpr) End() token.Pos</a></li><li><a href="#SelectorExpr.Pos">func (x *SelectorExpr) Pos() token.Pos</a></li>
</ul>
<li><a href="#SendStmt">type SendStmt</a></li>
<ul>
<li><a href="#SendStmt.End">func (s *SendStmt) End() token.Pos</a></li><li><a href="#SendStmt.Pos">func (s *SendStmt) Pos() token.Pos</a></li>
</ul>
<li><a href="#SliceExpr">type SliceExpr</a></li>
<ul>
<li><a href="#SliceExpr.End">func (x *SliceExpr) End() token.Pos</a></li><li><a href="#SliceExpr.Pos">func (x *SliceExpr) Pos() token.Pos</a></li>
</ul>
<li><a href="#Spec">type Spec</a></li>
<li><a href="#StarExpr">type StarExpr</a></li>
<ul>
<li><a href="#StarExpr.End">func (x *StarExpr) End() token.Pos</a></li><li><a href="#StarExpr.Pos">func (x *StarExpr) Pos() token.Pos</a></li>
</ul>
<li><a href="#Stmt">type Stmt</a></li>
<li><a href="#StructType">type StructType</a></li>
<ul>
<li><a href="#StructType.End">func (x *StructType) End() token.Pos</a></li><li><a href="#StructType.Pos">func (x *StructType) Pos() token.Pos</a></li>
</ul>
<li><a href="#SwitchStmt">type SwitchStmt</a></li>
<ul>
<li><a href="#SwitchStmt.End">func (s *SwitchStmt) End() token.Pos</a></li><li><a href="#SwitchStmt.Pos">func (s *SwitchStmt) Pos() token.Pos</a></li>
</ul>
<li><a href="#TypeAssertExpr">type TypeAssertExpr</a></li>
<ul>
<li><a href="#TypeAssertExpr.End">func (x *TypeAssertExpr) End() token.Pos</a></li><li><a href="#TypeAssertExpr.Pos">func (x *TypeAssertExpr) Pos() token.Pos</a></li>
</ul>
<li><a href="#TypeSpec">type TypeSpec</a></li>
<ul>
<li><a href="#TypeSpec.End">func (s *TypeSpec) End() token.Pos</a></li><li><a href="#TypeSpec.Pos">func (s *TypeSpec) Pos() token.Pos</a></li>
</ul>
<li><a href="#TypeSwitchStmt">type TypeSwitchStmt</a></li>
<ul>
<li><a href="#TypeSwitchStmt.End">func (s *TypeSwitchStmt) End() token.Pos</a></li><li><a href="#TypeSwitchStmt.Pos">func (s *TypeSwitchStmt) Pos() token.Pos</a></li>
</ul>
<li><a href="#UnaryExpr">type UnaryExpr</a></li>
<ul>
<li><a href="#UnaryExpr.End">func (x *UnaryExpr) End() token.Pos</a></li><li><a href="#UnaryExpr.Pos">func (x *UnaryExpr) Pos() token.Pos</a></li>
</ul>
<li><a href="#ValueSpec">type ValueSpec</a></li>
<ul>
<li><a href="#ValueSpec.End">func (s *ValueSpec) End() token.Pos</a></li><li><a href="#ValueSpec.Pos">func (s *ValueSpec) Pos() token.Pos</a></li>
</ul>
<li><a href="#Visitor">type Visitor</a></li>
</ul>
<h4 id="pkg-examples">Examples <a class="permalink" href="#pkg-examples">¶</a></h4>
<ul class="list-unstyled">
<li><a href="#example-CommentMap" onclick="$('#ex-CommentMap').addClass('in').removeClass('collapse').height('auto')">CommentMap</a></li><li><a href="#example-Inspect" onclick="$('#ex-Inspect').addClass('in').removeClass('collapse').height('auto')">Inspect</a></li><li><a href="#example-Print" onclick="$('#ex-Print').addClass('in').removeClass('collapse').height('auto')">Print</a></li>
</ul>
<h4 id="pkg-files">
<a href="https://github.com/golang/go/blob/master/src/go/ast/">Package Files</a>
<a class="permalink" href="#pkg-files">¶</a>
</h4>
<p><a href="https://github.com/golang/go/blob/master/src/go/ast/ast.go">ast.go</a> <a href="https://github.com/golang/go/blob/master/src/go/ast/commentmap.go">commentmap.go</a> <a href="https://github.com/golang/go/blob/master/src/go/ast/filter.go">filter.go</a> <a href="https://github.com/golang/go/blob/master/src/go/ast/import.go">import.go</a> <a href="https://github.com/golang/go/blob/master/src/go/ast/print.go">print.go</a> <a href="https://github.com/golang/go/blob/master/src/go/ast/resolve.go">resolve.go</a> <a href="https://github.com/golang/go/blob/master/src/go/ast/scope.go">scope.go</a> <a href="https://github.com/golang/go/blob/master/src/go/ast/walk.go">walk.go</a> </p>
<h3 id="FileExports" data-kind="f">func <a title="View Source" href="https://github.com/golang/go/blob/master/src/go/ast/filter.go#L28">FileExports</a> <a class="permalink" href="#FileExports">¶</a> <a class="uses" title="List Function Callers" href="https://sourcegraph.com/-/godoc/refs?def=FileExports&pkg=go%2Fast&repo=">Uses</a></h3>
<div class="funcdecl decl"><a title="View Source" href="https://github.com/golang/go/blob/master/src/go/ast/filter.go#L28">❖</a><pre>func FileExports(src *<a href="#File">File</a>) <a href="/builtin#bool">bool</a></pre></div><p>
FileExports trims the AST for a Go source file in place such that
only exported nodes remain: all top-level identifiers which are not exported
and their associated information (such as type, initial value, or function
body) are removed. Non-exported fields and methods of exported types are
stripped. The File.Comments list is not changed.
</p>
<p>
FileExports reports whether there are exported declarations.
</p>
<h3 id="FilterDecl" data-kind="f">func <a title="View Source" href="https://github.com/golang/go/blob/master/src/go/ast/filter.go#L204">FilterDecl</a> <a class="permalink" href="#FilterDecl">¶</a> <a class="uses" title="List Function Callers" href="https://sourcegraph.com/-/godoc/refs?def=FilterDecl&pkg=go%2Fast&repo=">Uses</a></h3>
<div class="funcdecl decl"><a title="View Source" href="https://github.com/golang/go/blob/master/src/go/ast/filter.go#L204">❖</a><pre>func FilterDecl(decl <a href="#Decl">Decl</a>, f <a href="#Filter">Filter</a>) <a href="/builtin#bool">bool</a></pre></div><p>
FilterDecl trims the AST for a Go declaration in place by removing
all names (including struct field and interface method names, but
not from parameter lists) that don't pass through the filter f.
</p>
<p>
FilterDecl reports whether there are any declared names left after
filtering.
</p>
<h3 id="FilterFile" data-kind="f">func <a title="View Source" href="https://github.com/golang/go/blob/master/src/go/ast/filter.go#L229">FilterFile</a> <a class="permalink" href="#FilterFile">¶</a> <a class="uses" title="List Function Callers" href="https://sourcegraph.com/-/godoc/refs?def=FilterFile&pkg=go%2Fast&repo=">Uses</a></h3>
<div class="funcdecl decl"><a title="View Source" href="https://github.com/golang/go/blob/master/src/go/ast/filter.go#L229">❖</a><pre>func FilterFile(src *<a href="#File">File</a>, f <a href="#Filter">Filter</a>) <a href="/builtin#bool">bool</a></pre></div><p>
FilterFile trims the AST for a Go file in place by removing all
names from top-level declarations (including struct field and
interface method names, but not from parameter lists) that don't
pass through the filter f. If the declaration is empty afterwards,
the declaration is removed from the AST. Import declarations are
always removed. The File.Comments list is not changed.
</p>
<p>
FilterFile reports whether there are any top-level declarations
left after filtering.
</p>
<h3 id="FilterPackage" data-kind="f">func <a title="View Source" href="https://github.com/golang/go/blob/master/src/go/ast/filter.go#L256">FilterPackage</a> <a class="permalink" href="#FilterPackage">¶</a> <a class="uses" title="List Function Callers" href="https://sourcegraph.com/-/godoc/refs?def=FilterPackage&pkg=go%2Fast&repo=">Uses</a></h3>
<div class="funcdecl decl"><a title="View Source" href="https://github.com/golang/go/blob/master/src/go/ast/filter.go#L256">❖</a><pre>func FilterPackage(pkg *<a href="#Package">Package</a>, f <a href="#Filter">Filter</a>) <a href="/builtin#bool">bool</a></pre></div><p>
FilterPackage trims the AST for a Go package in place by removing
all names from top-level declarations (including struct field and
interface method names, but not from parameter lists) that don't
pass through the filter f. If the declaration is empty afterwards,
the declaration is removed from the AST. The pkg.Files list is not
changed, so that file names and top-level package comments don't get
lost.
</p>
<p>
FilterPackage reports whether there are any top-level declarations
left after filtering.
</p>
<h3 id="Fprint" data-kind="f">func <a title="View Source" href="https://github.com/golang/go/blob/master/src/go/ast/print.go#L39">Fprint</a> <a class="permalink" href="#Fprint">¶</a> <a class="uses" title="List Function Callers" href="https://sourcegraph.com/-/godoc/refs?def=Fprint&pkg=go%2Fast&repo=">Uses</a></h3>
<div class="funcdecl decl"><a title="View Source" href="https://github.com/golang/go/blob/master/src/go/ast/print.go#L39">❖</a><pre>func Fprint(w <a href="/io">io</a>.<a href="/io#Writer">Writer</a>, fset *<a href="/go/token">token</a>.<a href="/go/token#FileSet">FileSet</a>, x interface{}, f <a href="#FieldFilter">FieldFilter</a>) <a href="/builtin#error">error</a></pre></div><p>
Fprint prints the (sub-)tree starting at AST node x to w.
If fset != nil, position information is interpreted relative
to that file set. Otherwise positions are printed as integer
values (file set specific offsets).
</p>
<p>
A non-nil FieldFilter f may be provided to control the output:
struct fields for which f(fieldname, fieldvalue) is true are
printed; all others are filtered from the output. Unexported
struct fields are never printed.
</p>
<h3 id="Inspect" data-kind="f">func <a title="View Source" href="https://github.com/golang/go/blob/master/src/go/ast/walk.go#L384">Inspect</a> <a class="permalink" href="#Inspect">¶</a> <a class="uses" title="List Function Callers" href="https://sourcegraph.com/-/godoc/refs?def=Inspect&pkg=go%2Fast&repo=">Uses</a></h3>
<div class="funcdecl decl"><a title="View Source" href="https://github.com/golang/go/blob/master/src/go/ast/walk.go#L384">❖</a><pre>func Inspect(node <a href="#Node">Node</a>, f func(<a href="#Node">Node</a>) <a href="/builtin#bool">bool</a>)</pre></div><p>
Inspect traverses an AST in depth-first order: It starts by calling
f(node); node must not be nil. If f returns true, Inspect invokes f
recursively for each of the non-nil children of node, followed by a
call of f(nil).
</p>
<div class="panel-group">
<div class="panel panel-default" id="example-Inspect">
<div class="panel-heading"><a class="accordion-toggle" data-toggle="collapse" href="#ex-Inspect">Example</a></div>
<div id="ex-Inspect" class="panel-collapse collapse"><div class="panel-body">
<p><p>
This example demonstrates how to inspect the AST of a Go program.
</p>
<p>Code:<span class="pull-right"><a href="?play=Inspect">play</a> </span>
<pre><span class="com">// src is the input for which we want to inspect the AST.</span>
src := `
package p
const c = 1.0
var X = f(3.14)*2 + c
`
<span class="com">// Create the AST by parsing src.</span>
fset := token.NewFileSet() <span class="com">// positions are relative to fset</span>
f, err := parser.ParseFile(fset, "src.go", src, 0)
if err != nil {
panic(err)
}
<span class="com">// Inspect the AST and print all identifiers and literals.</span>
ast.Inspect(f, func(n ast.Node) bool {
var s string
switch x := n.(type) {
case *ast.BasicLit:
s = x.Value
case *ast.Ident:
s = x.Name
}
if s != "" {
fmt.Printf("%s:\t%s\n", fset.Position(n.Pos()), s)
}
return true
})</pre>
<p>Output:<pre>src.go:2:9: p
src.go:3:7: c
src.go:3:11: 1.0
src.go:4:5: X
src.go:4:9: f
src.go:4:11: 3.14
src.go:4:17: 2
src.go:4:21: c
</pre>
</div></div>
</div>
</div>
<h3 id="IsExported" data-kind="f">func <a title="View Source" href="https://github.com/golang/go/blob/master/src/go/ast/ast.go#L526">IsExported</a> <a class="permalink" href="#IsExported">¶</a> <a class="uses" title="List Function Callers" href="https://sourcegraph.com/-/godoc/refs?def=IsExported&pkg=go%2Fast&repo=">Uses</a></h3>
<div class="funcdecl decl"><a title="View Source" href="https://github.com/golang/go/blob/master/src/go/ast/ast.go#L526">❖</a><pre>func IsExported(name <a href="/builtin#string">string</a>) <a href="/builtin#bool">bool</a></pre></div><p>
IsExported reports whether name is an exported Go symbol
(that is, whether it begins with an upper-case letter).
</p>
<h3 id="NotNilFilter" data-kind="f">func <a title="View Source" href="https://github.com/golang/go/blob/master/src/go/ast/print.go#L22">NotNilFilter</a> <a class="permalink" href="#NotNilFilter">¶</a> <a class="uses" title="List Function Callers" href="https://sourcegraph.com/-/godoc/refs?def=NotNilFilter&pkg=go%2Fast&repo=">Uses</a></h3>
<div class="funcdecl decl"><a title="View Source" href="https://github.com/golang/go/blob/master/src/go/ast/print.go#L22">❖</a><pre>func NotNilFilter(_ <a href="/builtin#string">string</a>, v <a href="/reflect">reflect</a>.<a href="/reflect#Value">Value</a>) <a href="/builtin#bool">bool</a></pre></div><p>
NotNilFilter returns true for field values that are not nil;
it returns false otherwise.
</p>
<h3 id="PackageExports" data-kind="f">func <a title="View Source" href="https://github.com/golang/go/blob/master/src/go/ast/filter.go#L39">PackageExports</a> <a class="permalink" href="#PackageExports">¶</a> <a class="uses" title="List Function Callers" href="https://sourcegraph.com/-/godoc/refs?def=PackageExports&pkg=go%2Fast&repo=">Uses</a></h3>
<div class="funcdecl decl"><a title="View Source" href="https://github.com/golang/go/blob/master/src/go/ast/filter.go#L39">❖</a><pre>func PackageExports(pkg *<a href="#Package">Package</a>) <a href="/builtin#bool">bool</a></pre></div><p>
PackageExports trims the AST for a Go package in place such that
only exported nodes remain. The pkg.Files list is not changed, so that
file names and top-level package comments don't get lost.
</p>
<p>
PackageExports reports whether there are exported declarations;
it returns false otherwise.
</p>
<h3 id="Print" data-kind="f">func <a title="View Source" href="https://github.com/golang/go/blob/master/src/go/ast/print.go#L73">Print</a> <a class="permalink" href="#Print">¶</a> <a class="uses" title="List Function Callers" href="https://sourcegraph.com/-/godoc/refs?def=Print&pkg=go%2Fast&repo=">Uses</a></h3>
<div class="funcdecl decl"><a title="View Source" href="https://github.com/golang/go/blob/master/src/go/ast/print.go#L73">❖</a><pre>func Print(fset *<a href="/go/token">token</a>.<a href="/go/token#FileSet">FileSet</a>, x interface{}) <a href="/builtin#error">error</a></pre></div><p>
Print prints x to standard output, skipping nil fields.
Print(fset, x) is the same as Fprint(os.Stdout, fset, x, NotNilFilter).
</p>
<div class="panel-group">
<div class="panel panel-default" id="example-Print">
<div class="panel-heading"><a class="accordion-toggle" data-toggle="collapse" href="#ex-Print">Example</a></div>
<div id="ex-Print" class="panel-collapse collapse"><div class="panel-body">
<p><p>
This example shows what an AST looks like when printed for debugging.
</p>
<p>Code:<span class="pull-right"><a href="?play=Print">play</a> </span>
<pre><span class="com">// src is the input for which we want to print the AST.</span>
src := `
package main
func main() {
println("Hello, World!")
}
`
<span class="com">// Create the AST by parsing src.</span>
fset := token.NewFileSet() <span class="com">// positions are relative to fset</span>
f, err := parser.ParseFile(fset, "", src, 0)
if err != nil {
panic(err)
}
<span class="com">// Print the AST.</span>
ast.Print(fset, f)</pre>
<p>Output:<pre> 0 *ast.File {
1 . Package: 2:1
2 . Name: *ast.Ident {
3 . . NamePos: 2:9
4 . . Name: "main"
5 . }
6 . Decls: []ast.Decl (len = 1) {
7 . . 0: *ast.FuncDecl {
8 . . . Name: *ast.Ident {
9 . . . . NamePos: 3:6
10 . . . . Name: "main"
11 . . . . Obj: *ast.Object {
12 . . . . . Kind: func
13 . . . . . Name: "main"
14 . . . . . Decl: *(obj @ 7)
15 . . . . }
16 . . . }
17 . . . Type: *ast.FuncType {
18 . . . . Func: 3:1
19 . . . . Params: *ast.FieldList {
20 . . . . . Opening: 3:10
21 . . . . . Closing: 3:11
22 . . . . }
23 . . . }
24 . . . Body: *ast.BlockStmt {
25 . . . . Lbrace: 3:13
26 . . . . List: []ast.Stmt (len = 1) {
27 . . . . . 0: *ast.ExprStmt {
28 . . . . . . X: *ast.CallExpr {
29 . . . . . . . Fun: *ast.Ident {
30 . . . . . . . . NamePos: 4:2
31 . . . . . . . . Name: "println"
32 . . . . . . . }
33 . . . . . . . Lparen: 4:9
34 . . . . . . . Args: []ast.Expr (len = 1) {
35 . . . . . . . . 0: *ast.BasicLit {
36 . . . . . . . . . ValuePos: 4:10
37 . . . . . . . . . Kind: STRING
38 . . . . . . . . . Value: "\"Hello, World!\""
39 . . . . . . . . }
40 . . . . . . . }
41 . . . . . . . Ellipsis: -
42 . . . . . . . Rparen: 4:25
43 . . . . . . }
44 . . . . . }
45 . . . . }
46 . . . . Rbrace: 5:1
47 . . . }
48 . . }
49 . }
50 . Scope: *ast.Scope {
51 . . Objects: map[string]*ast.Object (len = 1) {
52 . . . "main": *(obj @ 11)
53 . . }
54 . }
55 . Unresolved: []*ast.Ident (len = 1) {
56 . . 0: *(obj @ 29)
57 . }
58 }
</pre>
</div></div>
</div>
</div>
<h3 id="SortImports" data-kind="f">func <a title="View Source" href="https://github.com/golang/go/blob/master/src/go/ast/import.go#L15">SortImports</a> <a class="permalink" href="#SortImports">¶</a> <a class="uses" title="List Function Callers" href="https://sourcegraph.com/-/godoc/refs?def=SortImports&pkg=go%2Fast&repo=">Uses</a></h3>
<div class="funcdecl decl"><a title="View Source" href="https://github.com/golang/go/blob/master/src/go/ast/import.go#L15">❖</a><pre>func SortImports(fset *<a href="/go/token">token</a>.<a href="/go/token#FileSet">FileSet</a>, f *<a href="#File">File</a>)</pre></div><p>
SortImports sorts runs of consecutive import lines in import blocks in f.
It also removes duplicate imports when it is possible to do so without data loss.
</p>
<h3 id="Walk" data-kind="f">func <a title="View Source" href="https://github.com/golang/go/blob/master/src/go/ast/walk.go#L51">Walk</a> <a class="permalink" href="#Walk">¶</a> <a class="uses" title="List Function Callers" href="https://sourcegraph.com/-/godoc/refs?def=Walk&pkg=go%2Fast&repo=">Uses</a></h3>
<div class="funcdecl decl"><a title="View Source" href="https://github.com/golang/go/blob/master/src/go/ast/walk.go#L51">❖</a><pre>func Walk(v <a href="#Visitor">Visitor</a>, node <a href="#Node">Node</a>)</pre></div><p>
Walk traverses an AST in depth-first order: It starts by calling
v.Visit(node); node must not be nil. If the visitor w returned by
v.Visit(node) is not nil, Walk is invoked recursively with visitor
w for each of the non-nil children of node, followed by a call of
w.Visit(nil).
</p>
<h3 id="ArrayType" data-kind="t">type <a title="View Source" href="https://github.com/golang/go/blob/master/src/go/ast/ast.go#L375">ArrayType</a> <a class="permalink" href="#ArrayType">¶</a> <a class="uses" title="List Uses of This Type" href="https://sourcegraph.com/-/godoc/refs?def=ArrayType&pkg=go%2Fast&repo=">Uses</a></h3>
<div class="decl" data-kind="d"><a title="View Source" href="https://github.com/golang/go/blob/master/src/go/ast/ast.go#L375">❖</a><pre>type ArrayType struct {
<span id="ArrayType.Lbrack">Lbrack</span> <a href="/go/token">token</a>.<a href="/go/token#Pos">Pos</a> <span class="com">// position of "["</span>
<span id="ArrayType.Len">Len</span> <a href="#Expr">Expr</a> <span class="com">// Ellipsis node for [...]T array types, nil for slice types</span>
<span id="ArrayType.Elt">Elt</span> <a href="#Expr">Expr</a> <span class="com">// element type</span>
}</pre></div><p>
An ArrayType node represents an array or slice type.
</p>
<h4 id="ArrayType.End" data-kind="m">func (*ArrayType) <a title="View Source" href="https://github.com/golang/go/blob/master/src/go/ast/ast.go#L476">End</a> <a class="permalink" href="#ArrayType.End">¶</a> <a class="uses" title="List Method Callers" href="https://sourcegraph.com/-/godoc/refs?def=ArrayType%2FEnd&pkg=go%2Fast&repo=">Uses</a></h4>
<div class="funcdecl decl"><a title="View Source" href="https://github.com/golang/go/blob/master/src/go/ast/ast.go#L476">❖</a><pre>func (x *<a href="#ArrayType">ArrayType</a>) End() <a href="/go/token">token</a>.<a href="/go/token#Pos">Pos</a></pre></div>
<h4 id="ArrayType.Pos" data-kind="m">func (*ArrayType) <a title="View Source" href="https://github.com/golang/go/blob/master/src/go/ast/ast.go#L443">Pos</a> <a class="permalink" href="#ArrayType.Pos">¶</a> <a class="uses" title="List Method Callers" href="https://sourcegraph.com/-/godoc/refs?def=ArrayType%2FPos&pkg=go%2Fast&repo=">Uses</a></h4>
<div class="funcdecl decl"><a title="View Source" href="https://github.com/golang/go/blob/master/src/go/ast/ast.go#L443">❖</a><pre>func (x *<a href="#ArrayType">ArrayType</a>) Pos() <a href="/go/token">token</a>.<a href="/go/token#Pos">Pos</a></pre></div>
<h3 id="AssignStmt" data-kind="t">type <a title="View Source" href="https://github.com/golang/go/blob/master/src/go/ast/ast.go#L603">AssignStmt</a> <a class="permalink" href="#AssignStmt">¶</a> <a class="uses" title="List Uses of This Type" href="https://sourcegraph.com/-/godoc/refs?def=AssignStmt&pkg=go%2Fast&repo=">Uses</a></h3>
<div class="decl" data-kind="d"><a title="View Source" href="https://github.com/golang/go/blob/master/src/go/ast/ast.go#L603">❖</a><pre>type AssignStmt struct {
<span id="AssignStmt.Lhs">Lhs</span> []<a href="#Expr">Expr</a>
<span id="AssignStmt.TokPos">TokPos</span> <a href="/go/token">token</a>.<a href="/go/token#Pos">Pos</a> <span class="com">// position of Tok</span>
<span id="AssignStmt.Tok">Tok</span> <a href="/go/token">token</a>.<a href="/go/token#Token">Token</a> <span class="com">// assignment token, DEFINE</span>
<span id="AssignStmt.Rhs">Rhs</span> []<a href="#Expr">Expr</a>
}</pre></div><p>
An AssignStmt node represents an assignment or
a short variable declaration.
</p>
<h4 id="AssignStmt.End" data-kind="m">func (*AssignStmt) <a title="View Source" href="https://github.com/golang/go/blob/master/src/go/ast/ast.go#L749">End</a> <a class="permalink" href="#AssignStmt.End">¶</a> <a class="uses" title="List Method Callers" href="https://sourcegraph.com/-/godoc/refs?def=AssignStmt%2FEnd&pkg=go%2Fast&repo=">Uses</a></h4>
<div class="funcdecl decl"><a title="View Source" href="https://github.com/golang/go/blob/master/src/go/ast/ast.go#L749">❖</a><pre>func (s *<a href="#AssignStmt">AssignStmt</a>) End() <a href="/go/token">token</a>.<a href="/go/token#Pos">Pos</a></pre></div>
<h4 id="AssignStmt.Pos" data-kind="m">func (*AssignStmt) <a title="View Source" href="https://github.com/golang/go/blob/master/src/go/ast/ast.go#L720">Pos</a> <a class="permalink" href="#AssignStmt.Pos">¶</a> <a class="uses" title="List Method Callers" href="https://sourcegraph.com/-/godoc/refs?def=AssignStmt%2FPos&pkg=go%2Fast&repo=">Uses</a></h4>
<div class="funcdecl decl"><a title="View Source" href="https://github.com/golang/go/blob/master/src/go/ast/ast.go#L720">❖</a><pre>func (s *<a href="#AssignStmt">AssignStmt</a>) Pos() <a href="/go/token">token</a>.<a href="/go/token#Pos">Pos</a></pre></div>
<h3 id="BadDecl" data-kind="t">type <a title="View Source" href="https://github.com/golang/go/blob/master/src/go/ast/ast.go#L899">BadDecl</a> <a class="permalink" href="#BadDecl">¶</a> <a class="uses" title="List Uses of This Type" href="https://sourcegraph.com/-/godoc/refs?def=BadDecl&pkg=go%2Fast&repo=">Uses</a></h3>
<div class="decl" data-kind="d"><a title="View Source" href="https://github.com/golang/go/blob/master/src/go/ast/ast.go#L899">❖</a><pre>type BadDecl struct {
<span id="BadDecl.From">From</span>, <span id="BadDecl.To">To</span> <a href="/go/token">token</a>.<a href="/go/token#Pos">Pos</a> <span class="com">// position range of bad declaration</span>
}</pre></div><p>
A BadDecl node is a placeholder for declarations containing
syntax errors for which no correct declaration nodes can be
created.
</p>
<h4 id="BadDecl.End" data-kind="m">func (*BadDecl) <a title="View Source" href="https://github.com/golang/go/blob/master/src/go/ast/ast.go#L939">End</a> <a class="permalink" href="#BadDecl.End">¶</a> <a class="uses" title="List Method Callers" href="https://sourcegraph.com/-/godoc/refs?def=BadDecl%2FEnd&pkg=go%2Fast&repo=">Uses</a></h4>
<div class="funcdecl decl"><a title="View Source" href="https://github.com/golang/go/blob/master/src/go/ast/ast.go#L939">❖</a><pre>func (d *<a href="#BadDecl">BadDecl</a>) End() <a href="/go/token">token</a>.<a href="/go/token#Pos">Pos</a></pre></div>
<h4 id="BadDecl.Pos" data-kind="m">func (*BadDecl) <a title="View Source" href="https://github.com/golang/go/blob/master/src/go/ast/ast.go#L935">Pos</a> <a class="permalink" href="#BadDecl.Pos">¶</a> <a class="uses" title="List Method Callers" href="https://sourcegraph.com/-/godoc/refs?def=BadDecl%2FPos&pkg=go%2Fast&repo=">Uses</a></h4>
<div class="funcdecl decl"><a title="View Source" href="https://github.com/golang/go/blob/master/src/go/ast/ast.go#L935">❖</a><pre>func (d *<a href="#BadDecl">BadDecl</a>) Pos() <a href="/go/token">token</a>.<a href="/go/token#Pos">Pos</a></pre></div>
<h3 id="BadExpr" data-kind="t">type <a title="View Source" href="https://github.com/golang/go/blob/master/src/go/ast/ast.go#L233">BadExpr</a> <a class="permalink" href="#BadExpr">¶</a> <a class="uses" title="List Uses of This Type" href="https://sourcegraph.com/-/godoc/refs?def=BadExpr&pkg=go%2Fast&repo=">Uses</a></h3>
<div class="decl" data-kind="d"><a title="View Source" href="https://github.com/golang/go/blob/master/src/go/ast/ast.go#L233">❖</a><pre>type BadExpr struct {
<span id="BadExpr.From">From</span>, <span id="BadExpr.To">To</span> <a href="/go/token">token</a>.<a href="/go/token#Pos">Pos</a> <span class="com">// position range of bad expression</span>
}</pre></div><p>
A BadExpr node is a placeholder for expressions containing
syntax errors for which no correct expression nodes can be
created.
</p>
<h4 id="BadExpr.End" data-kind="m">func (*BadExpr) <a title="View Source" href="https://github.com/golang/go/blob/master/src/go/ast/ast.go#L455">End</a> <a class="permalink" href="#BadExpr.End">¶</a> <a class="uses" title="List Method Callers" href="https://sourcegraph.com/-/godoc/refs?def=BadExpr%2FEnd&pkg=go%2Fast&repo=">Uses</a></h4>
<div class="funcdecl decl"><a title="View Source" href="https://github.com/golang/go/blob/master/src/go/ast/ast.go#L455">❖</a><pre>func (x *<a href="#BadExpr">BadExpr</a>) End() <a href="/go/token">token</a>.<a href="/go/token#Pos">Pos</a></pre></div>
<h4 id="BadExpr.Pos" data-kind="m">func (*BadExpr) <a title="View Source" href="https://github.com/golang/go/blob/master/src/go/ast/ast.go#L422">Pos</a> <a class="permalink" href="#BadExpr.Pos">¶</a> <a class="uses" title="List Method Callers" href="https://sourcegraph.com/-/godoc/refs?def=BadExpr%2FPos&pkg=go%2Fast&repo=">Uses</a></h4>
<div class="funcdecl decl"><a title="View Source" href="https://github.com/golang/go/blob/master/src/go/ast/ast.go#L422">❖</a><pre>func (x *<a href="#BadExpr">BadExpr</a>) Pos() <a href="/go/token">token</a>.<a href="/go/token#Pos">Pos</a></pre></div>
<h3 id="BadStmt" data-kind="t">type <a title="View Source" href="https://github.com/golang/go/blob/master/src/go/ast/ast.go#L554">BadStmt</a> <a class="permalink" href="#BadStmt">¶</a> <a class="uses" title="List Uses of This Type" href="https://sourcegraph.com/-/godoc/refs?def=BadStmt&pkg=go%2Fast&repo=">Uses</a></h3>
<div class="decl" data-kind="d"><a title="View Source" href="https://github.com/golang/go/blob/master/src/go/ast/ast.go#L554">❖</a><pre>type BadStmt struct {
<span id="BadStmt.From">From</span>, <span id="BadStmt.To">To</span> <a href="/go/token">token</a>.<a href="/go/token#Pos">Pos</a> <span class="com">// position range of bad statement</span>
}</pre></div><p>
A BadStmt node is a placeholder for statements containing
syntax errors for which no correct statement nodes can be
created.
</p>
<h4 id="BadStmt.End" data-kind="m">func (*BadStmt) <a title="View Source" href="https://github.com/golang/go/blob/master/src/go/ast/ast.go#L735">End</a> <a class="permalink" href="#BadStmt.End">¶</a> <a class="uses" title="List Method Callers" href="https://sourcegraph.com/-/godoc/refs?def=BadStmt%2FEnd&pkg=go%2Fast&repo=">Uses</a></h4>
<div class="funcdecl decl"><a title="View Source" href="https://github.com/golang/go/blob/master/src/go/ast/ast.go#L735">❖</a><pre>func (s *<a href="#BadStmt">BadStmt</a>) End() <a href="/go/token">token</a>.<a href="/go/token#Pos">Pos</a></pre></div>
<h4 id="BadStmt.Pos" data-kind="m">func (*BadStmt) <a title="View Source" href="https://github.com/golang/go/blob/master/src/go/ast/ast.go#L713">Pos</a> <a class="permalink" href="#BadStmt.Pos">¶</a> <a class="uses" title="List Method Callers" href="https://sourcegraph.com/-/godoc/refs?def=BadStmt%2FPos&pkg=go%2Fast&repo=">Uses</a></h4>
<div class="funcdecl decl"><a title="View Source" href="https://github.com/golang/go/blob/master/src/go/ast/ast.go#L713">❖</a><pre>func (s *<a href="#BadStmt">BadStmt</a>) Pos() <a href="/go/token">token</a>.<a href="/go/token#Pos">Pos</a></pre></div>
<h3 id="BasicLit" data-kind="t">type <a title="View Source" href="https://github.com/golang/go/blob/master/src/go/ast/ast.go#L253">BasicLit</a> <a class="permalink" href="#BasicLit">¶</a> <a class="uses" title="List Uses of This Type" href="https://sourcegraph.com/-/godoc/refs?def=BasicLit&pkg=go%2Fast&repo=">Uses</a></h3>
<div class="decl" data-kind="d"><a title="View Source" href="https://github.com/golang/go/blob/master/src/go/ast/ast.go#L253">❖</a><pre>type BasicLit struct {
<span id="BasicLit.ValuePos">ValuePos</span> <a href="/go/token">token</a>.<a href="/go/token#Pos">Pos</a> <span class="com">// literal position</span>
<span id="BasicLit.Kind">Kind</span> <a href="/go/token">token</a>.<a href="/go/token#Token">Token</a> <span class="com">// token.INT, token.FLOAT, token.IMAG, token.CHAR, or token.STRING</span>
<span id="BasicLit.Value">Value</span> <a href="/builtin#string">string</a> <span class="com">// literal string; e.g. 42, 0x7f, 3.14, 1e-9, 2.4i, 'a', '\x7f', "foo" or `\m\n\o`</span>
}</pre></div><p>
A BasicLit node represents a literal of basic type.
</p>
<h4 id="BasicLit.End" data-kind="m">func (*BasicLit) <a title="View Source" href="https://github.com/golang/go/blob/master/src/go/ast/ast.go#L463">End</a> <a class="permalink" href="#BasicLit.End">¶</a> <a class="uses" title="List Method Callers" href="https://sourcegraph.com/-/godoc/refs?def=BasicLit%2FEnd&pkg=go%2Fast&repo=">Uses</a></h4>
<div class="funcdecl decl"><a title="View Source" href="https://github.com/golang/go/blob/master/src/go/ast/ast.go#L463">❖</a><pre>func (x *<a href="#BasicLit">BasicLit</a>) End() <a href="/go/token">token</a>.<a href="/go/token#Pos">Pos</a></pre></div>
<h4 id="BasicLit.Pos" data-kind="m">func (*BasicLit) <a title="View Source" href="https://github.com/golang/go/blob/master/src/go/ast/ast.go#L425">Pos</a> <a class="permalink" href="#BasicLit.Pos">¶</a> <a class="uses" title="List Method Callers" href="https://sourcegraph.com/-/godoc/refs?def=BasicLit%2FPos&pkg=go%2Fast&repo=">Uses</a></h4>
<div class="funcdecl decl"><a title="View Source" href="https://github.com/golang/go/blob/master/src/go/ast/ast.go#L425">❖</a><pre>func (x *<a href="#BasicLit">BasicLit</a>) Pos() <a href="/go/token">token</a>.<a href="/go/token#Pos">Pos</a></pre></div>