mirror of
https://github.com/python/cpython.git
synced 2025-11-25 21:11:09 +00:00
Checkpoint. 218 tests are okay; 53 are failing. Done so far:
- all classes are new-style (but ripping out classobject.[ch] isn't done) - int/int -> float - all exceptions must derive from BaseException - absolute import - 'as' and 'with' are keywords
This commit is contained in:
parent
f3175f6341
commit
45aecf451a
24 changed files with 87 additions and 6365 deletions
|
|
@ -149,6 +149,7 @@ classify(parser_state *ps, int type, char *str)
|
|||
strcmp(l->lb_str, s) != 0)
|
||||
continue;
|
||||
#ifdef PY_PARSER_REQUIRES_FUTURE_KEYWORD
|
||||
/* Leaving this in as an example */
|
||||
if (!(ps->p_flags & CO_FUTURE_WITH_STATEMENT)) {
|
||||
if (s[0] == 'w' && strcmp(s, "with") == 0)
|
||||
break; /* not a keyword yet */
|
||||
|
|
@ -177,6 +178,7 @@ classify(parser_state *ps, int type, char *str)
|
|||
}
|
||||
|
||||
#ifdef PY_PARSER_REQUIRES_FUTURE_KEYWORD
|
||||
/* Leaving this in as an example */
|
||||
static void
|
||||
future_hack(parser_state *ps)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -192,7 +192,8 @@ parsetok(struct tok_state *tok, grammar *g, int start, perrdetail *err_ret,
|
|||
col_offset = -1;
|
||||
|
||||
if ((err_ret->error =
|
||||
PyParser_AddToken(ps, (int)type, str, tok->lineno, col_offset,
|
||||
PyParser_AddToken(ps, (int)type, str,
|
||||
tok->lineno, col_offset,
|
||||
&(err_ret->expected))) != E_OK) {
|
||||
if (err_ret->error != E_DONE)
|
||||
PyObject_FREE(str);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue