Skip to content

Commit

Permalink
Include logic operators in expression parser
Browse files Browse the repository at this point in the history
  • Loading branch information
luis11011 committed Apr 7, 2022
1 parent 4d65d66 commit 3cbd2c9
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions optimus/expressions.py
Original file line number Diff line number Diff line change
Expand Up @@ -661,6 +661,16 @@
l_g.add('MUL_OPERATOR', r'\*')
l_g.add('DIV_OPERATOR', r'\/')

# Logic Operators
l_g.add('GTE_OPERATOR', r'\>\=')
l_g.add('LTE_OPERATOR', r'\<\=')
l_g.add('GT_OPERATOR', r'\>')
l_g.add('LT_OPERATOR', r'\<')
l_g.add('EQ_OPERATOR', r'\=\=')
l_g.add('NEQ_OPERATOR', r'\!\=')
l_g.add('AND_OPERATOR', r'\&')
l_g.add('OR_OPERATOR', r'\|')

# Number
l_g.add('FLOAT', r'[-+]?[0-9]*\.?[0-9]+')
l_g.add('INTEGER', r'\d+')
Expand Down

0 comments on commit 3cbd2c9

Please sign in to comment.