Add support for '_' meta keyword

This commit is contained in:
Patrick Pelissier committed 2022-04-18 09:24:32 +02:00
1 parent ffa3821acf
commit a2e471620d
2 files changed
+6 -1

No files matched your search

+2 -1
View File
@@ -1156,7 +1156,7 @@ M_BEGIN_PROTECTED_CODE
#define M_PATTERN_queue_queue ,
#define M_PATTERN_QUEUE_QUEUE ,
#define M_PATTERN_INIT_WITH_INIT_WITH ,
#define M_PATTERN____ ,
/* Extract the VA ARGS of a keyword function like.
Transform 'LIST( a, b, c)' into 'a, b, c' for keyword=LIST
@@ -1167,6 +1167,7 @@ M_BEGIN_PROTECTED_CODE
#define M_EAT_KEYWORD_LIST_LIST(...) __VA_ARGS__
#define M_EAT_KEYWORD_SEQ_SEQ(...) __VA_ARGS__
#define M_EAT_KEYWORD_QUEUE_QUEUE(...) __VA_ARGS__
#define M_EAT_KEYWORD____(...) __VA_ARGS__
/* Necessary macros to handle recursivity,
+4
View File
@@ -406,6 +406,9 @@ static void test_test(void)
assert(M_KEYWORD_P(sum, add));
assert(M_KEYWORD_P(product, product));
assert(M_KEYWORD_P(product, mul));
assert(!M_KEYWORD_P(product, mul2));
assert(M_KEYWORD_P(_, _));
assert(M_KEYWORD_P(_, _() ));
assert(M_KEYWORD_P(LIST, LIST));
assert(M_KEYWORD_P(LIST, LIST(1,23,4) ));
@@ -416,6 +419,7 @@ static void test_test(void)
assert(M_GET_AT( ( M_KEYWORD_TO_VA_ARGS(LIST, LIST(11, 22, 33)) ), 0) == 11);
assert(M_GET_AT( ( M_KEYWORD_TO_VA_ARGS(LIST, LIST(11, 22, 33)) ), 1) == 22);
assert(M_GET_AT( ( M_KEYWORD_TO_VA_ARGS(LIST, LIST(11, 22, 33)) ), 2) == 33);
assert(M_KEYWORD_TO_VA_ARGS(_, _(10)) == 10);
}
static void test_list(void)