Documentation
¶
Overview ¶
Package interp implements an interpreter for the Shell Command Language (POSIX.1-2017).
Index ¶
- Constants
- type ArithExprError
- type ExecEnv
- func (env *ExecEnv) Eval(expr string) (n int, err error)
- func (env *ExecEnv) Expand(word ast.Word, mode ExpMode) ([]string, error)
- func (env *ExecEnv) Get(name string) (v Var, set bool)
- func (env *ExecEnv) Set(name, value string)
- func (env *ExecEnv) Unset(name string)
- func (env *ExecEnv) Walk(fn func(Var))
- type ExpMode
- type Option
- type ParamExpError
- type Var
Constants ¶
View Source
const ADD_ASSIGN = 57361
View Source
const AND_ASSIGN = 57365
View Source
const DEC = 57349
View Source
const DIV_ASSIGN = 57359
View Source
const EQ = 57354
View Source
const GE = 57353
View Source
const IDENT = 57347
View Source
const IFS = " \t\n"
View Source
const INC = 57348
View Source
const LAND = 57356
View Source
const LE = 57352
View Source
const LOR = 57357
View Source
const LSH = 57350
View Source
const LSH_ASSIGN = 57363
View Source
const MOD_ASSIGN = 57360
View Source
const MUL_ASSIGN = 57358
View Source
const NE = 57355
View Source
const NUMBER = 57346
View Source
const OR_ASSIGN = 57367
View Source
const RSH = 57351
View Source
const RSH_ASSIGN = 57364
View Source
const SUB_ASSIGN = 57362
View Source
const XOR_ASSIGN = 57366
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ArithExprError ¶
ArithExprError represents an arithmetic expression error.
func (ArithExprError) Error ¶
func (e ArithExprError) Error() string
type ExecEnv ¶
type ExecEnv struct { Args []string Opts Option Aliases map[string]string // contains filtered or unexported fields }
ExecEnv represents a shell execution environment.
func NewExecEnv ¶
NewExecEnv returns a new ExecEnv.
type ExpMode ¶
type ExpMode uint
ExpMode controls the behavior of word expansions.
const ( // Expand a word into a single field, field splitting and pathname // expansion will no be performed. The result will be converted the // simplest form of parameter expansions into ANSI C style // identifiers except for special parameters and positional // parameters. Arith ExpMode = 1 << iota // Expands multiple tilde-prefixes in a word as if it is in an // assignment. Assign // Expand a word into a single field, field splitting and pathname // expansion will not be performed. Literal // Expand a word into a single field, field splitting and pathname // expansion will not be performed. The result will be retained if // '?', '*', and '[' are quoted. Pattern // Expands a word as if it is within double-quotes, field splitting // and pathname expansion will not be performed. Quote )
type ParamExpError ¶
ParamExpError represents an error in parameter expansion.
func (ParamExpError) Error ¶
func (e ParamExpError) Error() string
Click to show internal directories.
Click to hide internal directories.