summaryrefslogtreecommitdiff
path: root/usr.bin/m4
diff options
context:
space:
mode:
authorMarc Espie <espie@cvs.openbsd.org>2004-05-12 21:28:36 +0000
committerMarc Espie <espie@cvs.openbsd.org>2004-05-12 21:28:36 +0000
commit7ccfbe036b47fc50c2f1aef2593be0900caa45bf (patch)
treed6601cc69559a15a0c9c6ec39d163ae5cae376de /usr.bin/m4
parentd5ee764ac1e975390a8ecf81336fab41a5a20078 (diff)
all numbers as one composite regexp.
Diffstat (limited to 'usr.bin/m4')
-rw-r--r--usr.bin/m4/tokenizer.l28
1 files changed, 13 insertions, 15 deletions
diff --git a/usr.bin/m4/tokenizer.l b/usr.bin/m4/tokenizer.l
index 88df323d47c..7188a8cfc35 100644
--- a/usr.bin/m4/tokenizer.l
+++ b/usr.bin/m4/tokenizer.l
@@ -1,5 +1,5 @@
%{
-/* $OpenBSD: tokenizer.l,v 1.1 2004/05/12 21:17:03 espie Exp $ */
+/* $OpenBSD: tokenizer.l,v 1.2 2004/05/12 21:28:35 espie Exp $ */
/*
* Copyright (c) 2004 Marc Espie <espie@cvs.openbsd.org>
*
@@ -20,6 +20,7 @@
#include <errno.h>
#include <sys/types.h>
#include <limits.h>
+
extern int32_t yylval;
int32_t number(void);
@@ -32,19 +33,17 @@ oct 0[0-7]*
dec [1-9][0-9]*
%%
-{ws} {/* just skip it */}
-{hex} { yylval = number(); return(NUMBER); }
-{oct} { yylval = number(); return(NUMBER); }
-{dec} { yylval = number(); return(NUMBER); }
-"<=" { return(LE); }
-">=" { return(GE); }
-"<<" { return(LSHIFT); }
-">>" { return(RSHIFT); }
-"==" { return(EQ); }
-"!=" { return(NE); }
-"&&" { return(LAND); }
-"||" { return(LOR); }
-. { return yytext[0]; }
+{ws} {/* just skip it */}
+{hex}|{oct}|{dec} { yylval = number(); return(NUMBER); }
+"<=" { return(LE); }
+">=" { return(GE); }
+"<<" { return(LSHIFT); }
+">>" { return(RSHIFT); }
+"==" { return(EQ); }
+"!=" { return(NE); }
+"&&" { return(LAND); }
+"||" { return(LOR); }
+. { return yytext[0]; }
%%
int32_t
@@ -61,4 +60,3 @@ number()
return l;
}
-