use flex options instead of #defines

This commit is contained in:
christos 2009-10-29 14:21:40 +00:00
parent 39c14eeaaf
commit 5dfc26d510
2 changed files with 6 additions and 5 deletions

View File

@ -1,4 +1,4 @@
# $NetBSD: Makefile,v 1.85 2009/04/20 16:05:29 drochner Exp $
# $NetBSD: Makefile,v 1.86 2009/10/29 14:21:40 christos Exp $
# @(#)Makefile 8.4 (Berkeley) 5/5/95
.include <bsd.own.mk>
@ -34,7 +34,7 @@ LFLAGS+=-L
YFLAGS+=-l
.endif
CPPFLAGS+=-DSHELL -I. -I${.CURDIR} -DYY_NO_INPUT
CPPFLAGS+=-DSHELL -I. -I${.CURDIR}
#XXX: For testing only.
#CPPFLAGS+=-DDEBUG=1
#CFLAGS+=-funsigned-char

View File

@ -1,5 +1,5 @@
%{
/* $NetBSD: arith_lex.l,v 1.14 2007/03/25 06:29:26 apb Exp $ */
/* $NetBSD: arith_lex.l,v 1.15 2009/10/29 14:21:40 christos Exp $ */
/*-
* Copyright (c) 1993
@ -38,7 +38,7 @@
#if 0
static char sccsid[] = "@(#)arith_lex.l 8.3 (Berkeley) 5/4/95";
#else
__RCSID("$NetBSD: arith_lex.l,v 1.14 2007/03/25 06:29:26 apb Exp $");
__RCSID("$NetBSD: arith_lex.l,v 1.15 2009/10/29 14:21:40 christos Exp $");
#endif
#endif /* not lint */
@ -53,9 +53,10 @@ extern const char *arith_buf, *arith_startbuf;
#undef YY_INPUT
#define YY_INPUT(buf,result,max) \
result = (*buf = *arith_buf++) ? 1 : YY_NULL;
#define YY_NO_UNPUT
%}
%option nounput noinput
%%
[ \t\n] { ; }
0x[0-9a-fA-F]+ { yylval = strtoimax(yytext, 0, 0); return(ARITH_NUM); }