parser

package
v1.0.6 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 11, 2025 License: MIT Imports: 12 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FindOriginalStartLine

func FindOriginalStartLine(diff []byte) int64

FindOriginalStartLine attempts to find the original line number where a mutation occurred.

func ParseAndTypeCheckFile

func ParseAndTypeCheckFile(file string, collectors []filter.NodeCollector) (*ast.File, *token.FileSet, *types.Package, *types.Info, error)

ParseAndTypeCheckFile parses and type-checks the given file, and returns everything interesting about the file. If a fatal error is encountered the error return argument is not nil.

func ParseDiffOutput

func ParseDiffOutput(diff string) []int64

ParseDiffOutput parses the unified diff (-u) output to extract the line numbers where changes occurred. The `-u` flag provides exactly 3 lines of context around changes, so the actual changed line can be derived by adjusting the reported line number from the diff header.

func ParseFile

func ParseFile(file string) (*ast.File, *token.FileSet, error)

ParseFile parses the content of the given file and returns the corresponding ast.File node and its file set for positional information. If a fatal error is encountered the error return argument is not nil.

func ParseSource

func ParseSource(data interface{}) (*ast.File, *token.FileSet, error)

ParseSource parses the given source and returns the corresponding ast.File node and its file set for positional information. If a fatal error is encountered the error return argument is not nil.

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL