Simplify JSON expression parsing
This commit is contained in:
parent
28c70a792a
commit
28d1806785
1 changed files with 3 additions and 9 deletions
12
sql/data.go
12
sql/data.go
|
@ -105,13 +105,11 @@ func (p *parser) parseDiff() (exp []Expr, err error) {
|
||||||
return nil, &ParseError{Found: lit, Expected: []string{"json"}}
|
return nil, &ParseError{Found: lit, Expected: []string{"json"}}
|
||||||
}
|
}
|
||||||
|
|
||||||
val, err := p.declare(tok, lit)
|
one.JSON, err = p.declare(tok, lit)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, &ParseError{Found: lit, Expected: []string{"json"}}
|
return nil, &ParseError{Found: lit, Expected: []string{"json"}}
|
||||||
}
|
}
|
||||||
|
|
||||||
one.JSON = val
|
|
||||||
|
|
||||||
exp = append(exp, one)
|
exp = append(exp, one)
|
||||||
|
|
||||||
return
|
return
|
||||||
|
@ -127,13 +125,11 @@ func (p *parser) parseMerge() (exp []Expr, err error) {
|
||||||
return nil, &ParseError{Found: lit, Expected: []string{"json"}}
|
return nil, &ParseError{Found: lit, Expected: []string{"json"}}
|
||||||
}
|
}
|
||||||
|
|
||||||
val, err := p.declare(tok, lit)
|
one.JSON, err = p.declare(tok, lit)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, &ParseError{Found: lit, Expected: []string{"json"}}
|
return nil, &ParseError{Found: lit, Expected: []string{"json"}}
|
||||||
}
|
}
|
||||||
|
|
||||||
one.JSON = val
|
|
||||||
|
|
||||||
exp = append(exp, one)
|
exp = append(exp, one)
|
||||||
|
|
||||||
return
|
return
|
||||||
|
@ -149,13 +145,11 @@ func (p *parser) parseContent() (exp []Expr, err error) {
|
||||||
return nil, &ParseError{Found: lit, Expected: []string{"json"}}
|
return nil, &ParseError{Found: lit, Expected: []string{"json"}}
|
||||||
}
|
}
|
||||||
|
|
||||||
val, err := p.declare(tok, lit)
|
one.JSON, err = p.declare(tok, lit)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, &ParseError{Found: lit, Expected: []string{"json"}}
|
return nil, &ParseError{Found: lit, Expected: []string{"json"}}
|
||||||
}
|
}
|
||||||
|
|
||||||
one.JSON = val
|
|
||||||
|
|
||||||
exp = append(exp, one)
|
exp = append(exp, one)
|
||||||
|
|
||||||
return
|
return
|
||||||
|
|
Loading…
Reference in a new issue