Change format of errror on oplist

This is to enable M_GLOBAL_OPLIST_OR_DEF to properly expand the erroneous oplist to the backend generator, that will report the error.
As such the erreneous oplist is surrounded by two pairs of brackets (())
This commit is contained in:
Patrick Pelissier committed 2020-05-30 17:54:22 +02:00
1 parent 70c3932f6e
commit 9c723da768
2 files changed
+7 -2

No files matched your search

+6 -1
View File
@@ -2514,13 +2514,18 @@ m_core_hash (const void *str, size_t length)
/* If a symbol composed of M_OPL_##a() exists and is defined as an oplist, /* If a symbol composed of M_OPL_##a() exists and is defined as an oplist,
it returns it otherwise it returns M_DEFAULT_OPLIST. it returns it otherwise it returns M_DEFAULT_OPLIST.
Global oplist is limited to typedef types. Global oplist is limited to typedef types.
NOTE1: It first tests if the type doesn't start with a parenthesis,
in which case concatenation cannot be used.
NOTE: It doesn't test if M_OPL_##a() is exactly an oplist (M_OPLIST_P)
but rather than if it starts with parenthesis: this is to allow
M_OPL_a() to expand into an invalid oplist ((M_LIB_ERRROR()))
*/ */
#define M_GLOBAL_OPLIST_OR_DEF(a) \ #define M_GLOBAL_OPLIST_OR_DEF(a) \
M_IF( M_PARENTHESIS_P(a))(M_GLOBALI_OPLIST_DEFAULT1, M_GLOBALI_OPLIST_OR_DEF_ELSE)(a) M_IF( M_PARENTHESIS_P(a))(M_GLOBALI_OPLIST_DEFAULT1, M_GLOBALI_OPLIST_OR_DEF_ELSE)(a)
#define M_GLOBALI_OPLIST_DEFAULT1(a) M_GLOBALI_OPLIST_DEFAULT2 #define M_GLOBALI_OPLIST_DEFAULT1(a) M_GLOBALI_OPLIST_DEFAULT2
#define M_GLOBALI_OPLIST_DEFAULT2() M_DEFAULT_OPLIST #define M_GLOBALI_OPLIST_DEFAULT2() M_DEFAULT_OPLIST
#define M_GLOBALI_OPLIST_OR_DEF_ELSE(a) M_GLOBALI_OPLIST_OR_DEF_ELSE2(a, M_C(M_OPL_, a)()) #define M_GLOBALI_OPLIST_OR_DEF_ELSE(a) M_GLOBALI_OPLIST_OR_DEF_ELSE2(a, M_C(M_OPL_, a)())
#define M_GLOBALI_OPLIST_OR_DEF_ELSE2(a, op) M_IF( M_OPLIST_P(op))(M_C(M_OPL_, a), M_GLOBALI_OPLIST_DEFAULT2) #define M_GLOBALI_OPLIST_OR_DEF_ELSE2(a, op) M_IF( M_PARENTHESIS_P(op))(M_C(M_OPL_, a), M_GLOBALI_OPLIST_DEFAULT2)
/* Register simple classic C types (no qualifier) */ /* Register simple classic C types (no qualifier) */
+1 -1
View File
@@ -578,7 +578,7 @@ namespace m_tuple {
/* Prepare a clean compilation failure */ /* Prepare a clean compilation failure */
#define TUPLEI_OPLIST_FAILURE(name, ...) \ #define TUPLEI_OPLIST_FAILURE(name, ...) \
M_LIB_ERROR(ONE_ARGUMENT_OF_TUPLE_OPLIST_IS_NOT_AN_OPLIST, name, __VA_ARGS__) ((M_LIB_ERROR(ONE_ARGUMENT_OF_TUPLE_OPLIST_IS_NOT_AN_OPLIST, name, __VA_ARGS__)))
#define TUPLEI_OPLIST_P3(name, ...) \ #define TUPLEI_OPLIST_P3(name, ...) \
(M_IF_METHOD_ALL(INIT, __VA_ARGS__)(INIT(M_C(name,_init)),), \ (M_IF_METHOD_ALL(INIT, __VA_ARGS__)(INIT(M_C(name,_init)),), \