Commits

Maxim Moiseev committed 94bfc51

issue #2: support for boolean properties implemented

Comments (0)

Files changed (6)

src/Wepr.Tests/Person.fs

         and  set (bd) = _birthday <- birthday
         
     member this.Age
-        with get () = (DateTime.Now - _birthday).Days / 365
+        with get () = (DateTime.Now - _birthday).Days / 365
+        
+    member this.True
+        with get () = true

src/Wepr.Tests/WeprTests.fs

     [<Test>]
     member this.ComplexClauseTest () =
         _p =?> "BirthDay.Day = 1 AND (Name = 'John' OR Name = 'Doe')"
-        _p =!> "BirthDay.Day = 2 OR (Name = 'John' AND Name = 'Doe')"
+        _p =!> "BirthDay.Day = 2 OR (Name = 'John' AND Name = 'Doe')"
+        
+    [<Test>]
+    member this.BooleanPropertiesTest () =
+        _p =?> "True"
+        
+    [<Test>]
+    member this.ComplexClauseWithBooleanPropertyTest () =
+        _p =?> "True AND Name = 'John'"

src/Wepr/clause.fs

     | Strs of string array
 
 type IClauseVisitor<'TState> = 
+    abstract member BoolProp : String array -> 'TState
     abstract member Simple : String array * Condition * Val -> 'TState
     abstract member Complex : 'TState * LogicalOperation * 'TState -> 'TState
 
 type Clause =
+    | BoolProp of Item
     | Simple of Item * Cond * Val
     | Complex of Clause * LogOp * Clause
     
-    static member Fold simpleF complexF clause =
+    static member Fold boolPropF simpleF complexF clause =
         let unitem = function
             | Prop ss -> ss
         let rec loop clause cont =
             match clause with
