daniellansun commented on code in PR #1999:
URL: https://github.com/apache/groovy/pull/1999#discussion_r1406945262


##########
src/antlr/GroovyParser.g4:
##########
@@ -848,6 +848,9 @@ expression
     // logical or (||)  (level 13)
     |   left=expression nls op=OR nls right=expression                         
             #logicalOrExprAlt
 
+    // implication (==>)  (level 13.5)
+    |   <assoc=right> left=expression nls op=IMPLIES nls right=expression      
                           #implicationExprAlt

Review Comment:
   Logical Operators are left-associative, I think we do not need the assoc 
option. 
   
   For example,
   a ==> b ==> c
   should be parsed as
   (a ==> b) ==> c
   
   See also 
https://stackoverflow.com/questions/39317938/associativity-and-precedence-of-java-operators-in-antlrv4-grammar
    



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to