File tree Expand file tree Collapse file tree 6 files changed +39
-8
lines changed Expand file tree Collapse file tree 6 files changed +39
-8
lines changed Original file line number Diff line number Diff line change @@ -6,6 +6,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
66
77## [ Unreleased]  
88
9+ ## [ 0.6.1]  - 2023-05-25 
10+ ### Fixed  
11+ -  Fixed AND and OR not early exiting evaluation.
12+ 
913## [ 0.6.0]  - 2023-01-05 
1014### Added  
1115-  Added new ` _uppercase_ `  & ` _title_ `  COERCE identifiers.
@@ -58,7 +62,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
5862### Added  
5963-  Initial conversion from https://github.com/rust-playground/ksql .
6064
61- [ Unreleased ] : https://github.com/go-playground/ksql/compare/v0.6.0...HEAD 
65+ [ Unreleased ] : https://github.com/go-playground/ksql/compare/v0.6.1...HEAD 
66+ [ 0.6.1 ] : https://github.com/go-playground/ksql/compare/v0.6.0...v0.6.1 
6267[ 0.6.0 ] : https://github.com/go-playground/ksql/compare/v0.5.1...v0.6.0 
6368[ 0.5.1 ] : https://github.com/go-playground/ksql/compare/v0.5.0...v0.5.1 
6469[ 0.5.0 ] : https://github.com/go-playground/ksql/compare/v0.4.0...v0.5.0 
Original file line number Diff line number Diff line change 11ksql
22===== 
3- ![ Project status] ( https://img.shields.io/badge/version-0.5 .1-green.svg ) 
3+ ![ Project status] ( https://img.shields.io/badge/version-0.6 .1-green.svg ) 
44[ ![ GoDoc] ( https://godoc.org/github.com/go-playground/ksql?status.svg )] ( https://pkg.go.dev/github.com/go-playground/ksql ) 
55![ License] ( https://img.shields.io/dub/l/vibe-d.svg ) 
66
Original file line number Diff line number Diff line change @@ -4,14 +4,14 @@ go 1.18
44
55require  (
66	github.com/araddon/dateparse  v0.0.0-20210429162001-6b43995a97de 
7- 	github.com/go-playground/pkg/v5  v5.11.0 
7+ 	github.com/go-playground/itertools  v0.1.0 
8+ 	github.com/go-playground/pkg/v5  v5.18.0 
89	github.com/stretchr/testify  v1.8.1 
910	github.com/tidwall/gjson  v1.14.4 
1011)
1112
1213require  (
1314	github.com/davecgh/go-spew  v1.1.1  //  indirect
14- 	github.com/go-playground/itertools  v0.1.0  //  indirect
1515	github.com/pmezard/go-difflib  v1.0.0  //  indirect
1616	github.com/tidwall/match  v1.1.1  //  indirect
1717	github.com/tidwall/pretty  v1.2.0  //  indirect
Original file line number Diff line number Diff line change @@ -3,10 +3,11 @@ github.com/araddon/dateparse v0.0.0-20210429162001-6b43995a97de/go.mod h1:DCaWoU
33github.com/davecgh/go-spew  v1.1.0 /go.mod  h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38 =
44github.com/davecgh/go-spew  v1.1.1  h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c =
55github.com/davecgh/go-spew  v1.1.1 /go.mod  h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38 =
6+ github.com/go-playground/assert/v2  v2.2.0  h1:JvknZsQTYeFEAhQwI4qEt9cyV5ONwRHC+lYKSsYSR8s =
67github.com/go-playground/itertools  v0.1.0  h1:isiUTLIViAz4J3qWrowvRoOYWSXy2ubkXKNJfujE3Sc =
78github.com/go-playground/itertools  v0.1.0 /go.mod  h1:+TD1WVpn32jr+GpvO+nnb2xXD45SSzt18Fo/C0y9PJE =
8- github.com/go-playground/pkg/v5  v5.11 .0  h1:yYYmh0RLKBxiLbEwO7HZtp8XVDDuyIqHmhtrmuO0nsg =
9- github.com/go-playground/pkg/v5  v5.11 .0 /go.mod  h1:eT8XZeFHnqZkfkpkbI8ayjfCw9GohV2/j8STbVmoR6s =
9+ github.com/go-playground/pkg/v5  v5.18 .0  h1:qnYuhWhwLdWj6ut9jagFjaiUI6PZTo3SafR5Um9w214 =
10+ github.com/go-playground/pkg/v5  v5.18 .0 /go.mod  h1:eT8XZeFHnqZkfkpkbI8ayjfCw9GohV2/j8STbVmoR6s =
1011github.com/mattn/go-runewidth  v0.0.10 /go.mod  h1:RAqKPSqVFrSLVXbA8x7dzmKdmGzieGRCM46jaSJTDAk =
1112github.com/pmezard/go-difflib  v1.0.0  h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM =
1213github.com/pmezard/go-difflib  v1.0.0 /go.mod  h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4 =
Original file line number Diff line number Diff line change @@ -879,6 +879,7 @@ func (e eq) Calculate(src []byte) (any, error) {
879879	if  err  !=  nil  {
880880		return  nil , err 
881881	}
882+ 
882883	return  reflect .DeepEqual (left , right ), nil 
883884}
884885
@@ -1027,6 +1028,7 @@ func (n not) Calculate(src []byte) (any, error) {
10271028	if  err  !=  nil  {
10281029		return  nil , err 
10291030	}
1031+ 
10301032	switch  t  :=  value .(type ) {
10311033	case  bool :
10321034		return  ! t , nil 
@@ -1047,6 +1049,14 @@ func (o or) Calculate(src []byte) (any, error) {
10471049	if  err  !=  nil  {
10481050		return  nil , err 
10491051	}
1052+ 
1053+ 	switch  t  :=  left .(type ) {
1054+ 	case  bool :
1055+ 		if  t  {
1056+ 			return  true , nil 
1057+ 		}
1058+ 	}
1059+ 
10501060	right , err  :=  o .right .Calculate (src )
10511061	if  err  !=  nil  {
10521062		return  nil , err 
@@ -1076,6 +1086,16 @@ func (a and) Calculate(src []byte) (any, error) {
10761086	if  err  !=  nil  {
10771087		return  nil , err 
10781088	}
1089+ 
1090+ 	switch  t  :=  left .(type ) {
1091+ 	case  bool :
1092+ 		if  ! t  {
1093+ 			return  false , nil 
1094+ 		}
1095+ 	default :
1096+ 		return  false , nil 
1097+ 	}
1098+ 
10791099	right , err  :=  a .right .Calculate (src )
10801100	if  err  !=  nil  {
10811101		return  nil , err 
Original file line number Diff line number Diff line change 11package  ksql
22
33import  (
4+ 	"github.com/stretchr/testify/require" 
45	"testing" 
56	"time" 
6- 
7- 	"github.com/stretchr/testify/require" 
87)
98
109func  TestParser (t  * testing.T ) {
@@ -620,6 +619,12 @@ func TestParser(t *testing.T) {
620619			src :      `{"name":"mr."}` ,
621620			expected : "Mr." ,
622621		},
622+ 		{
623+ 			name :     "NOT NULL AND" ,
624+ 			exp :      `.MyValue != NULL && .MyValue > 19` ,
625+ 			src :      `{}` ,
626+ 			expected : false ,
627+ 		},
623628	}
624629
625630	for  _ , tc  :=  range  tests  {
    
 
   
 
     
   
   
          
     
  
    
     
 
    
      
     
 
     
    You can’t perform that action at this time.
  
 
    
  
     
    
      
        
     
 
       
      
     
   
 
    
    
  
 
  
 
     
    
0 commit comments