Refactor future feature handling

Replace uses of PyCF_xxx with CO_xxx.

Replace individual feature slots in PyFutureFeatures with single
bitmask ff_features.

When flags must be transfered among the three parts of the interpreter
that care about them -- the pythonrun layer, the compiler, and the
future feature parser -- can simply or (|) the definitions.
This commit is contained in:
Jeremy Hylton 2001-08-10 21:41:33 +00:00
parent fdd12f66bb
commit b857ba261f
4 changed files with 17 additions and 52 deletions

View file

@ -2937,11 +2937,11 @@ PyEval_MergeCompilerFlags(PyCompilerFlags *cf)
const int codeflags = current_frame->f_code->co_flags;
if (codeflags & CO_NESTED) {
result = 1;
cf->cf_flags |= PyCF_NESTED_SCOPES;
cf->cf_flags |= CO_NESTED;
}
if (codeflags & CO_GENERATOR_ALLOWED) {
result = 1;
cf->cf_flags |= PyCF_GENERATORS;
cf->cf_flags |= CO_GENERATOR_ALLOWED;
}
}
return result;