| 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 parseSortByscip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/selector/parser`/parseSortBy().(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`/.SortByscip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/selector/lexer`/SortBy.); 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 | 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`/.OpenParenscip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/selector/lexer`/OpenParen.); err != nil { |
| 15 | return nil, err |
| 16 | } |
| 17 | p.advancescip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/selector/parser`/Parser#advance().() |
| 18 | |
| 19 | sortExpr, err := p.parseExpressionsscip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/selector/parser`/Parser#parseExpressions().( |
| 20 | lexerscip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/selector/lexer`/.TokenKindsscip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/selector/lexer`/TokenKinds().(lexerscip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/selector/lexer`/.CloseParenscip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/selector/lexer`/CloseParen., lexerscip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/selector/lexer`/.Commascip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/selector/lexer`/Comma.), |
| 21 | nil, |
| 22 | true, |
| 23 | bpDefaultscip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/selector/parser`/bpDefault., |
| 24 | false, |
| 25 | ) |
| 26 | if err != nil { |
| 27 | return nil, err |
| 28 | } |
| 29 | |
| 30 | res := astscip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/selector/ast`/.SortByExprscip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/selector/ast`/SortByExpr#{ |
| 31 | Exprscip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/selector/ast`/SortByExpr#Expr.: sortExpr, |
| 32 | Descendingscip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/selector/ast`/SortByExpr#Descending.: false, |
| 33 | } |
| 34 | |
| 35 | if p.currentscip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/selector/parser`/Parser#current().().IsKindscip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/selector/lexer`/Token#IsKind().(lexerscip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/selector/lexer`/.CloseParenscip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/selector/lexer`/CloseParen.) { |
| 36 | p.advancescip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/selector/parser`/Parser#advance().() |
| 37 | return res, nil |
| 38 | } |
| 39 | |
| 40 | 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`/.Commascip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/selector/lexer`/Comma.); err != nil { |
| 41 | return nil, err |
| 42 | } |
| 43 | p.advancescip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/selector/parser`/Parser#advance().() |
| 44 | |
| 45 | 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`/.Ascscip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/selector/lexer`/Asc., lexerscip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/selector/lexer`/.Descscip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/selector/lexer`/Desc.); err != nil { |
| 46 | return nil, err |
| 47 | } |
| 48 | |
| 49 | if p.currentscip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/selector/parser`/Parser#current().().IsKindscip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/selector/lexer`/Token#IsKind().(lexerscip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/selector/lexer`/.Descscip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/selector/lexer`/Desc.) { |
| 50 | res.Descendingscip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/selector/ast`/SortByExpr#Descending. = true |
| 51 | } |
| 52 | |
| 53 | p.advancescip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/selector/parser`/Parser#advance().() |
| 54 | 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`/.CloseParenscip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/selector/lexer`/CloseParen.); err != nil { |
| 55 | return nil, err |
| 56 | } |
| 57 | p.advancescip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/selector/parser`/Parser#advance().() |
| 58 | |
| 59 | return res, nil |
| 60 | } |