Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit a76fb5b

Browse files
committed
Comparison operators '<=' '>' '<>' are now 1 token.
Also support '!=' and '==' as alternatives for '<>' and '='.
1 parent 2483cbb commit a76fb5b

1 file changed

Lines changed: 6 additions & 2 deletions

File tree

Grammar/Grammar

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,8 @@
1-
# Grammar for Python, version 5
1+
# Grammar for Python, version 6
2+
3+
# Changes since version 5:
4+
# Comparison operators '<=' '>' '<>' are now 1 token
5+
# Also support '!=' and '==' as alternatives for '<>' and '='
26

37
# Changes compared to version 4:
48
# Blank lines and lines only containing a comment are now eaten
@@ -68,7 +72,7 @@ test: and_test ('or' and_test)*
6872
and_test: not_test ('and' not_test)*
6973
not_test: 'not' not_test | comparison
7074
comparison: expr (comp_op expr)*
71-
comp_op: '<'|'>'|'='|'>' '='|'<' '='|'<' '>'|'in'|'not' 'in'|'is'|'is' 'not'
75+
comp_op: '<'|'>'|'='|'>='|'<='|'<>'|'!='|'=='|'in'|'not' 'in'|'is'|'is' 'not'
7276
expr: term (('+'|'-') term)*
7377
term: factor (('*'|'/'|'%') factor)*
7478
factor: ('+'|'-') factor | atom trailer*

0 commit comments

Comments
 (0)