summaryrefslogtreecommitdiff
path: root/Grammar
diff options
context:
space:
mode:
authorAlexandre Vassalotti <alexandre@peadrop.com>2010-01-09 23:35:54 +0000
committerAlexandre Vassalotti <alexandre@peadrop.com>2010-01-09 23:35:54 +0000
commitee936a21308679654b2d458166ff094ed735fef7 (patch)
tree612cd109e8ede4080f58f30ece3212d8e0f996d2 /Grammar
parente36561352895170f28f77f0b4ec4292e35d1cc01 (diff)
downloadcpython-git-ee936a21308679654b2d458166ff094ed735fef7.tar.gz
Issue #2335: Backport set literals syntax from Python 3.x.
Diffstat (limited to 'Grammar')
-rw-r--r--Grammar/Grammar4
1 files changed, 3 insertions, 1 deletions
diff --git a/Grammar/Grammar b/Grammar/Grammar
index a463671326..556e5e43da 100644
--- a/Grammar/Grammar
+++ b/Grammar/Grammar
@@ -102,7 +102,7 @@ factor: ('+'|'-'|'~') factor | power
power: atom trailer* ['**' factor]
atom: ('(' [yield_expr|testlist_gexp] ')' |
'[' [listmaker] ']' |
- '{' [dictmaker] '}' |
+ '{' [dictorsetmaker] '}' |
'`' testlist1 '`' |
NAME | NUMBER | STRING+)
listmaker: test ( list_for | (',' test)* [','] )
@@ -115,6 +115,8 @@ sliceop: ':' [test]
exprlist: expr (',' expr)* [',']
testlist: test (',' test)* [',']
dictmaker: test ':' test (',' test ':' test)* [',']
+dictorsetmaker: ( (test ':' test (',' test ':' test)* [',']) |
+ (test (',' test)* [',']) )
classdef: 'class' NAME ['(' [testlist] ')'] ':' suite