/* directive functions return:
* 0 for success having scanned up to and including end of line but not beyond,
* or tokv_error or tokv_quit.
+ * They expect to parse the whitespace before their parameters (if any).
*/
-typedef int parmcondition_fnt(int ctoken, char **parmvalues, int *rtrue);
+typedef int parmcondition_fnt(int ctoken, char *const *parmvalues, int *rtrue);
static parmcondition_fnt pcf_glob, pcf_range, pcf_grep;
/* all conditional functions return tokv_error for failure or 0 for success
* at parsing and testing, in which case *rtrue is set to 0 or 1.
* On success they have scanned up to and including the condition's
- * terminating newline.
+ * terminating newline; the pcf_... functions expect to parse the whitespace
+ * between the parameter name and the condition's arguments.
+ * Otherwise they return tokv_error.
* The parameter-based conditionals take a list of parameter values
* as obtained from the parameter functions and pa_parameter,
* and do _not_ free it.
struct parser_state {
int lineno, reportlineno, notedreferer, isinternal;
const char *filename;
+ struct stat filestab;
YY_BUFFER_STATE ybuf;
struct parser_state *upstate;
};
struct error_handling {
int handling; /* One of the error handling modes tokt_ehandlemode */
- int logfacility, loglevel, filekeep;
+ int logfacility, loglevel;
+ int filekeep; /* File is in use by higher-level errors-push, leave it open */
FILE *file;
char *filename;
};
static int dequote(char *inplace);
+#define YY_NO_UNPUT
+
%}
+
%option noyywrap
+
%%
dnl simple words
}
[0-9]{1,8}-[0-9]{1,8} {
char *ep;
- lr_min=(int)strtoul(yytext,&ep,10);
+ lr_min= (int)strtoul(yytext,&ep,10);
assert(*ep == HYPHEN);
assert(*++ep);
- lr_max=(int)strtoul(ep,&ep,10);
+ lr_max= (int)strtoul(ep,&ep,10);
assert(!*ep);
if (lr_max < lr_min) {
parseerrprint("fd range has min > max");
'
divert(-1)
undivert
-