VISIT_SEQ_TAIL permits the start of an ASDL sequence to be skipped, which is
useful if the first node in the sequence requires special treatment.
- VISIT_QUIT macro returns the specified value exiting from the function but
- first adjusts current recursion counter depth.
-*/
+ ENTER_RECURSIVE macro increments the current recursion depth counter.
+ It should be used at the beginning of the recursive function.
-#define VISIT_QUIT(ST, X) \
- return --(ST)->recursion_depth,(X)
+ LEAVE_RECURSIVE macro decrements the current recursion depth counter.
+ It should be used at the end of the recursive function.
+*/
#define VISIT(ST, TYPE, V) \
do { \
if (!symtable_visit_ ## TYPE((ST), (V))) { \
- VISIT_QUIT((ST), 0); \
+ return 0; \
} \
} while(0)
for (i = 0; i < asdl_seq_LEN(seq); i++) { \
TYPE ## _ty elt = (TYPE ## _ty)asdl_seq_GET(seq, i); \
if (!symtable_visit_ ## TYPE((ST), elt)) \
- VISIT_QUIT((ST), 0); \
+ return 0; \
} \
} while(0)
for (i = (START); i < asdl_seq_LEN(seq); i++) { \
TYPE ## _ty elt = (TYPE ## _ty)asdl_seq_GET(seq, i); \
if (!symtable_visit_ ## TYPE((ST), elt)) \
- VISIT_QUIT((ST), 0); \
+ return 0; \
} \
} while(0)
TYPE ## _ty elt = (TYPE ## _ty)asdl_seq_GET(seq, i); \
if (!elt) continue; /* can be NULL */ \
if (!symtable_visit_ ## TYPE((ST), elt)) \
- VISIT_QUIT((ST), 0); \
+ return 0; \
} \
} while(0)
+#define ENTER_RECURSIVE(ST) \
+ do { \
+ if (++(ST)->recursion_depth > (ST)->recursion_limit) { \
+ PyErr_SetString(PyExc_RecursionError, \
+ "maximum recursion depth exceeded during compilation"); \
+ return 0; \
+ } \
+ } while(0)
+
+#define LEAVE_RECURSIVE(ST) \
+ do { \
+ --(ST)->recursion_depth; \
+ } while(0)
+
+
static int
symtable_record_directive(struct symtable *st, identifier name, _Py_SourceLocation loc)
{
static int
symtable_visit_stmt(struct symtable *st, stmt_ty s)
{
- if (++st->recursion_depth > st->recursion_limit) {
- PyErr_SetString(PyExc_RecursionError,
- "maximum recursion depth exceeded during compilation");
- VISIT_QUIT(st, 0);
- }
+ ENTER_RECURSIVE(st);
switch (s->kind) {
case FunctionDef_kind: {
if (!symtable_add_def(st, s->v.FunctionDef.name, DEF_LOCAL, LOCATION(s)))
- VISIT_QUIT(st, 0);
+ return 0;
if (s->v.FunctionDef.args->defaults)
VISIT_SEQ(st, expr, s->v.FunctionDef.args->defaults);
if (s->v.FunctionDef.args->kw_defaults)
s->v.FunctionDef.args->kw_defaults),
s->kind,
LOCATION(s))) {
- VISIT_QUIT(st, 0);
+ return 0;
}
VISIT_SEQ(st, type_param, s->v.FunctionDef.type_params);
}
PySTEntryObject *new_ste = ste_new(st, s->v.FunctionDef.name, FunctionBlock, (void *)s,
LOCATION(s));
if (!new_ste) {
- VISIT_QUIT(st, 0);
+ return 0;
}
if (!symtable_visit_annotations(st, s, s->v.FunctionDef.args,
s->v.FunctionDef.returns, new_ste)) {
Py_DECREF(new_ste);
- VISIT_QUIT(st, 0);
+ return 0;
}
if (!symtable_enter_existing_block(st, new_ste)) {
Py_DECREF(new_ste);
- VISIT_QUIT(st, 0);
+ return 0;
}
Py_DECREF(new_ste);
VISIT(st, arguments, s->v.FunctionDef.args);
VISIT_SEQ(st, stmt, s->v.FunctionDef.body);
if (!symtable_exit_block(st))
- VISIT_QUIT(st, 0);
+ return 0;
if (asdl_seq_LEN(s->v.FunctionDef.type_params) > 0) {
if (!symtable_exit_block(st))
- VISIT_QUIT(st, 0);
+ return 0;
}
break;
}
case ClassDef_kind: {
PyObject *tmp;
if (!symtable_add_def(st, s->v.ClassDef.name, DEF_LOCAL, LOCATION(s)))
- VISIT_QUIT(st, 0);
+ return 0;
if (s->v.ClassDef.decorator_list)
VISIT_SEQ(st, expr, s->v.ClassDef.decorator_list);
tmp = st->st_private;
(void *)s->v.ClassDef.type_params,
false, false, s->kind,
LOCATION(s))) {
- VISIT_QUIT(st, 0);
+ return 0;
}
st->st_private = s->v.ClassDef.name;
st->st_cur->ste_mangled_names = PySet_New(NULL);
if (!st->st_cur->ste_mangled_names) {
- VISIT_QUIT(st, 0);
+ return 0;
}
VISIT_SEQ(st, type_param, s->v.ClassDef.type_params);
}
VISIT_SEQ(st, expr, s->v.ClassDef.bases);
if (!check_keywords(st, s->v.ClassDef.keywords)) {
- VISIT_QUIT(st, 0);
+ return 0;
}
VISIT_SEQ(st, keyword, s->v.ClassDef.keywords);
if (!symtable_enter_block(st, s->v.ClassDef.name, ClassBlock,
(void *)s, LOCATION(s))) {
- VISIT_QUIT(st, 0);
+ return 0;
}
st->st_private = s->v.ClassDef.name;
if (asdl_seq_LEN(s->v.ClassDef.type_params) > 0) {
if (!symtable_add_def(st, &_Py_ID(__type_params__),
DEF_LOCAL, LOCATION(s))) {
- VISIT_QUIT(st, 0);
+ return 0;
}
_Py_DECLARE_STR(type_params, ".type_params");
if (!symtable_add_def(st, &_Py_STR(type_params),
USE, LOCATION(s))) {
- VISIT_QUIT(st, 0);
+ return 0;
}
}
VISIT_SEQ(st, stmt, s->v.ClassDef.body);
if (!symtable_exit_block(st))
- VISIT_QUIT(st, 0);
+ return 0;
if (asdl_seq_LEN(s->v.ClassDef.type_params) > 0) {
if (!symtable_exit_block(st))
- VISIT_QUIT(st, 0);
+ return 0;
}
st->st_private = tmp;
break;
(void *)s->v.TypeAlias.type_params,
false, false, s->kind,
LOCATION(s))) {
- VISIT_QUIT(st, 0);
+ return 0;
}
VISIT_SEQ(st, type_param, s->v.TypeAlias.type_params);
}
if (!symtable_enter_block(st, name, TypeAliasBlock,
(void *)s, LOCATION(s))) {
- VISIT_QUIT(st, 0);
+ return 0;
}
st->st_cur->ste_can_see_class_scope = is_in_class;
if (is_in_class && !symtable_add_def(st, &_Py_ID(__classdict__), USE, LOCATION(s->v.TypeAlias.value))) {
- VISIT_QUIT(st, 0);
+ return 0;
}
VISIT(st, expr, s->v.TypeAlias.value);
if (!symtable_exit_block(st))
- VISIT_QUIT(st, 0);
+ return 0;
if (is_generic) {
if (!symtable_exit_block(st))
- VISIT_QUIT(st, 0);
+ return 0;
}
break;
}
expr_ty e_name = s->v.AnnAssign.target;
long cur = symtable_lookup(st, e_name->v.Name.id);
if (cur < 0) {
- VISIT_QUIT(st, 0);
+ return 0;
}
if ((cur & (DEF_GLOBAL | DEF_NONLOCAL))
&& (st->st_cur->ste_symbols != st->st_global)
cur & DEF_GLOBAL ? GLOBAL_ANNOT : NONLOCAL_ANNOT,
e_name->v.Name.id);
SET_ERROR_LOCATION(st->st_filename, LOCATION(s));
- VISIT_QUIT(st, 0);
+ return 0;
}
if (s->v.AnnAssign.simple &&
!symtable_add_def(st, e_name->v.Name.id,
DEF_ANNOT | DEF_LOCAL, LOCATION(e_name))) {
- VISIT_QUIT(st, 0);
+ return 0;
}
else {
if (s->v.AnnAssign.value
&& !symtable_add_def(st, e_name->v.Name.id, DEF_LOCAL, LOCATION(e_name))) {
- VISIT_QUIT(st, 0);
+ return 0;
}
}
}
}
if (!symtable_visit_annotation(st, s->v.AnnAssign.annotation,
(void *)((uintptr_t)st->st_cur->ste_id + 1))) {
- VISIT_QUIT(st, 0);
+ return 0;
}
if (s->v.AnnAssign.value) {
case ImportFrom_kind:
VISIT_SEQ(st, alias, s->v.ImportFrom.names);
if (!check_import_from(st, s)) {
- VISIT_QUIT(st, 0);
+ return 0;
}
break;
case Global_kind: {
identifier name = (identifier)asdl_seq_GET(seq, i);
long cur = symtable_lookup(st, name);
if (cur < 0)
- VISIT_QUIT(st, 0);
+ return 0;
if (cur & (DEF_PARAM | DEF_LOCAL | USE | DEF_ANNOT)) {
const char* msg;
if (cur & DEF_PARAM) {
PyErr_Format(PyExc_SyntaxError,
msg, name);
SET_ERROR_LOCATION(st->st_filename, LOCATION(s));
- VISIT_QUIT(st, 0);
+ return 0;
}
if (!symtable_add_def(st, name, DEF_GLOBAL, LOCATION(s))) {
- VISIT_QUIT(st, 0);
+ return 0;
}
if (!symtable_record_directive(st, name, LOCATION(s))) {
- VISIT_QUIT(st, 0);
+ return 0;
}
}
break;
identifier name = (identifier)asdl_seq_GET(seq, i);
long cur = symtable_lookup(st, name);
if (cur < 0)
- VISIT_QUIT(st, 0);
+ return 0;
if (cur & (DEF_PARAM | DEF_LOCAL | USE | DEF_ANNOT)) {
const char* msg;
if (cur & DEF_PARAM) {
}
PyErr_Format(PyExc_SyntaxError, msg, name);
SET_ERROR_LOCATION(st->st_filename, LOCATION(s));
- VISIT_QUIT(st, 0);
+ return 0;
}
if (!symtable_add_def(st, name, DEF_NONLOCAL, LOCATION(s)))
- VISIT_QUIT(st, 0);
+ return 0;
if (!symtable_record_directive(st, name, LOCATION(s))) {
- VISIT_QUIT(st, 0);
+ return 0;
}
}
break;
break;
case AsyncFunctionDef_kind: {
if (!symtable_add_def(st, s->v.AsyncFunctionDef.name, DEF_LOCAL, LOCATION(s)))
- VISIT_QUIT(st, 0);
+ return 0;
if (s->v.AsyncFunctionDef.args->defaults)
VISIT_SEQ(st, expr, s->v.AsyncFunctionDef.args->defaults);
if (s->v.AsyncFunctionDef.args->kw_defaults)
s->v.AsyncFunctionDef.args->kw_defaults),
s->kind,
LOCATION(s))) {
- VISIT_QUIT(st, 0);
+ return 0;
}
VISIT_SEQ(st, type_param, s->v.AsyncFunctionDef.type_params);
}
PySTEntryObject *new_ste = ste_new(st, s->v.FunctionDef.name, FunctionBlock, (void *)s,
LOCATION(s));
if (!new_ste) {
- VISIT_QUIT(st, 0);
+ return 0;
}
if (!symtable_visit_annotations(st, s, s->v.AsyncFunctionDef.args,
s->v.AsyncFunctionDef.returns, new_ste)) {
Py_DECREF(new_ste);
- VISIT_QUIT(st, 0);
+ return 0;
}
if (!symtable_enter_existing_block(st, new_ste)) {
Py_DECREF(new_ste);
- VISIT_QUIT(st, 0);
+ return 0;
}
Py_DECREF(new_ste);
VISIT(st, arguments, s->v.AsyncFunctionDef.args);
VISIT_SEQ(st, stmt, s->v.AsyncFunctionDef.body);
if (!symtable_exit_block(st))
- VISIT_QUIT(st, 0);
+ return 0;
if (asdl_seq_LEN(s->v.AsyncFunctionDef.type_params) > 0) {
if (!symtable_exit_block(st))
- VISIT_QUIT(st, 0);
+ return 0;
}
break;
}
case AsyncWith_kind:
maybe_set_ste_coroutine_for_module(st, s);
if (!symtable_raise_if_not_coroutine(st, ASYNC_WITH_OUTSIDE_ASYNC_FUNC, LOCATION(s))) {
- VISIT_QUIT(st, 0);
+ return 0;
}
VISIT_SEQ(st, withitem, s->v.AsyncWith.items);
VISIT_SEQ(st, stmt, s->v.AsyncWith.body);
case AsyncFor_kind:
maybe_set_ste_coroutine_for_module(st, s);
if (!symtable_raise_if_not_coroutine(st, ASYNC_FOR_OUTSIDE_ASYNC_FUNC, LOCATION(s))) {
- VISIT_QUIT(st, 0);
+ return 0;
}
VISIT(st, expr, s->v.AsyncFor.target);
VISIT(st, expr, s->v.AsyncFor.iter);
VISIT_SEQ(st, stmt, s->v.AsyncFor.orelse);
break;
}
- VISIT_QUIT(st, 1);
+ LEAVE_RECURSIVE(st);
+ return 1;
}
static int
(target_in_scope & DEF_LOCAL)) {
PyErr_Format(PyExc_SyntaxError, NAMED_EXPR_COMP_CONFLICT, target_name);
SET_ERROR_LOCATION(st->st_filename, LOCATION(e));
- VISIT_QUIT(st, 0);
+ return 0;
}
continue;
}
long target_in_scope = symtable_lookup_entry(st, ste, target_name);
if (target_in_scope & DEF_GLOBAL) {
if (!symtable_add_def(st, target_name, DEF_GLOBAL, LOCATION(e)))
- VISIT_QUIT(st, 0);
+ return 0;
} else {
if (!symtable_add_def(st, target_name, DEF_NONLOCAL, LOCATION(e))) {
- VISIT_QUIT(st, 0);
+ return 0;
}
}
if (!symtable_record_directive(st, target_name, LOCATION(e))) {
- VISIT_QUIT(st, 0);
+ return 0;
}
return symtable_add_def_helper(st, target_name, DEF_LOCAL, ste, LOCATION(e));
/* If we find a ModuleBlock entry, add as GLOBAL */
if (ste->ste_type == ModuleBlock) {
if (!symtable_add_def(st, target_name, DEF_GLOBAL, LOCATION(e))) {
- VISIT_QUIT(st, 0);
+ return 0;
}
if (!symtable_record_directive(st, target_name, LOCATION(e))) {
- VISIT_QUIT(st, 0);
+ return 0;
}
return symtable_add_def_helper(st, target_name, DEF_GLOBAL, ste, LOCATION(e));
Py_UNREACHABLE();
}
SET_ERROR_LOCATION(st->st_filename, LOCATION(e));
- VISIT_QUIT(st, 0);
+ return 0;
}
}
static int
symtable_visit_expr(struct symtable *st, expr_ty e)
{
- if (++st->recursion_depth > st->recursion_limit) {
- PyErr_SetString(PyExc_RecursionError,
- "maximum recursion depth exceeded during compilation");
- VISIT_QUIT(st, 0);
- }
+ ENTER_RECURSIVE(st);
switch (e->kind) {
case NamedExpr_kind:
if (!symtable_raise_if_annotation_block(st, "named expression", e)) {
- VISIT_QUIT(st, 0);
+ return 0;
}
if(!symtable_handle_namedexpr(st, e))
- VISIT_QUIT(st, 0);
+ return 0;
break;
case BoolOp_kind:
VISIT_SEQ(st, expr, e->v.BoolOp.values);
VISIT_SEQ_WITH_NULL(st, expr, e->v.Lambda.args->kw_defaults);
if (!symtable_enter_block(st, &_Py_ID(lambda),
FunctionBlock, (void *)e, LOCATION(e))) {
- VISIT_QUIT(st, 0);
+ return 0;
}
VISIT(st, arguments, e->v.Lambda.args);
VISIT(st, expr, e->v.Lambda.body);
if (!symtable_exit_block(st))
- VISIT_QUIT(st, 0);
+ return 0;
break;
}
case IfExp_kind:
break;
case GeneratorExp_kind:
if (!symtable_visit_genexp(st, e))
- VISIT_QUIT(st, 0);
+ return 0;
break;
case ListComp_kind:
if (!symtable_visit_listcomp(st, e))
- VISIT_QUIT(st, 0);
+ return 0;
break;
case SetComp_kind:
if (!symtable_visit_setcomp(st, e))
- VISIT_QUIT(st, 0);
+ return 0;
break;
case DictComp_kind:
if (!symtable_visit_dictcomp(st, e))
- VISIT_QUIT(st, 0);
+ return 0;
break;
case Yield_kind:
if (!symtable_raise_if_annotation_block(st, "yield expression", e)) {
- VISIT_QUIT(st, 0);
+ return 0;
}
if (e->v.Yield.value)
VISIT(st, expr, e->v.Yield.value);
break;
case YieldFrom_kind:
if (!symtable_raise_if_annotation_block(st, "yield expression", e)) {
- VISIT_QUIT(st, 0);
+ return 0;
}
VISIT(st, expr, e->v.YieldFrom.value);
st->st_cur->ste_generator = 1;
break;
case Await_kind:
if (!symtable_raise_if_annotation_block(st, "await expression", e)) {
- VISIT_QUIT(st, 0);
+ return 0;
}
if (!allows_top_level_await(st)) {
if (!_PyST_IsFunctionLike(st->st_cur)) {
PyErr_SetString(PyExc_SyntaxError,
"'await' outside function");
SET_ERROR_LOCATION(st->st_filename, LOCATION(e));
- VISIT_QUIT(st, 0);
+ return 0;
}
if (!IS_ASYNC_DEF(st) && st->st_cur->ste_comprehension == NoComprehension) {
PyErr_SetString(PyExc_SyntaxError,
"'await' outside async function");
SET_ERROR_LOCATION(st->st_filename, LOCATION(e));
- VISIT_QUIT(st, 0);
+ return 0;
}
}
VISIT(st, expr, e->v.Await.value);
VISIT(st, expr, e->v.Call.func);
VISIT_SEQ(st, expr, e->v.Call.args);
if (!check_keywords(st, e->v.Call.keywords)) {
- VISIT_QUIT(st, 0);
+ return 0;
}
VISIT_SEQ_WITH_NULL(st, keyword, e->v.Call.keywords);
break;
/* The following exprs can be assignment targets. */
case Attribute_kind:
if (!check_name(st, e->v.Attribute.attr, LOCATION(e), e->v.Attribute.ctx)) {
- VISIT_QUIT(st, 0);
+ return 0;
}
VISIT(st, expr, e->v.Attribute.value);
break;
if (!symtable_add_def_ctx(st, e->v.Name.id,
e->v.Name.ctx == Load ? USE : DEF_LOCAL,
LOCATION(e), e->v.Name.ctx)) {
- VISIT_QUIT(st, 0);
+ return 0;
}
/* Special-case super: it counts as a use of __class__ */
if (e->v.Name.ctx == Load &&
_PyST_IsFunctionLike(st->st_cur) &&
_PyUnicode_EqualToASCIIString(e->v.Name.id, "super")) {
if (!symtable_add_def(st, &_Py_ID(__class__), USE, LOCATION(e)))
- VISIT_QUIT(st, 0);
+ return 0;
}
break;
/* child nodes of List and Tuple will have expr_context set */
VISIT_SEQ(st, expr, e->v.Tuple.elts);
break;
}
- VISIT_QUIT(st, 1);
+ LEAVE_RECURSIVE(st);
+ return 1;
}
static int
st->st_cur->ste_can_see_class_scope = is_in_class;
if (is_in_class && !symtable_add_def(st, &_Py_ID(__classdict__), USE, LOCATION(e))) {
- VISIT_QUIT(st, 0);
+ return 0;
}
assert(ste_scope_info != NULL);
static int
symtable_visit_type_param(struct symtable *st, type_param_ty tp)
{
- if (++st->recursion_depth > st->recursion_limit) {
- PyErr_SetString(PyExc_RecursionError,
- "maximum recursion depth exceeded during compilation");
- VISIT_QUIT(st, 0);
- }
+ ENTER_RECURSIVE(st);
switch(tp->kind) {
case TypeVar_kind:
if (!symtable_add_def(st, tp->v.TypeVar.name, DEF_TYPE_PARAM | DEF_LOCAL, LOCATION(tp)))
- VISIT_QUIT(st, 0);
+ return 0;
const char *ste_scope_info = NULL;
const expr_ty bound = tp->v.TypeVar.bound;
// compile.c where the scope is retrieved.
if (!symtable_visit_type_param_bound_or_default(st, tp->v.TypeVar.bound, tp->v.TypeVar.name,
(void *)tp, ste_scope_info)) {
- VISIT_QUIT(st, 0);
+ return 0;
}
if (!symtable_visit_type_param_bound_or_default(st, tp->v.TypeVar.default_value, tp->v.TypeVar.name,
(void *)((uintptr_t)tp + 1), "a TypeVar default")) {
- VISIT_QUIT(st, 0);
+ return 0;
}
break;
case TypeVarTuple_kind:
if (!symtable_add_def(st, tp->v.TypeVarTuple.name, DEF_TYPE_PARAM | DEF_LOCAL, LOCATION(tp))) {
- VISIT_QUIT(st, 0);
+ return 0;
}
if (!symtable_visit_type_param_bound_or_default(st, tp->v.TypeVarTuple.default_value, tp->v.TypeVarTuple.name,
(void *)tp, "a TypeVarTuple default")) {
- VISIT_QUIT(st, 0);
+ return 0;
}
break;
case ParamSpec_kind:
if (!symtable_add_def(st, tp->v.ParamSpec.name, DEF_TYPE_PARAM | DEF_LOCAL, LOCATION(tp))) {
- VISIT_QUIT(st, 0);
+ return 0;
}
if (!symtable_visit_type_param_bound_or_default(st, tp->v.ParamSpec.default_value, tp->v.ParamSpec.name,
(void *)tp, "a ParamSpec default")) {
- VISIT_QUIT(st, 0);
+ return 0;
}
break;
}
- VISIT_QUIT(st, 1);
+ LEAVE_RECURSIVE(st);
+ return 1;
}
static int
symtable_visit_pattern(struct symtable *st, pattern_ty p)
{
- if (++st->recursion_depth > st->recursion_limit) {
- PyErr_SetString(PyExc_RecursionError,
- "maximum recursion depth exceeded during compilation");
- VISIT_QUIT(st, 0);
- }
+ ENTER_RECURSIVE(st);
switch (p->kind) {
case MatchValue_kind:
VISIT(st, expr, p->v.MatchValue.value);
case MatchStar_kind:
if (p->v.MatchStar.name) {
if (!symtable_add_def(st, p->v.MatchStar.name, DEF_LOCAL, LOCATION(p))) {
- VISIT_QUIT(st, 0);
+ return 0;
}
}
break;
VISIT_SEQ(st, pattern, p->v.MatchMapping.patterns);
if (p->v.MatchMapping.rest) {
if (!symtable_add_def(st, p->v.MatchMapping.rest, DEF_LOCAL, LOCATION(p))) {
- VISIT_QUIT(st, 0);
+ return 0;
}
}
break;
VISIT(st, expr, p->v.MatchClass.cls);
VISIT_SEQ(st, pattern, p->v.MatchClass.patterns);
if (!check_kwd_patterns(st, p)) {
- VISIT_QUIT(st, 0);
+ return 0;
}
VISIT_SEQ(st, pattern, p->v.MatchClass.kwd_patterns);
break;
}
if (p->v.MatchAs.name) {
if (!symtable_add_def(st, p->v.MatchAs.name, DEF_LOCAL, LOCATION(p))) {
- VISIT_QUIT(st, 0);
+ return 0;
}
}
break;
VISIT_SEQ(st, pattern, p->v.MatchOr.patterns);
break;
}
- VISIT_QUIT(st, 1);
+ LEAVE_RECURSIVE(st);
+ return 1;
}
static int
_Py_block_ty current_type = parent_ste->ste_type;
if (!symtable_enter_block(st, &_Py_ID(__annotate__), AnnotationBlock,
key, LOCATION(annotation))) {
- VISIT_QUIT(st, 0);
+ return 0;
}
parent_ste->ste_annotation_block =
(struct _symtable_entry *)Py_NewRef(st->st_cur);
}
else {
if (!symtable_enter_existing_block(st, parent_ste->ste_annotation_block)) {
- VISIT_QUIT(st, 0);
+ return 0;
}
}
VISIT(st, expr, annotation);
if (!symtable_exit_block(st)) {
- VISIT_QUIT(st, 0);
+ return 0;
}
return 1;
}
_Py_block_ty current_type = st->st_cur->ste_type;
if (!symtable_enter_block(st, &_Py_ID(__annotate__), AnnotationBlock,
(void *)a, LOCATION(o))) {
- VISIT_QUIT(st, 0);
+ return 0;
}
if (is_in_class || current_type == ClassBlock) {
st->st_cur->ste_can_see_class_scope = 1;
VISIT(st, expr, returns);
}
if (!symtable_exit_block(st)) {
- VISIT_QUIT(st, 0);
+ return 0;
}
return 1;
}
(type == DictComprehension) ? "'yield' inside dict comprehension" :
"'yield' inside generator expression");
SET_ERROR_LOCATION(st->st_filename, LOCATION(e));
- VISIT_QUIT(st, 0);
+ return 0;
}
static int