parser

package
v0.0.0-...-2e562ea Latest Latest
Warning

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

Go to latest
Published: Dec 18, 2023 License: Apache-2.0 Imports: 24 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ExecJS

func ExecJS(dir string, args, env []string, in io.Reader, stdout, stderr io.Writer) (int, error)

ExecJS runs the embedded js runtime interpreter

func SortRules

func SortRules(rules []*sppb.Rule)

Types

type MemoParser

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

MemoParser is a Parser frontend that uses cached state of the files sha256 values are up-to-date.

func NewMemoParser

func NewMemoParser(next Parser) *MemoParser

func (*MemoParser) LoadScalaRule

func (p *MemoParser) LoadScalaRule(from label.Label, rule *sppb.Rule) error

LoadScalaRule loads the given state.

func (*MemoParser) ParseScalaRule

func (p *MemoParser) ParseScalaRule(kind string, from label.Label, dir string, srcs ...string) (*sppb.Rule, error)

ParseScalaRule implements parser.Parser

func (*MemoParser) ScalaRules

func (p *MemoParser) ScalaRules() []*sppb.Rule

ScalaRules returns a list of all scala rules sorted by label

type Parser

type Parser interface {
	// LoadScalaRule loads the given rule state.
	LoadScalaRule(from label.Label, rule *sppb.Rule) error

	// ParseScalaRule is used to parse a list of source files.  The srcs list
	// is expected to be relative to dir.
	ParseScalaRule(kind string, from label.Label, dir string, srcs ...string) (*sppb.Rule, error)
}

Parser abstracts a service that can parse scala files. It also supports a load operation to facilitate a cache.

type ScalametaParser

type ScalametaParser struct {
	sppb.UnimplementedParserServer

	HttpPort int
	// contains filtered or unexported fields
}

ScalametaParser is a service that communicates to a scalameta-js parser backend over HTTP.

func NewScalametaParser

func NewScalametaParser() *ScalametaParser

func (*ScalametaParser) Parse

func (*ScalametaParser) Start

func (s *ScalametaParser) Start() error

func (*ScalametaParser) Stop

func (s *ScalametaParser) Stop()

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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