| 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 parseReducescip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/selector/parser`/parseReduce().(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`/.Reducescip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/selector/lexer`/Reduce.); 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 | // Parse first expression: expr (break on Comma) |
| 20 | expr, err := p.parseExpressionsscip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/selector/parser`/Parser#parseExpressions().( |
| 21 | 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`/.Commascip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/selector/lexer`/Comma.), |
| 22 | nil, |
| 23 | true, |
| 24 | bpDefaultscip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/selector/parser`/bpDefault., |
| 25 | false, |
| 26 | ) |
| 27 | if err != nil { |
| 28 | return nil, err |
| 29 | } |
| 30 | |
| 31 | 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 { |
| 32 | return nil, err |
| 33 | } |
| 34 | p.advancescip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/selector/parser`/Parser#advance().() |
| 35 | |
| 36 | // Parse second expression: init (break on Comma) |
| 37 | init, err := p.parseExpressionsscip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/selector/parser`/Parser#parseExpressions().( |
| 38 | 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`/.Commascip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/selector/lexer`/Comma.), |
| 39 | nil, |
| 40 | true, |
| 41 | bpDefaultscip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/selector/parser`/bpDefault., |
| 42 | false, |
| 43 | ) |
| 44 | if err != nil { |
| 45 | return nil, err |
| 46 | } |
| 47 | |
| 48 | 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 { |
| 49 | return nil, err |
| 50 | } |
| 51 | p.advancescip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/selector/parser`/Parser#advance().() |
| 52 | |
| 53 | // Parse third expression: update (break on CloseParen) |
| 54 | update, err := p.parseExpressionsscip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/selector/parser`/Parser#parseExpressions().( |
| 55 | 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.), |
| 56 | nil, |
| 57 | true, |
| 58 | bpDefaultscip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/selector/parser`/bpDefault., |
| 59 | false, |
| 60 | ) |
| 61 | if err != nil { |
| 62 | return nil, err |
| 63 | } |
| 64 | |
| 65 | 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 { |
| 66 | return nil, err |
| 67 | } |
| 68 | p.advancescip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/selector/parser`/Parser#advance().() |
| 69 | |
| 70 | reduceExpr := astscip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/selector/ast`/.ReduceExprscip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/selector/ast`/ReduceExpr#{ |
| 71 | Exprscip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/selector/ast`/ReduceExpr#Expr.: expr, |
| 72 | Initscip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/selector/ast`/ReduceExpr#Init.: init, |
| 73 | Updatescip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/selector/ast`/ReduceExpr#Update.: update, |
| 74 | } |
| 75 | |
| 76 | res, err := parseFollowingSymbolscip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/selector/parser`/parseFollowingSymbol().(p, reduceExpr) |
| 77 | if err != nil { |
| 78 | return nil, err |
| 79 | } |
| 80 | |
| 81 | return res, nil |
| 82 | } |