summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorAngelos D. Keromytis <angelos@cvs.openbsd.org>2000-02-12 00:26:17 +0000
committerAngelos D. Keromytis <angelos@cvs.openbsd.org>2000-02-12 00:26:17 +0000
commit63f3cd1e7b5f27b2069911b646921d8d07b03f56 (patch)
tree6db6b13d81a112ffda4ee17050d57b158bfc44b8 /lib
parent74b93166e8b7af91577567879955f26f73d83a0e (diff)
Simplify a couple of things in the lexer, make the compiler happy so
-Wall doesn't complain at the lexers.
Diffstat (limited to 'lib')
-rw-r--r--lib/libkeynote/keynote-ver.l13
-rw-r--r--lib/libkeynote/keynote.l17
-rw-r--r--lib/libkeynote/testsuite/test-assertion13
3 files changed, 25 insertions, 8 deletions
diff --git a/lib/libkeynote/keynote-ver.l b/lib/libkeynote/keynote-ver.l
index 6d5cc4de362..711582ca618 100644
--- a/lib/libkeynote/keynote-ver.l
+++ b/lib/libkeynote/keynote-ver.l
@@ -1,5 +1,5 @@
%{
-/* $OpenBSD: keynote-ver.l,v 1.7 1999/10/26 22:31:38 angelos Exp $ */
+/* $OpenBSD: keynote-ver.l,v 1.8 2000/02/12 00:26:16 angelos Exp $ */
/*
* The author of this code is Angelos D. Keromytis (angelos@dsl.cis.upenn.edu)
*
@@ -53,7 +53,7 @@
static void mystrncpy(char *, char *, int);
%}
vstring [a-zA-Z0-9][a-zA-Z0-9_]*
-litstring \"(([^\"\n])|(\\[\"\n\f\r\t.]))*\"
+litstring \"(([^\"\n])|(\\[\"\n.]))*\"
comment "#"[^\n]*
%s FIRSTPART MIDDLEPART SECONDPART KEYSTATE
%pointer
@@ -89,7 +89,7 @@ comment "#"[^\n]*
}
<FIRSTPART,KEYSTATE>{comment} ;
[ \t\n] ;
-. { keynote_errno = ERROR_SYNTAX; return -1; }
+. { keynote_errno = ERROR_SYNTAX; return -1; REJECT; }
%%
@@ -263,6 +263,13 @@ read_environment(char *filename)
filename, kvlineno);
return -1;
}
+
+ /* Used to avoid compiler (-Wall) warnings. Never reached */
+ if (0)
+ {
+ yyunput(0, NULL);
+ yy_flex_realloc(0, NULL);
+ }
}
/*
diff --git a/lib/libkeynote/keynote.l b/lib/libkeynote/keynote.l
index 8068e77c820..ed1bb1bc302 100644
--- a/lib/libkeynote/keynote.l
+++ b/lib/libkeynote/keynote.l
@@ -1,5 +1,5 @@
%{
-/* $OpenBSD: keynote.l,v 1.6 1999/10/26 22:31:38 angelos Exp $ */
+/* $OpenBSD: keynote.l,v 1.7 2000/02/12 00:26:16 angelos Exp $ */
/*
* The author of this code is Angelos D. Keromytis (angelos@dsl.cis.upenn.edu)
*
@@ -66,11 +66,10 @@ static int first_tok = 0;
%}
digit [0-9]
specnumber [1-9][0-9]*
-number ({digit}+)
-flt ({digit}+"."{digit}+)
+number {digit}+
+flt {digit}+"."{digit}+
vstring [a-zA-Z_][a-zA-Z0-9_]*
-white ((\\[\n][[:space:]]*))
-litstring \"(([^\"\n])|(\\[\"\n\f\r\t.]))*\"
+litstring \"(([^\"\n])|(\\[\"\n.]))*\"
variable {vstring}
comment "#"[^\n]*
%s ACTIONSTRING LOCALINIT KEYPREDICATE SIGNERINIT KEYNOTEVERSION
@@ -208,6 +207,7 @@ comment "#"[^\n]*
[ \t\n]
. { keynote_errno = ERROR_SYNTAX;
return -1;
+ REJECT; /* Avoid -Wall warning. Not reached */
}
%%
@@ -752,5 +752,12 @@ keynote_get_envlist(char *buf, char *bufend, int whichfield)
keynote_init_list = (struct environment *) NULL;
}
+ /* Avoid compiler (-Wall) warnings. Never reached. */
+ if (0)
+ {
+ yyunput(0, NULL);
+ yy_flex_realloc(0, NULL);
+ }
+
return en;
}
diff --git a/lib/libkeynote/testsuite/test-assertion1 b/lib/libkeynote/testsuite/test-assertion1
index 2e9b9c167a1..0828cdf0937 100644
--- a/lib/libkeynote/testsuite/test-assertion1
+++ b/lib/libkeynote/testsuite/test-assertion1
@@ -3,6 +3,9 @@ comment: The weird looking string test in the conditions field is for
verifying correctness of string grammar
# comment inside comment field, no problem
#authorizer: $$$$foo # Don't try this at home
+# testing # testing # testing
+# "
+#
authorizer: "POLICY"
licensees: (MYKEY) && ((("Key3") || "Key4") && (MYKEY)) || TWOKEY
local-constants: MYKEY = "Key3"