mirror of
https://github.com/open-simh/simtools.git
synced 2026-01-26 04:01:44 +00:00
A trailing comma in a macro call is an empty argument
which should also be counted for the purposes of .NARG.
This commit is contained in:
15
parse.c
15
parse.c
@@ -35,6 +35,21 @@ char *skipdelim(
|
||||
return cp;
|
||||
}
|
||||
|
||||
/* skipdelim_comma - used to advance between tokens. Whitespace
|
||||
and one comma are allowed delims.
|
||||
Set *comma depending on whether a comma was skipped. */
|
||||
|
||||
char *skipdelim_comma(
|
||||
char *cp,
|
||||
int *comma)
|
||||
{
|
||||
cp = skipwhite(cp);
|
||||
if (*comma = (*cp == ',')) {
|
||||
cp = skipwhite(cp + 1);
|
||||
}
|
||||
return cp;
|
||||
}
|
||||
|
||||
/* Parses a string from the input stream. */
|
||||
/* If not bracketed by <...> or ^/.../, then */
|
||||
/* the string is delimited by trailing comma or whitespace. */
|
||||
|
||||
Reference in New Issue
Block a user