diff options
author | Mattias Andrée <maandree@operamail.com> | 2014-11-17 09:07:43 +0100 |
---|---|---|
committer | Mattias Andrée <maandree@operamail.com> | 2014-11-17 09:07:43 +0100 |
commit | 329eb3d9f698a323ba52f94894ae2aec5a6bb10e (patch) | |
tree | 50e43a71648c4ba56d8df7c4bed74ed38a2e6d1d /src | |
parent | typo (diff) | |
download | mds-329eb3d9f698a323ba52f94894ae2aec5a6bb10e.tar.gz mds-329eb3d9f698a323ba52f94894ae2aec5a6bb10e.tar.bz2 mds-329eb3d9f698a323ba52f94894ae2aec5a6bb10e.tar.xz |
fix macro call regression
Signed-off-by: Mattias Andrée <maandree@operamail.com>
Diffstat (limited to '')
-rw-r--r-- | src/mds-kbdc/make-tree.c | 6 | ||||
-rw-r--r-- | src/mds-kbdc/mds-kbdc.c | 1 |
2 files changed, 6 insertions, 1 deletions
diff --git a/src/mds-kbdc/make-tree.c b/src/mds-kbdc/make-tree.c index 5bd2b9e..a32c33b 100644 --- a/src/mds-kbdc/make-tree.c +++ b/src/mds-kbdc/make-tree.c @@ -542,7 +542,7 @@ else if (quote) quote = (c != '"'); \ else if (c == '\"') quote = 1; \ else if (c == '>') triangle = 0; \ - else if ((c == ' ') && !triangle) { arg_end--; break; } \ + else if (IS_END(c) && !triangle) { arg_end--; break; } \ } \ prev_end_char = *arg_end, *arg_end = '\0'; \ fail_if ((node->var = strdup(line)) == NULL); \ @@ -769,6 +769,7 @@ int parse_to_tree(const char* restrict filename, mds_kbdc_tree_t** restrict resu continue; prev_end_char = *end, *end = '\0'; original = line; + fprintf(stderr, ":: %zu\n", line_i); redo: if (in_array) @@ -996,11 +997,14 @@ int parse_to_tree(const char* restrict filename, mds_kbdc_tree_t** restrict resu if (prev_end_char) { NEW_NODE(macro_call, MACRO_CALL); + old_end = end, old_prev_end_char = prev_end_char; NO_JUMP; + *old_end = '\0'; CHARS(name); #define inner arguments BRANCH(NULL); #undef inner + end = old_end, prev_end_char = old_prev_end_char; line++; for (;;) { diff --git a/src/mds-kbdc/mds-kbdc.c b/src/mds-kbdc/mds-kbdc.c index dc3327f..34b2002 100644 --- a/src/mds-kbdc/mds-kbdc.c +++ b/src/mds-kbdc/mds-kbdc.c @@ -55,6 +55,7 @@ int main(int argc_, char** argv_) if ((*errors)->severity >= MDS_KBDC_PARSE_ERROR_ERROR) fatal = 1; mds_kbdc_parse_error_print(*errors++, stderr); + errors++; } mds_kbdc_parse_error_free_all(parse_errors); if (fatal) |