Documentation ¶
Index ¶
- func AssignDocStrings(mod *ast.Module)
- func ExpandHomeDir(path string) (string, error)
- func FormatPos(pos lexer.Position) string
- func NewLocalDirectory(root string, dgst digest.Digest) ast.Directory
- func Parse(ctx context.Context, r io.Reader, opts ...filebuffer.Option) (*ast.Module, error)
- func ParseMultiple(ctx context.Context, rs []io.Reader) ([]*ast.Module, error)
- func ResolvePath(root, path string) (string, error)
- type NamedReader
- type NewlinedReader
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AssignDocStrings ¶
AssignDocStrings assigns the comment group immediately before a function declaration as the function's doc string.
func ExpandHomeDir ¶
ExpandHomeDir expands the path to include the home directory if the path is prefixed with `~`. If it isn't prefixed with `~`, the path is returned as-is.
func NewLocalDirectory ¶
NewLocalDirectory returns an ast.Directory representing a directory on the local system. It is also used to abstract the difference between reading remote modules that has been vendored.
func ResolvePath ¶
ResolvePath resolves the path relative to root, and expands `~` to the user's home directory.
Types ¶
type NamedReader ¶
func (NamedReader) Close ¶
func (nr NamedReader) Close() error
func (*NamedReader) Name ¶
func (nr *NamedReader) Name() string
type NewlinedReader ¶
NewlinedReader appends one more newline after an EOF is reached, so that parsing is made easier when inputs that don't end with a newline.