mirror of
https://github.com/mikefarah/yq.git
synced 2024-11-12 13:48:06 +00:00
Cleaning code
This commit is contained in:
parent
a88c2dc5d3
commit
6cc6fdf322
@ -312,14 +312,6 @@ var traversePathOperatorScenarios = []expressionScenario{
|
||||
"D0, P[a 2], (!!str)::c\n",
|
||||
},
|
||||
},
|
||||
{
|
||||
skipDoc: true,
|
||||
document: `{a: [a,b,c]}`,
|
||||
expression: `.a.[0]`,
|
||||
expected: []string{
|
||||
"D0, P[a 0], (!!str)::a\n",
|
||||
},
|
||||
},
|
||||
{
|
||||
skipDoc: true,
|
||||
document: `{a: [a,b,c]}`,
|
||||
|
@ -172,7 +172,6 @@ func initLexer() (*lex.Lexer, error) {
|
||||
lexer.Add([]byte(`\(`), literalToken(OpenBracket, false))
|
||||
lexer.Add([]byte(`\)`), literalToken(CloseBracket, true))
|
||||
|
||||
// lexer.Add([]byte(`\.\[\]`), pathToken(false)) // traverseCollect(false)
|
||||
lexer.Add([]byte(`\.\[`), literalToken(TraverseArrayCollect, false))
|
||||
lexer.Add([]byte(`\.\.`), opToken(RecursiveDescent))
|
||||
|
||||
@ -216,8 +215,6 @@ func initLexer() (*lex.Lexer, error) {
|
||||
|
||||
lexer.Add([]byte(`\s*\|=\s*`), opTokenWithPrefs(Assign, nil, &AssignOpPreferences{true}))
|
||||
|
||||
// lexer.Add([]byte(`\.\[-?[0-9]+\]`), arrayIndextoken(true)) // traverseCollect(true)
|
||||
|
||||
lexer.Add([]byte("( |\t|\n|\r)+"), skip)
|
||||
|
||||
lexer.Add([]byte(`d[0-9]+`), documentToken())
|
||||
|
Loading…
Reference in New Issue
Block a user