]> granicus.if.org Git - python/commitdiff
Changes for stride in slices (x[a:b:c]) and ellipses (x[a,...,z])
authorGuido van Rossum <guido@python.org>
Tue, 30 Jul 1996 16:43:44 +0000 (16:43 +0000)
committerGuido van Rossum <guido@python.org>
Tue, 30 Jul 1996 16:43:44 +0000 (16:43 +0000)
Grammar/Grammar

index 3d957a79940400454b26bc14d98d0f356bd897be..faca8581a99e9c9672d0a835cc74e8cc5679b0ad 100644 (file)
@@ -74,8 +74,10 @@ factor: ('+'|'-'|'~') factor | power
 power: atom trailer* ('**' factor)*
 atom: '(' [testlist] ')' | '[' [testlist] ']' | '{' [dictmaker] '}' | '`' testlist '`' | NAME | NUMBER | STRING+
 lambdef: 'lambda' [varargslist] ':' test
-trailer: '(' [arglist] ')' | '[' subscript ']' | '.' NAME
-subscript: test (',' test)* [','] | [test] ':' [test]
+trailer: '(' [arglist] ')' | '[' subscriptlist ']' | '.' NAME
+subscriptlist: subscript (',' subscript)* [',']
+subscript: '.' '.' '.' | test | [test] ':' [test] [sliceop]
+sliceop: ':' [test]
 exprlist: expr (',' expr)* [',']
 testlist: test (',' test)* [',']
 dictmaker: test ':' test (',' test ':' test)* [',']