chiark
/
gitweb
/
~ian
/
userv.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
@@ -1,6 +1,7 @@
[userv.git]
/
lexer.l.m4
diff --git
a/lexer.l.m4
b/lexer.l.m4
index 849f233115545749f24e1f0ff6d78e574789dc14..78aab9d4020f4ced1b63aa6942844679f82e6aa0 100644
(file)
--- a/
lexer.l.m4
+++ b/
lexer.l.m4
@@
-1,7
+1,7
@@
dnl userv - lexer.l.m4
dnl lexer, passed through m4 with defs from langauge.i4
/*
dnl userv - lexer.l.m4
dnl lexer, passed through m4 with defs from langauge.i4
/*
- * Copyright (C)1996-1997 Ian Jackson
+ * Copyright (C)1996-1997
,1999
Ian Jackson
*
* This is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by
*
* This is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by
@@
-33,13
+33,16
@@
include(language.i4)
#include <fnmatch.h>
#include <limits.h>
#include <dirent.h>
#include <fnmatch.h>
#include <limits.h>
#include <dirent.h>
+#include <sys/types.h>
#include <sys/stat.h>
#include <time.h>
#include <sys/stat.h>
#include <time.h>
+#include <errno.h>
#include "config.h"
#include "common.h"
#include "daemon.h"
#include "lib.h"
#include "config.h"
#include "common.h"
#include "daemon.h"
#include "lib.h"
+#include "both.h"
#include "tokens.h"
#define HYPHEN '-'
#include "tokens.h"
#define HYPHEN '-'
@@
-129,6
+132,7
@@
struct error_handling {
static struct error_handling eh = { tokv_word_errorstostderr, 0,0,0,0,0 };
static int dequote(char *inplace);
static struct error_handling eh = { tokv_word_errorstostderr, 0,0,0,0,0 };
static int dequote(char *inplace);
+static void countnewlines(void);
#define YY_NO_UNPUT
#define YY_NO_UNPUT
@@
-155,10
+159,8
@@
changequote({*,*})
assert(*++ep);
lr_max= (int)strtoul(ep,&ep,10);
assert(!*ep);
assert(*++ep);
lr_max= (int)strtoul(ep,&ep,10);
assert(!*ep);
- if (lr_max < lr_min) {
- parseerrprint("fd range has min > max");
- return tokv_error;
- }
+ if (lr_max < lr_min)
+ return parseerrprint("fd range has min > max");
return tokv_fdrange;
}
[0-9]{1,8}- {
return tokv_fdrange;
}
[0-9]{1,8}- {
@@
-169,25
+171,28
@@
changequote({*,*})
lr_max=-1;
return tokv_fdstoend;
}
lr_max=-1;
return tokv_fdstoend;
}
-[\ \t]+ return tokv_lwsp;
+([\ \t]*\\[\ \t]*\n[\ \t]*)+ countnewlines(); return tokv_lwsp;
+[\ \t]+ return tokv_lwsp;
[\ \t]*\n cstate->lineno++; return tokv_newline;
[\ \t]*\#[^\n]*\n cstate->lineno++; return tokv_newline;
[\ \t]*\n cstate->lineno++; return tokv_newline;
[\ \t]*\#[^\n]*\n cstate->lineno++; return tokv_newline;
-[\ \t]*\#[^\n]* {
- parseerrprint("missing newline at eof after comment");
- return tokv_error;
- }
-[^\ \t\n]+ return tokv_barestring;
-\"([^\\\"\n]|\\[a-z]|\\[0-9]{3}|\\x[0-9A-Fa-f]{2}|\\[:punct:]|\\[ \t]*\n)*\" {
+[\ \t]*\#[^\n]* return parseerrprint("missing newline at eof after comment");
+\"([^\\\"\n]|\\[a-z]|\\[0-9]{3}|\\x[0-9A-Fa-f]{2}|\\[[:punct:]]|\\[ \t]*\n)*\" {
+ countnewlines();
return dequote(yytext);
}
return dequote(yytext);
}
-\".* {
-
parseerrprint("misquoted or unterminated string")
;
-
return tokv_error
;
- }
-<<EOF>> return tokv_eof;
+[^\ \t\n\\\"]+ return tokv_barestring;
+
<<EOF>> return tokv_eof
;
+
\" return parseerrprint("misquoted or unterminated string")
;
+\\ return parseerrprint("unexpected backslash");
+. abort(); /* expect lex warning "rule cannot be matched" */
*}
changequote(`,')
%%
*}
changequote(`,')
%%
+
+const char *const builtinservicehelpstrings[]= {
+undivert(5)dnl
+ 0
+};
`
#include "parser.c"
'
`
#include "parser.c"
'