Skip to content

Commit

Permalink
adds support for XOR operator
Browse files Browse the repository at this point in the history
  • Loading branch information
larsborn committed Dec 21, 2016
1 parent c5ea604 commit d059317
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
3 changes: 3 additions & 0 deletions plyara/interp.py
Original file line number Diff line number Diff line change
Expand Up @@ -183,6 +183,7 @@ def parseString(inputString, isPrintDebug=False):
'LESSTHAN',
'GREATEREQUAL',
'LESSEQUAL',
'XOR',
'PERIOD',
'COLON',
'STAR',
Expand Down Expand Up @@ -254,6 +255,7 @@ def parseString(inputString, isPrintDebug=False):
t_LESSTHAN = r'<'
t_GREATEREQUAL = r'>='
t_LESSEQUAL = r'<='
t_XOR = r'\^'
t_PERIOD = r'\.'
t_COLON = r':'
t_STAR = r'\*'
Expand Down Expand Up @@ -528,6 +530,7 @@ def p_condition(p):
| LESSTHAN
| GREATEREQUAL
| LESSEQUAL
| XOR
| PERIOD
| COLON
| STAR
Expand Down
7 changes: 6 additions & 1 deletion tests/test_file.txt
Original file line number Diff line number Diff line change
Expand Up @@ -23,4 +23,9 @@ rule SecondRule : aTag {
for all of them : ( # > 2 )
}

rule ThirdRule {condition: false}
rule ThirdRule {condition: false}

rule ForthRule {
condition:
uint8(0) ^ unit8(1) == 0x12
}

0 comments on commit d059317

Please sign in to comment.