scanner

package
v0.0.0-...-62afbb6 Latest Latest
Warning

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

Go to latest
Published: Mar 11, 2021 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewFilter

func NewFilter(z *zlog.Logger, cfg Config) (func(string, os.FileInfo) (bool, error), error)

func NewScanner

func NewScanner(z *zlog.Logger, cfg Config) (func(root string, f func(*RawElement) error) ([]*RawElement, error), error)

func ScanFile

func ScanFile(
	z *zlog.Logger,
	cfg BracketConfig,
	path string,
	f func(*RawElement) error,
) error

func ScanRawReader

func ScanRawReader(
	z *zlog.Logger,
	cfg BracketConfig,
	r io.Reader,
	f func(*RawElement) error,
) error

func ScanSitterReader

func ScanSitterReader(
	z *zlog.Logger,
	cfg BracketConfig,
	r io.Reader,
	f func(*RawElement) error,
) error

Types

type BracketConfig

type BracketConfig struct {
	Left  string `yaml:"left"`
	Right string `yaml:"right"`
}

func (*BracketConfig) OverrideWith

func (c *BracketConfig) OverrideWith(o BracketConfig)

func (*BracketConfig) Regexp

func (c *BracketConfig) Regexp() (*regexp.Regexp, error)

type Config

type Config struct {
	Bracket BracketConfig `yaml:"bracket"`
	Ignore  []string      `yaml:"ignore"`
}

type Loc

type Loc struct {
	Path        string
	Line        int
	StartColumn int
	EndColumn   int
}

func ParseLocString

func ParseLocString(text string) (*Loc, error)

func (Loc) Contains

func (l Loc) Contains(other Loc) bool

func (*Loc) Less

func (l *Loc) Less(other Loc) bool

func (Loc) String

func (l Loc) String() string

type RawElement

type RawElement struct {
	Text string
	Loc  Loc
}

Jump to

Keyboard shortcuts

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