Versions in this module Expand all Collapse all v3 v3.9.0 Aug 19, 2024 v3.8.0 Feb 12, 2024 Changes in this version + const TsParen v3.7.0 Jun 18, 2023 Changes in this version type LangError + Pos Pos type ParseError + Pos Pos v3.6.0 Jan 9, 2023 Changes in this version + const Add + const AddAssgn + const AlternateUnset + const AlternateUnsetOrNull + const And + const AndArit + const AndAssgn + const AndStmt + const AndTest + const AppAll + const AppOut + const Assgn + const AssignUnset + const AssignUnsetOrNull + const BitNegation + const Break + const ClbOut + const CmdIn + const CmdOut + const Comma + const DashHdoc + const Dec + const DefaultUnset + const DefaultUnsetOrNull + const DplIn + const DplOut + const Eql + const ErrorUnset + const ErrorUnsetOrNull + const Fallthrough + const Geq + const GlobExcept + const GlobOne + const GlobOneOrMore + const GlobZeroOrMore + const GlobZeroOrOne + const Gtr + const Hdoc + const Inc + const Leq + const LowerAll + const LowerFirst + const Lss + const Minus + const Mul + const MulAssgn + const NamesPrefix + const NamesPrefixWords + const Neq + const Not + const Or + const OrArit + const OrAssgn + const OrStmt + const OrTest + const OtherParamOps + const Pipe + const PipeAll + const Plus + const Pow + const Quo + const QuoAssgn + const RdrAll + const RdrIn + const RdrInOut + const RdrOut + const Rem + const RemAssgn + const RemLargePrefix + const RemLargeSuffix + const RemSmallPrefix + const RemSmallSuffix + const Resume + const ResumeKorn + const Shl + const ShlAssgn + const Shr + const ShrAssgn + const Sub + const SubAssgn + const TernColon + const TernQuest + const TsAfter + const TsBefore + const TsBlckSp + const TsCharSp + const TsDevIno + const TsDirect + const TsEmpStr + const TsEql + const TsExec + const TsExists + const TsFdTerm + const TsGIDSet + const TsGeq + const TsGrpOwn + const TsGtr + const TsLeq + const TsLss + const TsMatch + const TsMatchShort + const TsModif + const TsNempStr + const TsNeq + const TsNewer + const TsNmPipe + const TsNoEmpty + const TsNoMatch + const TsNot + const TsOlder + const TsOptSet + const TsReMatch + const TsRead + const TsRefVar + const TsRegFile + const TsSmbLink + const TsSocket + const TsSticky + const TsUIDSet + const TsUsrOwn + const TsVarSet + const TsWrite + const UpperAll + const UpperFirst + const WordHdoc + const Xor + const XorAssgn + func DebugPrint(w io.Writer, node Node) error + func IsIncomplete(err error) bool + func IsKeyword(word string) bool + func Quote(s string, lang LangVariant) (string, error) + func Simplify(n Node) bool + func SplitBraces(word *Word) bool + func ValidName(val string) bool + func Walk(node Node, f func(Node) bool) + type ArithmCmd struct + Left Pos + Right Pos + Unsigned bool + X ArithmExpr + func (a *ArithmCmd) End() Pos + func (a *ArithmCmd) Pos() Pos + type ArithmExp struct + Bracket bool + Left Pos + Right Pos + Unsigned bool + X ArithmExpr + func (a *ArithmExp) End() Pos + func (a *ArithmExp) Pos() Pos + type ArithmExpr interface + type ArrayElem struct + Comments []Comment + Index ArithmExpr + Value *Word + func (a *ArrayElem) End() Pos + func (a *ArrayElem) Pos() Pos + type ArrayExpr struct + Elems []*ArrayElem + Last []Comment + Lparen Pos + Rparen Pos + func (a *ArrayExpr) End() Pos + func (a *ArrayExpr) Pos() Pos + type Assign struct + Append bool + Array *ArrayExpr + Index ArithmExpr + Naked bool + Name *Lit + Value *Word + func (a *Assign) End() Pos + func (a *Assign) Pos() Pos + type BinAritOperator token + func (o BinAritOperator) String() string + type BinCmdOperator token + func (o BinCmdOperator) String() string + type BinTestOperator token + func (o BinTestOperator) String() string + type BinaryArithm struct + Op BinAritOperator + OpPos Pos + X ArithmExpr + Y ArithmExpr + func (b *BinaryArithm) End() Pos + func (b *BinaryArithm) Pos() Pos + type BinaryCmd struct + Op BinCmdOperator + OpPos Pos + X *Stmt + Y *Stmt + func (b *BinaryCmd) End() Pos + func (b *BinaryCmd) Pos() Pos + type BinaryTest struct + Op BinTestOperator + OpPos Pos + X TestExpr + Y TestExpr + func (b *BinaryTest) End() Pos + func (b *BinaryTest) Pos() Pos + type Block struct + Last []Comment + Lbrace Pos + Rbrace Pos + Stmts []*Stmt + func (b *Block) End() Pos + func (b *Block) Pos() Pos + type BraceExp struct + Elems []*Word + Sequence bool + func (b *BraceExp) End() Pos + func (b *BraceExp) Pos() Pos + type CStyleLoop struct + Cond ArithmExpr + Init ArithmExpr + Lparen Pos + Post ArithmExpr + Rparen Pos + func (c *CStyleLoop) End() Pos + func (c *CStyleLoop) Pos() Pos + type CallExpr struct + Args []*Word + Assigns []*Assign + func (c *CallExpr) End() Pos + func (c *CallExpr) Pos() Pos + type CaseClause struct + Braces bool + Case Pos + Esac Pos + In Pos + Items []*CaseItem + Last []Comment + Word *Word + func (c *CaseClause) End() Pos + func (c *CaseClause) Pos() Pos + type CaseItem struct + Comments []Comment + Last []Comment + Op CaseOperator + OpPos Pos + Patterns []*Word + Stmts []*Stmt + func (c *CaseItem) End() Pos + func (c *CaseItem) Pos() Pos + type CaseOperator token + func (o CaseOperator) String() string + type CmdSubst struct + Backquotes bool + Last []Comment + Left Pos + ReplyVar bool + Right Pos + Stmts []*Stmt + TempFile bool + func (c *CmdSubst) End() Pos + func (c *CmdSubst) Pos() Pos + type Command interface + type Comment struct + Hash Pos + Text string + func (c *Comment) End() Pos + func (c *Comment) Pos() Pos + type CoprocClause struct + Coproc Pos + Name *Word + Stmt *Stmt + func (c *CoprocClause) End() Pos + func (c *CoprocClause) Pos() Pos + type DblQuoted struct + Dollar bool + Left Pos + Parts []WordPart + Right Pos + func (q *DblQuoted) End() Pos + func (q *DblQuoted) Pos() Pos + type DeclClause struct + Args []*Assign + Variant *Lit + func (d *DeclClause) End() Pos + func (d *DeclClause) Pos() Pos + type Expansion struct + Op ParExpOperator + Word *Word + type ExtGlob struct + Op GlobOperator + OpPos Pos + Pattern *Lit + func (e *ExtGlob) End() Pos + func (e *ExtGlob) Pos() Pos + type File struct + Last []Comment + Name string + Stmts []*Stmt + func (f *File) End() Pos + func (f *File) Pos() Pos + type ForClause struct + Braces bool + Do []*Stmt + DoLast []Comment + DoPos Pos + DonePos Pos + ForPos Pos + Loop Loop + Select bool + func (f *ForClause) End() Pos + func (f *ForClause) Pos() Pos + type FuncDecl struct + Body *Stmt + Name *Lit + Parens bool + Position Pos + RsrvWord bool + func (f *FuncDecl) End() Pos + func (f *FuncDecl) Pos() Pos + type GlobOperator token + func (o GlobOperator) String() string + type IfClause struct + Cond []*Stmt + CondLast []Comment + Else *IfClause + FiPos Pos + Last []Comment + Position Pos + Then []*Stmt + ThenLast []Comment + ThenPos Pos + func (c *IfClause) End() Pos + func (c *IfClause) Pos() Pos + type LangError struct + Feature string + Filename string + Langs []LangVariant + func (e LangError) Error() string + type LangVariant int + const LangAuto + const LangBash + const LangBats + const LangMirBSDKorn + const LangPOSIX + func (l *LangVariant) Set(s string) error + func (l LangVariant) String() string + type LetClause struct + Exprs []ArithmExpr + Let Pos + func (l *LetClause) End() Pos + func (l *LetClause) Pos() Pos + type Lit struct + Value string + ValueEnd Pos + ValuePos Pos + func (l *Lit) End() Pos + func (l *Lit) Pos() Pos + type Loop interface + type Node interface + End func() Pos + Pos func() Pos + type ParExpOperator token + func (o ParExpOperator) String() string + type ParNamesOperator token + func (o ParNamesOperator) String() string + type ParamExp struct + Dollar Pos + Excl bool + Exp *Expansion + Index ArithmExpr + Length bool + Names ParNamesOperator + Param *Lit + Rbrace Pos + Repl *Replace + Short bool + Slice *Slice + Width bool + func (p *ParamExp) End() Pos + func (p *ParamExp) Pos() Pos + type ParenArithm struct + Lparen Pos + Rparen Pos + X ArithmExpr + func (p *ParenArithm) End() Pos + func (p *ParenArithm) Pos() Pos + type ParenTest struct + Lparen Pos + Rparen Pos + X TestExpr + func (p *ParenTest) End() Pos + func (p *ParenTest) Pos() Pos + type ParseError struct + Filename string + Incomplete bool + Text string + func (e ParseError) Error() string + type Parser struct + func NewParser(options ...ParserOption) *Parser + func (p *Parser) Arithmetic(r io.Reader) (ArithmExpr, error) + func (p *Parser) Document(r io.Reader) (*Word, error) + func (p *Parser) Incomplete() bool + func (p *Parser) Interactive(r io.Reader, fn func([]*Stmt) bool) error + func (p *Parser) Parse(r io.Reader, name string) (*File, error) + func (p *Parser) Stmts(r io.Reader, fn func(*Stmt) bool) error + func (p *Parser) Words(r io.Reader, fn func(*Word) bool) error + type ParserOption func(*Parser) + func KeepComments(enabled bool) ParserOption + func StopAt(word string) ParserOption + func Variant(l LangVariant) ParserOption + type Pos struct + func NewPos(offset, line, column uint) Pos + func (p Pos) After(p2 Pos) bool + func (p Pos) Col() uint + func (p Pos) IsValid() bool + func (p Pos) Line() uint + func (p Pos) Offset() uint + func (p Pos) String() string + type Printer struct + func NewPrinter(opts ...PrinterOption) *Printer + func (p *Printer) Print(w io.Writer, node Node) error + type PrinterOption func(*Printer) + func BinaryNextLine(enabled bool) PrinterOption + func FunctionNextLine(enabled bool) PrinterOption + func Indent(spaces uint) PrinterOption + func KeepPadding(enabled bool) PrinterOption + func Minify(enabled bool) PrinterOption + func SingleLine(enabled bool) PrinterOption + func SpaceRedirects(enabled bool) PrinterOption + func SwitchCaseIndent(enabled bool) PrinterOption + type ProcOperator token + func (o ProcOperator) String() string + type ProcSubst struct + Last []Comment + Op ProcOperator + OpPos Pos + Rparen Pos + Stmts []*Stmt + func (s *ProcSubst) End() Pos + func (s *ProcSubst) Pos() Pos + type QuoteError struct + ByteOffset int + Message string + func (e QuoteError) Error() string + type RedirOperator token + func (o RedirOperator) String() string + type Redirect struct + Hdoc *Word + N *Lit + Op RedirOperator + OpPos Pos + Word *Word + func (r *Redirect) End() Pos + func (r *Redirect) Pos() Pos + type Replace struct + All bool + Orig *Word + With *Word + type SglQuoted struct + Dollar bool + Left Pos + Right Pos + Value string + func (q *SglQuoted) End() Pos + func (q *SglQuoted) Pos() Pos + type Slice struct + Length ArithmExpr + Offset ArithmExpr + type Stmt struct + Background bool + Cmd Command + Comments []Comment + Coprocess bool + Negated bool + Position Pos + Redirs []*Redirect + Semicolon Pos + func (s *Stmt) End() Pos + func (s *Stmt) Pos() Pos + type Subshell struct + Last []Comment + Lparen Pos + Rparen Pos + Stmts []*Stmt + func (s *Subshell) End() Pos + func (s *Subshell) Pos() Pos + type TestClause struct + Left Pos + Right Pos + X TestExpr + func (t *TestClause) End() Pos + func (t *TestClause) Pos() Pos + type TestDecl struct + Body *Stmt + Description *Word + Position Pos + func (f *TestDecl) End() Pos + func (f *TestDecl) Pos() Pos + type TestExpr interface + type TimeClause struct + PosixFormat bool + Stmt *Stmt + Time Pos + func (c *TimeClause) End() Pos + func (c *TimeClause) Pos() Pos + type UnAritOperator token + func (o UnAritOperator) String() string + type UnTestOperator token + func (o UnTestOperator) String() string + type UnaryArithm struct + Op UnAritOperator + OpPos Pos + Post bool + X ArithmExpr + func (u *UnaryArithm) End() Pos + func (u *UnaryArithm) Pos() Pos + type UnaryTest struct + Op UnTestOperator + OpPos Pos + X TestExpr + func (u *UnaryTest) End() Pos + func (u *UnaryTest) Pos() Pos + type WhileClause struct + Cond []*Stmt + CondLast []Comment + Do []*Stmt + DoLast []Comment + DoPos Pos + DonePos Pos + Until bool + WhilePos Pos + func (w *WhileClause) End() Pos + func (w *WhileClause) Pos() Pos + type Word struct + Parts []WordPart + func (w *Word) End() Pos + func (w *Word) Lit() string + func (w *Word) Pos() Pos + type WordIter struct + InPos Pos + Items []*Word + Name *Lit + func (w *WordIter) End() Pos + func (w *WordIter) Pos() Pos + type WordPart interface v3.5.2-pre.0 Dec 9, 2022