type FileSet(struct)
A FileSet represents a set of source files.
Methods of file sets are synchronized; multiple goroutines
may invoke them concurrently.
The byte offsets for each file in a file set are mapped into
distinct (integer) intervals, one interval [base, base+size]
per file. Base represents the first byte in the file, and size
is the corresponding file size. A Pos value is a value in such
an interval. By determining the interval a Pos value belongs
to, the file, its file base, and thus the byte offset (position)
the Pos value is representing can be computed.
When adding a new file, a file base must be provided. That can
be any integer value that is past the end of any interval of any
file already in the file set. For convenience, FileSet.Base provides
such a value, which is simply the end of the Pos interval of the most
recently added file, plus one. Unless there is a need to extend an
interval later, using the FileSet.Base should be used as argument
for FileSet.AddFile.
(*T) AddFile(filename string, base, size int) *File
(*T) Base() int
(*T) File(p Pos) (f *File)
(*T) Iterate(f func(*File) bool)
(*T) Position(p Pos) (pos Position)
(*T) PositionFor(p Pos, adjusted bool) (pos Position)
(*T) Read(decode func(interface{}) error) error
(*T) Write(encode func(interface{}) error) error
func NewFileSet() *FileSet
func go/ast.Fprint(w io.Writer, fset *FileSet, x interface{}, f ast.FieldFilter) error
func go/ast.NewCommentMap(fset *FileSet, node ast.Node, comments []*ast.CommentGroup) ast.CommentMap
func go/ast.NewPackage(fset *FileSet, files map[string]*ast.File, importer ast.Importer, universe *ast.Scope) (*ast.Package, error)
func go/ast.Print(fset *FileSet, x interface{}) error
func go/ast.SortImports(fset *FileSet, f *ast.File)
const HighestPrec = 7
A set of constants for precedence-based expression parsing.
Non-operators have lowest precedence, followed by operators
starting with precedence 1 up to unary operators. The highest
precedence serves as "catch-all" precedence for selector,
indexing, and other operator and delimiter tokens.
const IDENTToken = 4 // main
Identifiers and basic type literals
(these tokens stand for classes of literals)
func IsExported(name string) bool
IsExported reports whether name starts with an upper-case letter.
func IsIdentifier(name string) bool
IsIdentifier reports whether name is a Go identifier, that is, a non-empty
string made up of letters, digits, and underscores, where the first character
is not a digit. Keywords are not identifiers.
func IsKeyword(name string) bool
IsKeyword reports whether name is a Go keyword, such as "func" or "return".
const LowestPrec = 0 // non-operators
A set of constants for precedence-based expression parsing.
Non-operators have lowest precedence, followed by operators
starting with precedence 1 up to unary operators. The highest
precedence serves as "catch-all" precedence for selector,
indexing, and other operator and delimiter tokens.
const NoPosPos = 0
The zero value for Pos is NoPos; there is no file and line information
associated with it, and NoPos.IsValid() is false. NoPos is always
smaller than any other Pos value. The corresponding Position value
for NoPos is the zero value for Position.
const UnaryPrec = 6
A set of constants for precedence-based expression parsing.
Non-operators have lowest precedence, followed by operators
starting with precedence 1 up to unary operators. The highest
precedence serves as "catch-all" precedence for selector,
indexing, and other operator and delimiter tokens.
The pages are generated with Goldsv0.1.6. (GOOS=darwin GOARCH=amd64)
Golds is a Go 101 project and developed by Tapir Liu.
PR and bug reports are welcome and can be submitted to the issue list.
Please follow @Go100and1 (reachable from the left QR code) to get the latest news of Golds.