Skip to content

Commit

Permalink
Fix operator predecence
Browse files Browse the repository at this point in the history
  • Loading branch information
koppor committed Nov 14, 2021
1 parent e3feae5 commit a6de0d0
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions src/main/antlr4/org/jabref/search/Search.g4
Original file line number Diff line number Diff line change
Expand Up @@ -34,10 +34,11 @@ start:
// labels are used to refer to parts of the rules in the generated code later on
// label=actualThingy
expression:
LPAREN expression RPAREN #parenExpression // example: (author=miller)
| left=expression operator=(AND | OR) right=expression #binaryExpression // example: author = miller and title = test
| NOT expression #unaryExpression // example: not author = miller
| comparison #atomExpression
LPAREN expression RPAREN #parenExpression // example: (author=miller)
| NOT expression #unaryExpression // example: not author = miller
| left=expression operator=AND right=expression #binaryExpression // example: author = miller and title = test
| left=expression operator=OR right=expression #binaryExpression // example: author = miller and title = test
| comparison #atomExpression
;
comparison:
Expand Down

0 comments on commit a6de0d0

Please sign in to comment.