Cleaning code

This commit is contained in:
Mike Farah 2020-12-27 22:56:15 +11:00
parent a88c2dc5d3
commit 6cc6fdf322
2 changed files with 0 additions and 11 deletions

View File

@ -312,14 +312,6 @@ var traversePathOperatorScenarios = []expressionScenario{
"D0, P[a 2], (!!str)::c\n", "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, skipDoc: true,
document: `{a: [a,b,c]}`, document: `{a: [a,b,c]}`,

View File

@ -172,7 +172,6 @@ func initLexer() (*lex.Lexer, error) {
lexer.Add([]byte(`\(`), literalToken(OpenBracket, false)) lexer.Add([]byte(`\(`), literalToken(OpenBracket, false))
lexer.Add([]byte(`\)`), literalToken(CloseBracket, true)) lexer.Add([]byte(`\)`), literalToken(CloseBracket, true))
// lexer.Add([]byte(`\.\[\]`), pathToken(false)) // traverseCollect(false)
lexer.Add([]byte(`\.\[`), literalToken(TraverseArrayCollect, false)) lexer.Add([]byte(`\.\[`), literalToken(TraverseArrayCollect, false))
lexer.Add([]byte(`\.\.`), opToken(RecursiveDescent)) 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(`\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("( |\t|\n|\r)+"), skip)
lexer.Add([]byte(`d[0-9]+`), documentToken()) lexer.Add([]byte(`d[0-9]+`), documentToken())