This repository was archived by the owner on Sep 20, 2021. It is now read-only.
File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 6767%token identifier [^\s\(\)\[\] ,\. ]+
6868
6969#expression:
70- logical_operation ()
70+ logical_operation_primary ()
7171
72- logical_operation:
72+ logical_operation_primary:
73+ logical_operation_secondary()
74+ ( ( ::or:: #or | ::xor:: #xor ) logical_operation_primary() )?
75+
76+ logical_operation_secondary:
7377 operation()
74- ( ( ::and:: #and | ::or:: #or | ::xor:: #xor ) logical_operation () )?
78+ ( ::and:: #and logical_operation_secondary () )?
7579
7680operation:
77- operand() ( <identifier> logical_operation () #operation )?
81+ operand() ( <identifier> logical_operation_primary () #operation )?
7882
7983operand:
80- ::parenthesis_:: logical_operation () ::_parenthesis::
84+ ::parenthesis_:: logical_operation_primary () ::_parenthesis::
8185 | value()
8286
8387value:
84- ::not:: logical_operation () #not
88+ ::not:: logical_operation_primary () #not
8589 | <true> | <false> | <null> | <float> | <integer> | <string>
8690 | array_declaration()
8791 | chain()
104108
105109#function_call:
106110 <identifier> ::parenthesis_::
107- ( logical_operation () ( ::comma:: logical_operation () )* )?
111+ ( logical_operation_primary () ( ::comma:: logical_operation_primary () )* )?
108112 ::_parenthesis::
Original file line number Diff line number Diff line change @@ -79,4 +79,43 @@ public function case_github_70()
7979 ->boolean ($ result )
8080 ->isTrue ();
8181 }
82+
83+ public function case_github_100_1 ()
84+ {
85+ $ this
86+ ->given (
87+ $ ruler = new LUT (),
88+ $ rule = '(false and true) or true '
89+ )
90+ ->when ($ result = $ ruler ->assert ($ rule ))
91+ ->then
92+ ->boolean ($ result )
93+ ->isTrue ();
94+ }
95+
96+ public function case_github_100_2 ()
97+ {
98+ $ this
99+ ->given (
100+ $ ruler = new LUT (),
101+ $ rule = 'false and true or true '
102+ )
103+ ->when ($ result = $ ruler ->assert ($ rule ))
104+ ->then
105+ ->boolean ($ result )
106+ ->isTrue ();
107+ }
108+
109+ public function case_github_100_3 ()
110+ {
111+ $ this
112+ ->given (
113+ $ ruler = new LUT (),
114+ $ rule = 'true or true and false '
115+ )
116+ ->when ($ result = $ ruler ->assert ($ rule ))
117+ ->then
118+ ->boolean ($ result )
119+ ->isTrue ();
120+ }
82121}
You can’t perform that action at this time.
0 commit comments