Check junk at end of line with the repeat directives.

This commit is contained in:
Olaf Seibert
2021-01-23 18:37:47 +01:00
parent 40b41c3087
commit 6f1af83101
4 changed files with 38 additions and 21 deletions

19
parse.c
View File

@@ -50,6 +50,25 @@ char *skipdelim_comma(
return cp;
}
/*
* check_eol - check that we're at the end of a line.
* Complain if not.
*/
int check_eol(
STACK *stack,
char *cp)
{
cp = skipwhite(cp);
if (EOL(*cp)) {
return 1;
}
report(stack->top, "Junk at end of line ('%s')\n", cp);
return 0;
}
/* Parses a string from the input stream. */
/* If not bracketed by <...> or ^/.../, then */
/* the string is delimited by trailing comma or whitespace. */