summaryrefslogtreecommitdiffstats
path: root/Grammar
diff options
context:
space:
mode:
authorGuido van Rossum <guido@python.org>1991-10-20 20:10:09 (GMT)
committerGuido van Rossum <guido@python.org>1991-10-20 20:10:09 (GMT)
commita76fb5b653a195e7082b6b507a0cea1b3abcf86e (patch)
tree2122fa570b86f97a228e823dacba384e800dd9bb /Grammar
parent2483cbb8ce432c2723d5a1010b5d96fd7b670d9a (diff)
downloadcpython-a76fb5b653a195e7082b6b507a0cea1b3abcf86e.zip
cpython-a76fb5b653a195e7082b6b507a0cea1b3abcf86e.tar.gz
cpython-a76fb5b653a195e7082b6b507a0cea1b3abcf86e.tar.bz2
Comparison operators '<=' '>' '<>' are now 1 token.
Also support '!=' and '==' as alternatives for '<>' and '='.
Diffstat (limited to 'Grammar')
-rw-r--r--Grammar/Grammar8
1 files changed, 6 insertions, 2 deletions
diff --git a/Grammar/Grammar b/Grammar/Grammar
index c3ab3c3..90a43f5 100644
--- a/Grammar/Grammar
+++ b/Grammar/Grammar
@@ -1,4 +1,8 @@
-# Grammar for Python, version 5
+# Grammar for Python, version 6
+
+# Changes since version 5:
+# Comparison operators '<=' '>' '<>' are now 1 token
+# Also support '!=' and '==' as alternatives for '<>' and '='
# Changes compared to version 4:
# Blank lines and lines only containing a comment are now eaten
@@ -68,7 +72,7 @@ test: and_test ('or' and_test)*
and_test: not_test ('and' not_test)*
not_test: 'not' not_test | comparison
comparison: expr (comp_op expr)*
-comp_op: '<'|'>'|'='|'>' '='|'<' '='|'<' '>'|'in'|'not' 'in'|'is'|'is' 'not'
+comp_op: '<'|'>'|'='|'>='|'<='|'<>'|'!='|'=='|'in'|'not' 'in'|'is'|'is' 'not'
expr: term (('+'|'-') term)*
term: factor (('*'|'/'|'%') factor)*
factor: ('+'|'-') factor | atom trailer*