diff options
author | Benjamin Peterson <benjamin@python.org> | 2014-04-10 04:12:47 (GMT) |
---|---|---|
committer | Benjamin Peterson <benjamin@python.org> | 2014-04-10 04:12:47 (GMT) |
commit | 4ab92c800a6f2b75743d4a0b4dfd9995723f3647 (patch) | |
tree | fbd1b149e63d8427f7237fb41dd76ec2a863ef11 /Lib/lib2to3/pgen2 | |
parent | 0134a35bac4310c07c571e8d7378199783fbb388 (diff) | |
download | cpython-4ab92c800a6f2b75743d4a0b4dfd9995723f3647.zip cpython-4ab92c800a6f2b75743d4a0b4dfd9995723f3647.tar.gz cpython-4ab92c800a6f2b75743d4a0b4dfd9995723f3647.tar.bz2 |
add matrix multiplication operator support to 2to3
Diffstat (limited to 'Lib/lib2to3/pgen2')
-rw-r--r-- | Lib/lib2to3/pgen2/grammar.py | 1 | ||||
-rwxr-xr-x | Lib/lib2to3/pgen2/token.py | 13 | ||||
-rw-r--r-- | Lib/lib2to3/pgen2/tokenize.py | 2 |
3 files changed, 9 insertions, 7 deletions
diff --git a/Lib/lib2to3/pgen2/grammar.py b/Lib/lib2to3/pgen2/grammar.py index 7f1c564..b4481d1 100644 --- a/Lib/lib2to3/pgen2/grammar.py +++ b/Lib/lib2to3/pgen2/grammar.py @@ -149,6 +149,7 @@ opmap_raw = """ { LBRACE } RBRACE @ AT +@= ATEQUAL == EQEQUAL != NOTEQUAL <> NOTEQUAL diff --git a/Lib/lib2to3/pgen2/token.py b/Lib/lib2to3/pgen2/token.py index 6a6d0b6..7599396 100755 --- a/Lib/lib2to3/pgen2/token.py +++ b/Lib/lib2to3/pgen2/token.py @@ -57,12 +57,13 @@ DOUBLESTAREQUAL = 47 DOUBLESLASH = 48 DOUBLESLASHEQUAL = 49 AT = 50 -OP = 51 -COMMENT = 52 -NL = 53 -RARROW = 54 -ERRORTOKEN = 55 -N_TOKENS = 56 +ATEQUAL = 51 +OP = 52 +COMMENT = 53 +NL = 54 +RARROW = 55 +ERRORTOKEN = 56 +N_TOKENS = 57 NT_OFFSET = 256 #--end constants-- diff --git a/Lib/lib2to3/pgen2/tokenize.py b/Lib/lib2to3/pgen2/tokenize.py index 1bb931e..3dd1ee9 100644 --- a/Lib/lib2to3/pgen2/tokenize.py +++ b/Lib/lib2to3/pgen2/tokenize.py @@ -84,7 +84,7 @@ String = group(r"[uU]?[rR]?'[^\n'\\]*(?:\\.[^\n'\\]*)*'", # recognized as two instances of =). Operator = group(r"\*\*=?", r">>=?", r"<<=?", r"<>", r"!=", r"//=?", r"->", - r"[+\-*/%&|^=<>]=?", + r"[+\-*/%&@|^=<>]=?", r"~") Bracket = '[][(){}]' |