Mercurial > cpython-lru_cache-weakref
comparison Python/ast.c @ 39676:eb2f70fdbf32
Remove support for backticks from the grammar and compiler.
Still need to remove traces of the UNARY_CONVERT opcode.
| author | Brett Cannon <bcannon@gmail.com> |
|---|---|
| date | Fri, 25 Aug 2006 04:28:18 +0000 |
| parents | efe3f2c0da5e |
| children | f87a3e61853d |
comparison
equal
deleted
inserted
replaced
| 39675:4e5c94d03649 | 39676:eb2f70fdbf32 |
|---|---|
| 1188 | 1188 |
| 1189 static expr_ty | 1189 static expr_ty |
| 1190 ast_for_atom(struct compiling *c, const node *n) | 1190 ast_for_atom(struct compiling *c, const node *n) |
| 1191 { | 1191 { |
| 1192 /* atom: '(' [yield_expr|testlist_gexp] ')' | '[' [listmaker] ']' | 1192 /* atom: '(' [yield_expr|testlist_gexp] ')' | '[' [listmaker] ']' |
| 1193 | '{' [dictmaker] '}' | '`' testlist '`' | NAME | NUMBER | STRING+ | 1193 | '{' [dictmaker] '}' | NAME | NUMBER | STRING+ |
| 1194 */ | 1194 */ |
| 1195 node *ch = CHILD(n, 0); | 1195 node *ch = CHILD(n, 0); |
| 1196 | 1196 |
| 1197 switch (TYPE(ch)) { | 1197 switch (TYPE(ch)) { |
| 1198 case NAME: | 1198 case NAME: |
| 1273 return NULL; | 1273 return NULL; |
| 1274 | 1274 |
| 1275 asdl_seq_SET(values, i / 4, expression); | 1275 asdl_seq_SET(values, i / 4, expression); |
| 1276 } | 1276 } |
| 1277 return Dict(keys, values, LINENO(n), n->n_col_offset, c->c_arena); | 1277 return Dict(keys, values, LINENO(n), n->n_col_offset, c->c_arena); |
| 1278 } | |
| 1279 case BACKQUOTE: { /* repr */ | |
| 1280 expr_ty expression = ast_for_testlist(c, CHILD(n, 1)); | |
| 1281 if (!expression) | |
| 1282 return NULL; | |
| 1283 | |
| 1284 return Repr(expression, LINENO(n), n->n_col_offset, c->c_arena); | |
| 1285 } | 1278 } |
| 1286 default: | 1279 default: |
| 1287 PyErr_Format(PyExc_SystemError, "unhandled atom %d", TYPE(ch)); | 1280 PyErr_Format(PyExc_SystemError, "unhandled atom %d", TYPE(ch)); |
| 1288 return NULL; | 1281 return NULL; |
| 1289 } | 1282 } |
