summaryrefslogtreecommitdiff
path: root/py/scope.h
diff options
context:
space:
mode:
authorDamien George <damien@micropython.org>2020-06-16 21:42:37 +1000
committerDamien George <damien@micropython.org>2020-06-16 21:42:37 +1000
commit0fd91e39b1711772c88cfe4e0aaf817fe3387ba6 (patch)
treea4ac9f1fa69ff7700eff32d30269b634a8d68f86 /py/scope.h
parentb4d0d7bf03a787237740b80d2ecdeb0a3ce1d4ff (diff)
py/compile: Convert scope test to SCOPE_IS_COMP_LIKE macro.
This macro can be used elsewhere.
Diffstat (limited to 'py/scope.h')
-rw-r--r--py/scope.h1
1 files changed, 1 insertions, 0 deletions
diff --git a/py/scope.h b/py/scope.h
index ba07c3949..b52d98ea1 100644
--- a/py/scope.h
+++ b/py/scope.h
@@ -55,6 +55,7 @@ typedef struct _id_info_t {
} id_info_t;
#define SCOPE_IS_FUNC_LIKE(s) ((s) >= SCOPE_LAMBDA)
+#define SCOPE_IS_COMP_LIKE(s) (SCOPE_LIST_COMP <= (s) && (s) <= SCOPE_GEN_EXPR)
// scope is a "block" in Python parlance
typedef enum {