diff options
author | 2004-05-12 21:28:35 +0000 | |
---|---|---|
committer | 2004-05-12 21:28:35 +0000 | |
commit | d45c758216e3af5c4c805e7c43900e8b88ce3c83 (patch) | |
tree | dc68cde4090789bbae123e467e982aa742b970bf | |
parent | eval regress matching PR, more stuff to come. (diff) | |
download | wireguard-openbsd-d45c758216e3af5c4c805e7c43900e8b88ce3c83.tar.xz wireguard-openbsd-d45c758216e3af5c4c805e7c43900e8b88ce3c83.zip |
all numbers as one composite regexp.
-rw-r--r-- | usr.bin/m4/tokenizer.l | 28 |
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; } - |