parser

package
v0.18.0 Latest Latest
Warning

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

Go to latest
Published: Aug 24, 2020 License: MIT Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CreateDecl

type CreateDecl struct {
	// contains filtered or unexported fields
}

func (CreateDecl) File

func (d CreateDecl) File() (*File, error)

func (CreateDecl) MarshalJSON

func (d CreateDecl) MarshalJSON() ([]byte, error)

func (CreateDecl) Position

func (d CreateDecl) Position() (token.Position, error)

func (CreateDecl) String

func (d CreateDecl) String() string

func (CreateDecl) Value

func (d CreateDecl) Value() (string, error)

func (CreateDecl) VirtualPaths

func (d CreateDecl) VirtualPaths() []string

type Decl

type Decl interface {
	File() (*File, error)
	Position() (token.Position, error)
	Value() (string, error)
}

type Decls

type Decls []Decl

func Parse

func Parse(her here.Info, includes []string, excludes []string) (Decls, error)

func (Decls) Files

func (decls Decls) Files() ([]*File, error)

type File

type File struct {
	Abs  string // full path on disk to file
	Path here.Path
	Here here.Info
}

func (File) String

func (f File) String() string

type Filer

type Filer interface {
	Files(map[string]string) ([]*File, error)
}

type HTTPDecl

type HTTPDecl struct {
	// contains filtered or unexported fields
}

func (HTTPDecl) File

func (d HTTPDecl) File() (*File, error)

func (HTTPDecl) Files

func (d HTTPDecl) Files(virtual map[string]string) ([]*File, error)

func (HTTPDecl) MarshalJSON

func (d HTTPDecl) MarshalJSON() ([]byte, error)

func (HTTPDecl) Position

func (d HTTPDecl) Position() (token.Position, error)

func (HTTPDecl) String

func (d HTTPDecl) String() string

func (HTTPDecl) Value

func (d HTTPDecl) Value() (string, error)

type IncludeDecl

type IncludeDecl struct {
	// contains filtered or unexported fields
}

func NewInclude

func NewInclude(her here.Info, inc string) (IncludeDecl, error)

func (IncludeDecl) File

func (d IncludeDecl) File() (*File, error)

func (IncludeDecl) Files

func (d IncludeDecl) Files(virtual map[string]string) ([]*File, error)

func (IncludeDecl) MarshalJSON

func (d IncludeDecl) MarshalJSON() ([]byte, error)

func (IncludeDecl) Position

func (d IncludeDecl) Position() (token.Position, error)

func (IncludeDecl) String

func (d IncludeDecl) String() string

func (IncludeDecl) Value

func (d IncludeDecl) Value() (string, error)

type MkdirAllDecl

type MkdirAllDecl struct {
	// contains filtered or unexported fields
}

func (MkdirAllDecl) File

func (d MkdirAllDecl) File() (*File, error)

func (MkdirAllDecl) MarshalJSON

func (d MkdirAllDecl) MarshalJSON() ([]byte, error)

func (MkdirAllDecl) Position

func (d MkdirAllDecl) Position() (token.Position, error)

func (MkdirAllDecl) String

func (d MkdirAllDecl) String() string

func (MkdirAllDecl) Value

func (d MkdirAllDecl) Value() (string, error)

func (MkdirAllDecl) VirtualPaths

func (d MkdirAllDecl) VirtualPaths() []string

type OpenDecl

type OpenDecl struct {
	// contains filtered or unexported fields
}

func (OpenDecl) File

func (d OpenDecl) File() (*File, error)

func (OpenDecl) Files

func (d OpenDecl) Files(virtual map[string]string) ([]*File, error)

func (OpenDecl) MarshalJSON

func (d OpenDecl) MarshalJSON() ([]byte, error)

func (OpenDecl) Position

func (d OpenDecl) Position() (token.Position, error)

func (OpenDecl) String

func (d OpenDecl) String() string

func (OpenDecl) Value

func (d OpenDecl) Value() (string, error)

type ParsedSource

type ParsedSource struct {
	Source
	FileSet *token.FileSet
	Ast     *ast.File
	// contains filtered or unexported fields
}

func (*ParsedSource) DeclsMap

func (p *ParsedSource) DeclsMap() (map[string]Decls, error)

func (*ParsedSource) Parse

func (p *ParsedSource) Parse() error

type Parser

type Parser struct {
	here.Info
	// contains filtered or unexported fields
}

func New

func New(her here.Info) (*Parser, error)

func (*Parser) Decls

func (p *Parser) Decls() (Decls, error)

func (*Parser) DeclsMap

func (p *Parser) DeclsMap() (map[string]Decls, error)

func (*Parser) Parse

func (p *Parser) Parse() error

func (*Parser) ParseDir

func (p *Parser) ParseDir(abs string, mode parser.Mode) ([]*ParsedSource, error)

func (*Parser) ParseFile

func (p *Parser) ParseFile(abs string, mode parser.Mode) (*ParsedSource, error)

func (*Parser) ParseSource

func (p *Parser) ParseSource(source Source, mode parser.Mode) (*ParsedSource, error)

type Source

type Source struct {
	Abs  string // full path on disk to file
	Path here.Path
	Here here.Info
}

type StatDecl

type StatDecl struct {
	// contains filtered or unexported fields
}

func (StatDecl) File

func (d StatDecl) File() (*File, error)

func (StatDecl) Files

func (d StatDecl) Files(virtual map[string]string) ([]*File, error)

func (StatDecl) MarshalJSON

func (d StatDecl) MarshalJSON() ([]byte, error)

func (StatDecl) Position

func (d StatDecl) Position() (token.Position, error)

func (StatDecl) String

func (d StatDecl) String() string

func (StatDecl) Value

func (d StatDecl) Value() (string, error)

type Virtualer

type Virtualer interface {
	VirtualPaths() []string
}

type WalkDecl

type WalkDecl struct {
	// contains filtered or unexported fields
}

func (WalkDecl) File

func (d WalkDecl) File() (*File, error)

func (WalkDecl) Files

func (d WalkDecl) Files(virtual map[string]string) ([]*File, error)

func (WalkDecl) MarshalJSON

func (d WalkDecl) MarshalJSON() ([]byte, error)

func (WalkDecl) Position

func (d WalkDecl) Position() (token.Position, error)

func (WalkDecl) String

func (d WalkDecl) String() string

func (WalkDecl) Value

func (d WalkDecl) Value() (string, error)

Jump to

Keyboard shortcuts

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