summaryrefslogtreecommitdiff
path: root/scripts/genksyms/lex.l
diff options
context:
space:
mode:
authorMichal Marek <mmarek@suse.cz>2011-01-20 16:19:58 +0100
committerMichal Marek <mmarek@suse.cz>2011-03-17 15:13:55 +0100
commit95f1d639ade8fdf9572ac8a926f62b29dd66eaba (patch)
tree9b8864def448176b950e1f747d33b5e7439ef429 /scripts/genksyms/lex.l
parent9c281f13b68da49764cbc8d7d610c2f229a0f9a0 (diff)
genksyms: Simplify lexer
The V2_TOKENS state is active all the time. Signed-off-by: Michal Marek <mmarek@suse.cz> Acked-by: Sam Ravnborg <sam@ravnborg.org>
Diffstat (limited to 'scripts/genksyms/lex.l')
-rw-r--r--scripts/genksyms/lex.l11
1 files changed, 3 insertions, 8 deletions
diff --git a/scripts/genksyms/lex.l b/scripts/genksyms/lex.l
index fe50ff9dacd0..4687b1d147de 100644
--- a/scripts/genksyms/lex.l
+++ b/scripts/genksyms/lex.l
@@ -55,10 +55,6 @@ CHAR L?\'([^\\\']*\\.)*[^\\\']*\'
MC_TOKEN ([~%^&*+=|<>/-]=)|(&&)|("||")|(->)|(<<)|(>>)
-/* Version 2 checksumming does proper tokenization; version 1 wasn't
- quite so pedantic. */
-%s V2_TOKENS
-
/* We don't do multiple input files. */
%option noyywrap
@@ -84,9 +80,9 @@ MC_TOKEN ([~%^&*+=|<>/-]=)|(&&)|("||")|(->)|(<<)|(>>)
recognized as tokens. We don't actually use them since we don't
parse expressions, but we do want whitespace to be arranged
around them properly. */
-<V2_TOKENS>{MC_TOKEN} return OTHER;
-<V2_TOKENS>{INT} return INT;
-<V2_TOKENS>{REAL} return REAL;
+{MC_TOKEN} return OTHER;
+{INT} return INT;
+{REAL} return REAL;
"..." return DOTS;
@@ -134,7 +130,6 @@ yylex(void)
if (lexstate == ST_NOTSTARTED)
{
- BEGIN(V2_TOKENS);
next_node = xmalloc(sizeof(*next_node));
next_node->next = NULL;
lexstate = ST_NORMAL;