+            | BoolProp item ->
+                cont <| boolPropF (unitem item)
             | Simple (item, condition, value) ->
                 cont (simpleF (unitem item) condition value)
             | Complex (l, op, r) ->
         loop clause id
         
     static member Visit (visitor:#IClauseVisitor<'TState>) clause =
+        let boolPropF props = visitor.BoolProp(props)
         let simpleF props (cond:Cond) value = visitor.Simple(props, (cond.ToEnum()), value)
         let complexF left (logOp:LogOp) right = visitor.Complex(left, (logOp.ToEnum()), right)
-        Clause.Fold simpleF complexF clause
+        Clause.Fold boolPropF simpleF complexF clause
         
             Expression.NewArrayInit(typeof<'a>, Array.map (constExpr >> asExpr) xs) |> asExpr
         let inExpr (vEx:Expression) (arrEx:Expression) =
             Expression.Call(typeof<Enumerable>, "Contains", [|vEx.Type|], arrEx, vEx) |> asExpr
+            
+        let boolPropF props =
+            toProperty par props
                 
         let simpleF props condition value =
             let lEx = toProperty par props
             | Or        -> logical Expression.Or
             | And       -> logical Expression.And
 
-        Clause.Fold simpleF complexF clause
+        Clause.Fold boolPropF simpleF complexF clause
 
     let toLambda (parameterType:Type) (clause:Clause) =
         let pEx = paramExpr parameterType

src/Wepr/parser.fs

     | 13 -> NONTERM_Clause 
     | 14 -> NONTERM_Clause 
     | 15 -> NONTERM_Clause 
-    | 16 -> NONTERM_Field 
-    | 17 -> NONTERM_Literal 
+    | 16 -> NONTERM_Clause 
+    | 17 -> NONTERM_Field 
     | 18 -> NONTERM_Literal 
     | 19 -> NONTERM_Literal 
     | 20 -> NONTERM_Literal 
+    | 21 -> NONTERM_Literal 
     | _ -> failwith "prodIdxToNonTerminal: bad production index"
 
 let _fsyacc_endOfInputTag = 24 
   | STRING _fsyacc_x -> Microsoft.FSharp.Core.Operators.box _fsyacc_x 
 let _fsyacc_gotos = [| 0us; 65535us; 1us; 65535us; 0us; 1us; 4us; 65535us; 0us; 2us; 3us; 4us; 8us; 6us; 9us; 7us; 4us; 65535us; 0us; 10us; 3us; 10us; 8us; 10us; 9us; 10us; 9us; 65535us; 11us; 12us; 13us; 14us; 15us; 16us; 17us; 18us; 19us; 20us; 21us; 22us; 23us; 24us; 25us; 26us; 27us; 28us; |]
 let _fsyacc_sparseGotoTableRowOffsets = [|0us; 1us; 3us; 8us; 13us; |]
-let _fsyacc_stateToProdIdxsTableElements = [| 1us; 0us; 1us; 0us; 3us; 1us; 3us; 4us; 1us; 2us; 3us; 2us; 3us; 4us; 1us; 2us; 3us; 3us; 3us; 4us; 3us; 3us; 4us; 4us; 1us; 3us; 1us; 4us; 11us; 5us; 6us; 7us; 8us; 9us; 10us; 11us; 12us; 13us; 14us; 15us; 1us; 5us; 1us; 5us; 1us; 6us; 1us; 6us; 1us; 7us; 1us; 7us; 1us; 8us; 1us; 8us; 1us; 9us; 1us; 9us; 1us; 10us; 1us; 10us; 1us; 11us; 1us; 11us; 1us; 12us; 1us; 12us; 1us; 13us; 1us; 13us; 2us; 14us; 15us; 2us; 14us; 15us; 1us; 14us; 1us; 14us; 1us; 15us; 1us; 15us; 1us; 16us; 1us; 17us; 1us; 18us; 1us; 19us; 1us; 20us; |]
-let _fsyacc_stateToProdIdxsTableRowOffsets = [|0us; 2us; 4us; 8us; 10us; 14us; 16us; 20us; 24us; 26us; 28us; 40us; 42us; 44us; 46us; 48us; 50us; 52us; 54us; 56us; 58us; 60us; 62us; 64us; 66us; 68us; 70us; 72us; 74us; 76us; 79us; 82us; 84us; 86us; 88us; 90us; 92us; 94us; 96us; 98us; |]
+let _fsyacc_stateToProdIdxsTableElements = [| 1us; 0us; 1us; 0us; 3us; 1us; 3us; 4us; 1us; 2us; 3us; 2us; 3us; 4us; 1us; 2us; 3us; 3us; 3us; 4us; 3us; 3us; 4us; 4us; 1us; 3us; 1us; 4us; 12us; 5us; 6us; 7us; 8us; 9us; 10us; 11us; 12us; 13us; 14us; 15us; 16us; 1us; 6us; 1us; 6us; 1us; 7us; 1us; 7us; 1us; 8us; 1us; 8us; 1us; 9us; 1us; 9us; 1us; 10us; 1us; 10us; 1us; 11us; 1us; 11us; 1us; 12us; 1us; 12us; 1us; 13us; 1us; 13us; 1us; 14us; 1us; 14us; 2us; 15us; 16us; 2us; 15us; 16us; 1us; 15us; 1us; 15us; 1us; 16us; 1us; 16us; 1us; 17us; 1us; 18us; 1us; 19us; 1us; 20us; 1us; 21us; |]
+let _fsyacc_stateToProdIdxsTableRowOffsets = [|0us; 2us; 4us; 8us; 10us; 14us; 16us; 20us; 24us; 26us; 28us; 41us; 43us; 45us; 47us; 49us; 51us; 53us; 55us; 57us; 59us; 61us; 63us; 65us; 67us; 69us; 71us; 73us; 75us; 77us; 80us; 83us; 85us; 87us; 89us; 91us; 93us; 95us; 97us; 99us; |]
 let _fsyacc_action_rows = 40
-let _fsyacc_actionTableElements = [|2us; 32768us; 13us; 3us; 19us; 35us; 0us; 49152us; 2us; 16385us; 11us; 8us; 12us; 9us; 2us; 32768us; 13us; 3us; 19us; 35us; 3us; 32768us; 11us; 8us; 12us; 9us; 14us; 5us; 0us; 16386us; 2us; 16387us; 11us; 8us; 12us; 9us; 2us; 16388us; 11us; 8us; 12us; 9us; 2us; 32768us; 13us; 3us; 19us; 35us; 2us; 32768us; 13us; 3us; 19us; 35us; 10us; 32768us; 1us; 11us; 2us; 13us; 3us; 15us; 4us; 17us; 5us; 19us; 6us; 21us; 7us; 23us; 8us; 25us; 9us; 27us; 10us; 29us; 4us; 32768us; 16us; 37us; 17us; 39us; 18us; 38us; 20us; 36us; 0us; 16389us; 4us; 32768us; 16us; 37us; 17us; 39us; 18us; 38us; 20us; 36us; 0us; 16390us; 4us; 32768us; 16us; 37us; 17us; 39us; 18us; 38us; 20us; 36us; 0us; 16391us; 4us; 32768us; 16us; 37us; 17us; 39us; 18us; 38us; 20us; 36us; 0us; 16392us; 4us; 32768us; 16us; 37us; 17us; 39us; 18us; 38us; 20us; 36us; 0us; 16393us; 4us; 32768us; 16us; 37us; 17us; 39us; 18us; 38us; 20us; 36us; 0us; 16394us; 4us; 32768us; 16us; 37us; 17us; 39us; 18us; 38us; 20us; 36us; 0us; 16395us; 4us; 32768us; 16us; 37us; 17us; 39us; 18us; 38us; 20us; 36us; 0us; 16396us; 4us; 32768us; 16us; 37us; 17us; 39us; 18us; 38us; 20us; 36us; 0us; 16397us; 1us; 32768us; 13us; 30us; 2us; 32768us; 17us; 33us; 18us; 31us; 1us; 32768us; 14us; 32us; 0us; 16398us; 1us; 32768us; 14us; 34us; 0us; 16399us; 0us; 16400us; 0us; 16401us; 0us; 16402us; 0us; 16403us; 0us; 16404us; |]
+let _fsyacc_actionTableElements = [|2us; 32768us; 13us; 3us; 19us; 35us; 0us; 49152us; 2us; 16385us; 11us; 8us; 12us; 9us; 2us; 32768us; 13us; 3us; 19us; 35us; 3us; 32768us; 11us; 8us; 12us; 9us; 14us; 5us; 0us; 16386us; 2us; 16387us; 11us; 8us; 12us; 9us; 2us; 16388us; 11us; 8us; 12us; 9us; 2us; 32768us; 13us; 3us; 19us; 35us; 2us; 32768us; 13us; 3us; 19us; 35us; 10us; 16389us; 1us; 11us; 2us; 13us; 3us; 15us; 4us; 17us; 5us; 19us; 6us; 21us; 7us; 23us; 8us; 25us; 9us; 27us; 10us; 29us; 4us; 32768us; 16us; 37us; 17us; 39us; 18us; 38us; 20us; 36us; 0us; 16390us; 4us; 32768us; 16us; 37us; 17us; 39us; 18us; 38us; 20us; 36us; 0us; 16391us; 4us; 32768us; 16us; 37us; 17us; 39us; 18us; 38us; 20us; 36us; 0us; 16392us; 4us; 32768us; 16us; 37us; 17us; 39us; 18us; 38us; 20us; 36us; 0us; 16393us; 4us; 32768us; 16us; 37us; 17us; 39us; 18us; 38us; 20us; 36us; 0us; 16394us; 4us; 32768us; 16us; 37us; 17us; 39us; 18us; 38us; 20us; 36us; 0us; 16395us; 4us; 32768us; 16us; 37us; 17us; 39us; 18us; 38us; 20us; 36us; 0us; 16396us; 4us; 32768us; 16us; 37us; 17us; 39us; 18us; 38us; 20us; 36us; 0us; 16397us; 4us; 32768us; 16us; 37us; 17us; 39us; 18us; 38us; 20us; 36us; 0us; 16398us; 1us; 32768us; 13us; 30us; 2us; 32768us; 17us; 33us; 18us; 31us; 1us; 32768us; 14us; 32us; 0us; 16399us; 1us; 32768us; 14us; 34us; 0us; 16400us; 0us; 16401us; 0us; 16402us; 0us; 16403us; 0us; 16404us; 0us; 16405us; |]
 let _fsyacc_actionTableRowOffsets = [|0us; 3us; 4us; 7us; 10us; 14us; 15us; 18us; 21us; 24us; 27us; 38us; 43us; 44us; 49us; 50us; 55us; 56us; 61us; 62us; 67us; 68us; 73us; 74us; 79us; 80us; 85us; 86us; 91us; 92us; 94us; 97us; 99us; 100us; 102us; 103us; 104us; 105us; 106us; 107us; |]
-let _fsyacc_reductionSymbolCounts = [|1us; 1us; 3us; 3us; 3us; 3us; 3us; 3us; 3us; 3us; 3us; 3us; 3us; 3us; 5us; 5us; 1us; 1us; 1us; 1us; 1us; |]
-let _fsyacc_productionToNonTerminalTable = [|0us; 1us; 2us; 2us; 2us; 2us; 2us; 2us; 2us; 2us; 2us; 2us; 2us; 2us; 2us; 2us; 3us; 4us; 4us; 4us; 4us; |]
-let _fsyacc_immediateActions = [|65535us; 49152us; 65535us; 65535us; 65535us; 16386us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 16389us; 65535us; 16390us; 65535us; 16391us; 65535us; 16392us; 65535us; 16393us; 65535us; 16394us; 65535us; 16395us; 65535us; 16396us; 65535us; 16397us; 65535us; 65535us; 65535us; 16398us; 65535us; 16399us; 16400us; 16401us; 16402us; 16403us; 16404us; |]
+let _fsyacc_reductionSymbolCounts = [|1us; 1us; 3us; 3us; 3us; 1us; 3us; 3us; 3us; 3us; 3us; 3us; 3us; 3us; 3us; 5us; 5us; 1us; 1us; 1us; 1us; 1us; |]
+let _fsyacc_productionToNonTerminalTable = [|0us; 1us; 2us; 2us; 2us; 2us; 2us; 2us; 2us; 2us; 2us; 2us; 2us; 2us; 2us; 2us; 2us; 3us; 4us; 4us; 4us; 4us; |]
+let _fsyacc_immediateActions = [|65535us; 49152us; 65535us; 65535us; 65535us; 16386us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 16390us; 65535us; 16391us; 65535us; 16392us; 65535us; 16393us; 65535us; 16394us; 65535us; 16395us; 65535us; 16396us; 65535us; 16397us; 65535us; 16398us; 65535us; 65535us; 65535us; 16399us; 65535us; 16400us; 16401us; 16402us; 16403us; 16404us; 16405us; |]
 let _fsyacc_reductions ()  =    [| 
-# 215 "D:\work\lib\wepr\src\Wepr\parser.fs"
+# 216 "D:\work\lib\wepr\src\Wepr\parser.fs"
         (fun (parseState : Microsoft.FSharp.Text.Parsing.IParseState) ->
             let _1 = (let data = parseState.GetInput(1) in (Microsoft.FSharp.Core.Operators.unbox data : Clause)) in
             Microsoft.FSharp.Core.Operators.box
                       raise (Microsoft.FSharp.Text.Parsing.Accept(Microsoft.FSharp.Core.Operators.box _1))
                    )
                  : '_startStart));
-# 224 "D:\work\lib\wepr\src\Wepr\parser.fs"
+# 225 "D:\work\lib\wepr\src\Wepr\parser.fs"
         (fun (parseState : Microsoft.FSharp.Text.Parsing.IParseState) ->
             let _1 = (let data = parseState.GetInput(1) in (Microsoft.FSharp.Core.Operators.unbox data : 'Clause)) in
             Microsoft.FSharp.Core.Operators.box
                    )
 # 20 "D:\work\lib\wepr\src\Wepr\parser.fsy"
                  : Clause));
-# 235 "D:\work\lib\wepr\src\Wepr\parser.fs"
+# 236 "D:\work\lib\wepr\src\Wepr\parser.fs"
         (fun (parseState : Microsoft.FSharp.Text.Parsing.IParseState) ->
             let _2 = (let data = parseState.GetInput(2) in (Microsoft.FSharp.Core.Operators.unbox data : 'Clause)) in
             Microsoft.FSharp.Core.Operators.box
                    )
 # 23 "D:\work\lib\wepr\src\Wepr\parser.fsy"
                  : 'Clause));
-# 246 "D:\work\lib\wepr\src\Wepr\parser.fs"
+# 247 "D:\work\lib\wepr\src\Wepr\parser.fs"
         (fun (parseState : Microsoft.FSharp.Text.Parsing.IParseState) ->
             let _1 = (let data = parseState.GetInput(1) in (Microsoft.FSharp.Core.Operators.unbox data : 'Clause)) in
             let _3 = (let data = parseState.GetInput(3) in (Microsoft.FSharp.Core.Operators.unbox data : 'Clause)) in
                    )
 # 24 "D:\work\lib\wepr\src\Wepr\parser.fsy"
                  : 'Clause));
-# 258 "D:\work\lib\wepr\src\Wepr\parser.fs"
+# 259 "D:\work\lib\wepr\src\Wepr\parser.fs"
         (fun (parseState : Microsoft.FSharp.Text.Parsing.IParseState) ->
             let _1 = (let data = parseState.GetInput(1) in (Microsoft.FSharp.Core.Operators.unbox data : 'Clause)) in
             let _3 = (let data = parseState.GetInput(3) in (Microsoft.FSharp.Core.Operators.unbox data : 'Clause)) in
                    )
 # 25 "D:\work\lib\wepr\src\Wepr\parser.fsy"
                  : 'Clause));
-# 270 "D:\work\lib\wepr\src\Wepr\parser.fs"
+# 271 "D:\work\lib\wepr\src\Wepr\parser.fs"
         (fun (parseState : Microsoft.FSharp.Text.Parsing.IParseState) ->
             let _1 = (let data = parseState.GetInput(1) in (Microsoft.FSharp.Core.Operators.unbox data : 'Field)) in
-            let _3 = (let data = parseState.GetInput(3) in (Microsoft.FSharp.Core.Operators.unbox data : 'Literal)) in
             Microsoft.FSharp.Core.Operators.box
                 (
                    (
 # 26 "D:\work\lib\wepr\src\Wepr\parser.fsy"
-                                                       Simple (_1, Eq, _3) 
+                                                       BoolProp (_1) 
                    )
 # 26 "D:\work\lib\wepr\src\Wepr\parser.fsy"
                  : 'Clause));
                 (
                    (
 # 27 "D:\work\lib\wepr\src\Wepr\parser.fsy"
-                                                       Simple (_1, Neq, _3) 
+                                                       Simple (_1, Eq, _3) 
                    )
 # 27 "D:\work\lib\wepr\src\Wepr\parser.fsy"
                  : 'Clause));
                 (
                    (
 # 28 "D:\work\lib\wepr\src\Wepr\parser.fsy"
-                                                       Simple (_1, Less, _3) 
+                                                       Simple (_1, Neq, _3) 
                    )
 # 28 "D:\work\lib\wepr\src\Wepr\parser.fsy"
                  : 'Clause));
                 (
                    (
 # 29 "D:\work\lib\wepr\src\Wepr\parser.fsy"
-                                                       Simple (_1, Greater, _3) 
+                                                       Simple (_1, Less, _3) 
                    )
 # 29 "D:\work\lib\wepr\src\Wepr\parser.fsy"
                  : 'Clause));
                 (
                    (
 # 30 "D:\work\lib\wepr\src\Wepr\parser.fsy"
-                                                       Simple (_1, LessOrEqual, _3) 
+                                                       Simple (_1, Greater, _3) 
                    )
 # 30 "D:\work\lib\wepr\src\Wepr\parser.fsy"
                  : 'Clause));
                 (
                    (
 # 31 "D:\work\lib\wepr\src\Wepr\parser.fsy"
-                                                       Simple (_1, GreaterOrEqual, _3) 
+                                                       Simple (_1, LessOrEqual, _3) 
                    )
 # 31 "D:\work\lib\wepr\src\Wepr\parser.fsy"
                  : 'Clause));
                 (
                    (
 # 32 "D:\work\lib\wepr\src\Wepr\parser.fsy"
-                                                       Simple (_1, Contains, _3) 
+                                                       Simple (_1, GreaterOrEqual, _3) 
                    )
 # 32 "D:\work\lib\wepr\src\Wepr\parser.fsy"
                  : 'Clause));
                 (
                    (
 # 33 "D:\work\lib\wepr\src\Wepr\parser.fsy"
-                                                       Simple (_1, StartsWith, _3) 
+                                                       Simple (_1, Contains, _3) 
                    )
 # 33 "D:\work\lib\wepr\src\Wepr\parser.fsy"
                  : 'Clause));
                 (
                    (
 # 34 "D:\work\lib\wepr\src\Wepr\parser.fsy"
-                                                       Simple (_1, EndsWith, _3) 
+                                                       Simple (_1, StartsWith, _3) 
                    )
 # 34 "D:\work\lib\wepr\src\Wepr\parser.fsy"
                  : 'Clause));
 # 378 "D:\work\lib\wepr\src\Wepr\parser.fs"
         (fun (parseState : Microsoft.FSharp.Text.Parsing.IParseState) ->
             let _1 = (let data = parseState.GetInput(1) in (Microsoft.FSharp.Core.Operators.unbox data : 'Field)) in
-            let _4 = (let data = parseState.GetInput(4) in (Microsoft.FSharp.Core.Operators.unbox data : string array)) in
+            let _3 = (let data = parseState.GetInput(3) in (Microsoft.FSharp.Core.Operators.unbox data : 'Literal)) in
             Microsoft.FSharp.Core.Operators.box
                 (
                    (
 # 35 "D:\work\lib\wepr\src\Wepr\parser.fsy"
-                                                            Simple (_1, In, (Strs _4)) 
+                                                       Simple (_1, EndsWith, _3) 
                    )
 # 35 "D:\work\lib\wepr\src\Wepr\parser.fsy"
                  : 'Clause));
 # 390 "D:\work\lib\wepr\src\Wepr\parser.fs"
         (fun (parseState : Microsoft.FSharp.Text.Parsing.IParseState) ->
             let _1 = (let data = parseState.GetInput(1) in (Microsoft.FSharp.Core.Operators.unbox data : 'Field)) in
-            let _4 = (let data = parseState.GetInput(4) in (Microsoft.FSharp.Core.Operators.unbox data : int array)) in
+            let _4 = (let data = parseState.GetInput(4) in (Microsoft.FSharp.Core.Operators.unbox data : string array)) in
             Microsoft.FSharp.Core.Operators.box
                 (
                    (
 # 36 "D:\work\lib\wepr\src\Wepr\parser.fsy"
-                                                            Simple (_1, In, (Numbers _4)) 
+                                                            Simple (_1, In, (Strs _4)) 
                    )
 # 36 "D:\work\lib\wepr\src\Wepr\parser.fsy"
                  : 'Clause));
 # 402 "D:\work\lib\wepr\src\Wepr\parser.fs"
         (fun (parseState : Microsoft.FSharp.Text.Parsing.IParseState) ->
+            let _1 = (let data = parseState.GetInput(1) in (Microsoft.FSharp.Core.Operators.unbox data : 'Field)) in
+            let _4 = (let data = parseState.GetInput(4) in (Microsoft.FSharp.Core.Operators.unbox data : int array)) in
+            Microsoft.FSharp.Core.Operators.box
+                (
+                   (
+# 37 "D:\work\lib\wepr\src\Wepr\parser.fsy"
+                                                            Simple (_1, In, (Numbers _4)) 
+                   )
+# 37 "D:\work\lib\wepr\src\Wepr\parser.fsy"
+                 : 'Clause));
+# 414 "D:\work\lib\wepr\src\Wepr\parser.fs"
+        (fun (parseState : Microsoft.FSharp.Text.Parsing.IParseState) ->
             let _1 = (let data = parseState.GetInput(1) in (Microsoft.FSharp.Core.Operators.unbox data : string array)) in
             Microsoft.FSharp.Core.Operators.box
                 (
                    (
-# 39 "D:\work\lib\wepr\src\Wepr\parser.fsy"
+# 40 "D:\work\lib\wepr\src\Wepr\parser.fsy"
                                                        Prop (_1) 
                    )
-# 39 "D:\work\lib\wepr\src\Wepr\parser.fsy"
+# 40 "D:\work\lib\wepr\src\Wepr\parser.fsy"
                  : 'Field));
-# 413 "D:\work\lib\wepr\src\Wepr\parser.fs"
+# 425 "D:\work\lib\wepr\src\Wepr\parser.fs"
         (fun (parseState : Microsoft.FSharp.Text.Parsing.IParseState) ->
             let _1 = (let data = parseState.GetInput(1) in (Microsoft.FSharp.Core.Operators.unbox data : string)) in
             Microsoft.FSharp.Core.Operators.box
                 (
                    (
-# 42 "D:\work\lib\wepr\src\Wepr\parser.fsy"
+# 43 "D:\work\lib\wepr\src\Wepr\parser.fsy"
                                                        Str _1 
                    )
-# 42 "D:\work\lib\wepr\src\Wepr\parser.fsy"
+# 43 "D:\work\lib\wepr\src\Wepr\parser.fsy"
                  : 'Literal));
-# 424 "D:\work\lib\wepr\src\Wepr\parser.fs"
+# 436 "D:\work\lib\wepr\src\Wepr\parser.fs"
         (fun (parseState : Microsoft.FSharp.Text.Parsing.IParseState) ->
             let _1 = (let data = parseState.GetInput(1) in (Microsoft.FSharp.Core.Operators.unbox data : int)) in
             Microsoft.FSharp.Core.Operators.box
                 (
                    (
-# 43 "D:\work\lib\wepr\src\Wepr\parser.fsy"
+# 44 "D:\work\lib\wepr\src\Wepr\parser.fsy"
                                                        Number _1 
                    )
-# 43 "D:\work\lib\wepr\src\Wepr\parser.fsy"
+# 44 "D:\work\lib\wepr\src\Wepr\parser.fsy"
                  : 'Literal));
-# 435 "D:\work\lib\wepr\src\Wepr\parser.fs"
+# 447 "D:\work\lib\wepr\src\Wepr\parser.fs"
         (fun (parseState : Microsoft.FSharp.Text.Parsing.IParseState) ->
             let _1 = (let data = parseState.GetInput(1) in (Microsoft.FSharp.Core.Operators.unbox data : string array)) in
             Microsoft.FSharp.Core.Operators.box
                 (
                    (
-# 44 "D:\work\lib\wepr\src\Wepr\parser.fsy"
+# 45 "D:\work\lib\wepr\src\Wepr\parser.fsy"
                                                        Strs _1 
                    )
-# 44 "D:\work\lib\wepr\src\Wepr\parser.fsy"
+# 45 "D:\work\lib\wepr\src\Wepr\parser.fsy"
                  : 'Literal));
-# 446 "D:\work\lib\wepr\src\Wepr\parser.fs"
+# 458 "D:\work\lib\wepr\src\Wepr\parser.fs"
         (fun (parseState : Microsoft.FSharp.Text.Parsing.IParseState) ->
             let _1 = (let data = parseState.GetInput(1) in (Microsoft.FSharp.Core.Operators.unbox data : int array)) in
             Microsoft.FSharp.Core.Operators.box
                 (
                    (
-# 45 "D:\work\lib\wepr\src\Wepr\parser.fsy"
+# 46 "D:\work\lib\wepr\src\Wepr\parser.fsy"
                                                        Numbers _1 
                    )
-# 45 "D:\work\lib\wepr\src\Wepr\parser.fsy"
+# 46 "D:\work\lib\wepr\src\Wepr\parser.fsy"
                  : 'Literal));
 |]
-# 458 "D:\work\lib\wepr\src\Wepr\parser.fs"
+# 470 "D:\work\lib\wepr\src\Wepr\parser.fs"
 let tables () : Microsoft.FSharp.Text.Parsing.Tables<_> = 
   { reductions= _fsyacc_reductions ();
     endOfInputTag = _fsyacc_endOfInputTag;

src/Wepr/parser.fsy

       LPAREN Clause RPAREN      { $2 }
     | Clause AND Clause         { Complex ($1, And, $3) }
     | Clause OR Clause          { Complex ($1, Or, $3) }
+    | Field                     { BoolProp ($1) }
     | Field EQ Literal          { Simple ($1, Eq, $3) }
     | Field NEQ Literal         { Simple ($1, Neq, $3) }
     | Field LESS Literal        { Simple ($1, Less, $3) }