parser

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Oct 26, 2016 License: BSD-3-Clause Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Parse

func Parse(src []byte, name string, mode Mode) (*ast.File, error)

Parse reads and parses a shell program with an optional name. It returns the parsed program if no issues were encountered. Otherwise, an error is returned.

Types

type Mode

type Mode uint

Mode controls the parser behaviour via a set of flags.

const (
	ParseComments   Mode = 1 << iota // add comments to the AST
	PosixConformant                  // match the POSIX standard where it differs from bash
)

type ParseError

type ParseError struct {
	token.Position
	Filename, Text string
}

ParseError represents an error found when parsing a source file.

func (*ParseError) Error

func (e *ParseError) Error() string

Jump to

Keyboard shortcuts

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