| 1 | package parserscip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/selector/parser`/ |
| 2 | |
| 3 | import ( |
| 4 | "github.com/tomwright/dasel/v3/selector/astscip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/selector/ast`/" |
| 5 | "github.com/tomwright/dasel/v3/selector/lexerscip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/selector/lexer`/" |
| 6 | ) |
| 7 | |
| 8 | func parseRecursiveDescentscip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/selector/parser`/parseRecursiveDescent().(p *Parserscip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/selector/parser`/Parser#) (astscip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/selector/ast`/.Exprscip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/selector/ast`/Expr#, error) { |
| 9 | if err := p.expectscip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/selector/parser`/Parser#expect().(lexerscip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/selector/lexer`/.RecursiveDescentscip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/selector/lexer`/RecursiveDescent.); err != nil { |
| 10 | return nil, err |
| 11 | } |
| 12 | p.advancescip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/selector/parser`/Parser#advance().() |
| 13 | |
| 14 | cur := p.currentscip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/selector/parser`/Parser#current().() |
| 15 | |
| 16 | res := astscip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/selector/ast`/.RecursiveDescentExprscip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/selector/ast`/RecursiveDescentExpr#{} |
| 17 | |
| 18 | var err error |
| 19 | switch cur.Kindscip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/selector/lexer`/Token#Kind. { |
| 20 | case lexerscip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/selector/lexer`/.Starscip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/selector/lexer`/Star.: |
| 21 | res.IsWildcardscip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/selector/ast`/RecursiveDescentExpr#IsWildcard. = true |
| 22 | p.advancescip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/selector/parser`/Parser#advance().() |
| 23 | case lexerscip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/selector/lexer`/.OpenBracketscip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/selector/lexer`/OpenBracket.: |
| 24 | res.Exprscip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/selector/ast`/RecursiveDescentExpr#Expr., err = parseIndexSquareBracketsscip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/selector/parser`/parseIndexSquareBrackets().(p, true) |
| 25 | default: |
| 26 | res.Exprscip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/selector/ast`/RecursiveDescentExpr#Expr., err = parseSymbolscip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/selector/parser`/parseSymbol().(p, false, false) |
| 27 | } |
| 28 | |
| 29 | if err != nil { |
| 30 | return nil, err |
| 31 | } |
| 32 | |
| 33 | return res, nil |
| 34 | } |