summaryrefslogtreecommitdiffstatshomepage
path: root/py
diff options
context:
space:
mode:
authorDamien George <damien.p.george@gmail.com>2014-01-23 00:00:53 +0000
committerDamien George <damien.p.george@gmail.com>2014-01-23 00:00:53 +0000
commit00208ce194d4afcde154cf3ed2d9811e2c9d3ebc (patch)
tree1b83fb5f62281be6fe4a6c9883b998a6ce232cfa /py
parent0d028743aa12ef935b27fdbaf0a5ad3ca62d7628 (diff)
downloadmicropython-00208ce194d4afcde154cf3ed2d9811e2c9d3ebc.tar.gz
micropython-00208ce194d4afcde154cf3ed2d9811e2c9d3ebc.zip
py: Change macro var args in parser to be C99 compliant.
Diffstat (limited to 'py')
-rw-r--r--py/compile.c2
-rw-r--r--py/parse.c8
2 files changed, 5 insertions, 5 deletions
diff --git a/py/compile.c b/py/compile.c
index 2aa98506d1..4bbdf9a95a 100644
--- a/py/compile.c
+++ b/py/compile.c
@@ -23,7 +23,7 @@
typedef enum {
PN_none = 0,
-#define DEF_RULE(rule, comp, kind, arg...) PN_##rule,
+#define DEF_RULE(rule, comp, kind, ...) PN_##rule,
#include "grammar.h"
#undef DEF_RULE
PN_maximum_number_of,
diff --git a/py/parse.c b/py/parse.c
index 4288c74ccf..3cf909d752 100644
--- a/py/parse.c
+++ b/py/parse.c
@@ -40,7 +40,7 @@ typedef struct _rule_t {
enum {
RULE_none = 0,
-#define DEF_RULE(rule, comp, kind, arg...) RULE_##rule,
+#define DEF_RULE(rule, comp, kind, ...) RULE_##rule,
#include "grammar.h"
#undef DEF_RULE
RULE_maximum_number_of,
@@ -56,9 +56,9 @@ enum {
#define opt_tok(t) (RULE_ARG_OPT_TOK | MP_TOKEN_##t)
#define opt_rule(r) (RULE_ARG_OPT_RULE | RULE_##r)
#ifdef USE_RULE_NAME
-#define DEF_RULE(rule, comp, kind, arg...) static const rule_t rule_##rule = { RULE_##rule, kind, #rule, { arg } };
+#define DEF_RULE(rule, comp, kind, ...) static const rule_t rule_##rule = { RULE_##rule, kind, #rule, { __VA_ARGS__ } };
#else
-#define DEF_RULE(rule, comp, kind, arg...) static const rule_t rule_##rule = { RULE_##rule, kind, { arg } };
+#define DEF_RULE(rule, comp, kind, ...) static const rule_t rule_##rule = { RULE_##rule, kind, { __VA_ARGS__ } };
#endif
#include "grammar.h"
#undef or
@@ -74,7 +74,7 @@ enum {
static const rule_t *rules[] = {
NULL,
-#define DEF_RULE(rule, comp, kind, arg...) &rule_##rule,
+#define DEF_RULE(rule, comp, kind, ...) &rule_##rule,
#include "grammar.h"
#undef DEF_RULE
};