package syntax
import "fmt"
func (o *RedirOperator ) UnmarshalText (text []byte ) error {
switch string (text ) {
case ">" :
*o = RdrOut
case ">>" :
*o = AppOut
case "<" :
*o = RdrIn
case "<>" :
*o = RdrInOut
case "<&" :
*o = DplIn
case ">&" :
*o = DplOut
case ">|" :
*o = RdrClob
case ">>|" :
*o = AppClob
case "<<" :
*o = Hdoc
case "<<-" :
*o = DashHdoc
case "<<<" :
*o = WordHdoc
case "&>" :
*o = RdrAll
case "&>|" :
*o = RdrAllClob
case "&>>" :
*o = AppAll
case "&>>|" :
*o = AppAllClob
default :
return fmt .Errorf ("invalid RedirOperator: %q" , text )
}
return nil
}
func (o *ProcOperator ) UnmarshalText (text []byte ) error {
switch string (text ) {
case "<(" :
*o = CmdIn
case "=(" :
*o = CmdInTemp
case ">(" :
*o = CmdOut
default :
return fmt .Errorf ("invalid ProcOperator: %q" , text )
}
return nil
}
func (o *GlobOperator ) UnmarshalText (text []byte ) error {
switch string (text ) {
case "?(" :
*o = GlobZeroOrOne
case "*(" :
*o = GlobZeroOrMore
case "+(" :
*o = GlobOneOrMore
case "@(" :
*o = GlobOne
case "!(" :
*o = GlobExcept
default :
return fmt .Errorf ("invalid GlobOperator: %q" , text )
}
return nil
}
func (o *BinCmdOperator ) UnmarshalText (text []byte ) error {
switch string (text ) {
case "&&" :
*o = AndStmt
case "||" :
*o = OrStmt
case "|" :
*o = Pipe
case "|&" :
*o = PipeAll
default :
return fmt .Errorf ("invalid BinCmdOperator: %q" , text )
}
return nil
}
func (o *CaseOperator ) UnmarshalText (text []byte ) error {
switch string (text ) {
case ";;" :
*o = Break
case ";&" :
*o = Fallthrough
case ";;&" :
*o = Resume
case ";|" :
*o = ResumeKorn
default :
return fmt .Errorf ("invalid CaseOperator: %q" , text )
}
return nil
}
func (o *ParNamesOperator ) UnmarshalText (text []byte ) error {
switch string (text ) {
case "*" :
*o = NamesPrefix
case "@" :
*o = NamesPrefixWords
default :
return fmt .Errorf ("invalid ParNamesOperator: %q" , text )
}
return nil
}
func (o *ParExpOperator ) UnmarshalText (text []byte ) error {
switch string (text ) {
case "+" :
*o = AlternateUnset
case ":+" :
*o = AlternateUnsetOrNull
case "-" :
*o = DefaultUnset
case ":-" :
*o = DefaultUnsetOrNull
case "?" :
*o = ErrorUnset
case ":?" :
*o = ErrorUnsetOrNull
case "=" :
*o = AssignUnset
case ":=" :
*o = AssignUnsetOrNull
case "%" :
*o = RemSmallSuffix
case "%%" :
*o = RemLargeSuffix
case "#" :
*o = RemSmallPrefix
case "##" :
*o = RemLargePrefix
case ":#" :
*o = MatchEmpty
case ":|" :
*o = ArrayExclude
case ":*" :
*o = ArrayIntersect
case "^" :
*o = UpperFirst
case "^^" :
*o = UpperAll
case "," :
*o = LowerFirst
case ",," :
*o = LowerAll
case "@" :
*o = OtherParamOps
default :
return fmt .Errorf ("invalid ParExpOperator: %q" , text )
}
return nil
}
func (o *UnAritOperator ) UnmarshalText (text []byte ) error {
switch string (text ) {
case "!" :
*o = Not
case "~" :
*o = BitNegation
case "++" :
*o = Inc
case "--" :
*o = Dec
case "+" :
*o = Plus
case "-" :
*o = Minus
default :
return fmt .Errorf ("invalid UnAritOperator: %q" , text )
}
return nil
}
func (o *BinAritOperator ) UnmarshalText (text []byte ) error {
switch string (text ) {
case "+" :
*o = Add
case "-" :
*o = Sub
case "*" :
*o = Mul
case "/" :
*o = Quo
case "%" :
*o = Rem
case "**" :
*o = Pow
case "==" :
*o = Eql
case ">" :
*o = Gtr
case "<" :
*o = Lss
case "!=" :
*o = Neq
case "<=" :
*o = Leq
case ">=" :
*o = Geq
case "&" :
*o = And
case "|" :
*o = Or
case "^" :
*o = Xor
case ">>" :
*o = Shr
case "<<" :
*o = Shl
case "&&" :
*o = AndArit
case "||" :
*o = OrArit
case "^^" :
*o = XorBool
case "," :
*o = Comma
case "?" :
*o = TernQuest
case ":" :
*o = TernColon
case "=" :
*o = Assgn
case "+=" :
*o = AddAssgn
case "-=" :
*o = SubAssgn
case "*=" :
*o = MulAssgn
case "/=" :
*o = QuoAssgn
case "%=" :
*o = RemAssgn
case "&=" :
*o = AndAssgn
case "|=" :
*o = OrAssgn
case "^=" :
*o = XorAssgn
case "<<=" :
*o = ShlAssgn
case ">>=" :
*o = ShrAssgn
case "&&=" :
*o = AndBoolAssgn
case "||=" :
*o = OrBoolAssgn
case "^^=" :
*o = XorBoolAssgn
case "**=" :
*o = PowAssgn
default :
return fmt .Errorf ("invalid BinAritOperator: %q" , text )
}
return nil
}
func (o *UnTestOperator ) UnmarshalText (text []byte ) error {
switch string (text ) {
case "-e" :
*o = TsExists
case "-f" :
*o = TsRegFile
case "-d" :
*o = TsDirect
case "-c" :
*o = TsCharSp
case "-b" :
*o = TsBlckSp
case "-p" :
*o = TsNmPipe
case "-S" :
*o = TsSocket
case "-L" :
*o = TsSmbLink
case "-k" :
*o = TsSticky
case "-g" :
*o = TsGIDSet
case "-u" :
*o = TsUIDSet
case "-G" :
*o = TsGrpOwn
case "-O" :
*o = TsUsrOwn
case "-N" :
*o = TsModif
case "-r" :
*o = TsRead
case "-w" :
*o = TsWrite
case "-x" :
*o = TsExec
case "-s" :
*o = TsNoEmpty
case "-t" :
*o = TsFdTerm
case "-z" :
*o = TsEmpStr
case "-n" :
*o = TsNempStr
case "-o" :
*o = TsOptSet
case "-v" :
*o = TsVarSet
case "-R" :
*o = TsRefVar
case "!" :
*o = TsNot
case "(" :
*o = TsParen
default :
return fmt .Errorf ("invalid UnTestOperator: %q" , text )
}
return nil
}
func (o *BinTestOperator ) UnmarshalText (text []byte ) error {
switch string (text ) {
case "=~" :
*o = TsReMatch
case "-nt" :
*o = TsNewer
case "-ot" :
*o = TsOlder
case "-ef" :
*o = TsDevIno
case "-eq" :
*o = TsEql
case "-ne" :
*o = TsNeq
case "-le" :
*o = TsLeq
case "-ge" :
*o = TsGeq
case "-lt" :
*o = TsLss
case "-gt" :
*o = TsGtr
case "&&" :
*o = AndTest
case "||" :
*o = OrTest
case "=" :
*o = TsMatchShort
case "==" :
*o = TsMatch
case "!=" :
*o = TsNoMatch
case "<" :
*o = TsBefore
case ">" :
*o = TsAfter
default :
return fmt .Errorf ("invalid BinTestOperator: %q" , text )
}
return nil
}
The pages are generated with Golds v0.8.7 . (GOOS=linux GOARCH=amd64)
Golds is a Go 101 project developed by Tapir Liu .
PR and bug reports are welcome and can be submitted to the issue list .
Please follow @zigo_101 (reachable from the left QR code) to get the latest news of Golds .