Skip to content

Commit

Permalink
Fix cascade parsing
Browse files Browse the repository at this point in the history
Signed-off-by: Lucas RODRIGUEZ <[email protected]>
  • Loading branch information
ryohkhn committed Jun 11, 2024
1 parent 410dbe7 commit 84f9a8e
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 8 deletions.
2 changes: 1 addition & 1 deletion cli-version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
DEV-VERSION
0.4.0
4 changes: 2 additions & 2 deletions cognac_gen.sh
Original file line number Diff line number Diff line change
Expand Up @@ -340,7 +340,7 @@ EOF
aa = eq_ptr + 1;
} else {
CHK_BAD_RET(!aa, "cascade need an argument\n");
META_ARGS()
META_ARGS({CHK_BAD_RET(aa[0] == '-', "cascade need an argument"); })
}
STRY(cascade_parser(cascade_struct, next_a, aa, pa));
i += incr;
Expand All @@ -356,7 +356,7 @@ EOF
(void)str;
if (aa && aa[0] == '-' && aa[1] == '-' && aa[2] != '-') {
META_ARGS();
META_ARGS({ aa = 0; incr = 1; });
}
EOF

Expand Down
9 changes: 4 additions & 5 deletions main_tpl.c
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@
if (f) {fprintf(stderr, args); return -1;} \
} while(0)

#define META_ARGS() \
#define META_ARGS(else_cnd) \
if (!strcmp(aa, "--file")) { \
TRY(i + 3 >= ac, "file name require"); \
++incr; \
Expand All @@ -84,10 +84,9 @@
TRY(!var_found, "--var could not find osc variable '%s'", av[i + 3]); \
++incr; \
STRY(!aa); \
} else { \
aa = 0; \
incr = 1; \
}
} else \
else_cnd


#define VAR_NAME_SIZE 128
#define VAR_VAL_SIZE 512
Expand Down

0 comments on commit 84f9a8e

Please sign in to comment.