keep the slice.step field as NULL if no step expression is given

This commit is contained in:
Benjamin Peterson 2009-06-13 01:40:00 +00:00
parent cb73bdac95
commit 4afbba3d34
3 changed files with 10 additions and 8 deletions

View file

@ -1468,14 +1468,7 @@ ast_for_slice(struct compiling *c, const node *n)
ch = CHILD(n, NCH(n) - 1);
if (TYPE(ch) == sliceop) {
if (NCH(ch) == 1) {
/* No expression, so step is None */
ch = CHILD(ch, 0);
step = Name(new_identifier("None", c->c_arena), Load,
LINENO(ch), ch->n_col_offset, c->c_arena);
if (!step)
return NULL;
} else {
if (NCH(ch) != 1) {
ch = CHILD(ch, 1);
if (TYPE(ch) == test) {
step = ast_for_expr(c, ch);