PR bin/50959 - allow consistent use of 0X hex constants (not just 0x)

(from kre)
This commit is contained in:
christos 2016-03-16 15:41:55 +00:00
parent 8bf117ec5f
commit fc1f924a3b
1 changed files with 3 additions and 3 deletions

View File

@ -1,5 +1,5 @@
%{
/* $NetBSD: arith_lex.l,v 1.16 2012/03/20 18:42:29 matt Exp $ */
/* $NetBSD: arith_lex.l,v 1.17 2016/03/16 15:41:55 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.16 2012/03/20 18:42:29 matt Exp $");
__RCSID("$NetBSD: arith_lex.l,v 1.17 2016/03/16 15:41:55 christos Exp $");
#endif
#endif /* not lint */
@ -59,7 +59,7 @@ extern const char *arith_buf, *arith_startbuf;
%%
[ \t\n] { ; }
0x[0-9a-fA-F]+ { yylval = strtoimax(yytext, 0, 0); return(ARITH_NUM); }
0[xX][0-9a-fA-F]+ { yylval = strtoimax(yytext, 0, 0); return(ARITH_NUM); }
0[0-7]* { yylval = strtoimax(yytext, 0, 0); return(ARITH_NUM); }
[1-9][0-9]* { yylval = strtoimax(yytext, 0, 0); return(ARITH_NUM); }
[A-Za-z_][A-Za-z_0-9]* { char *v = lookupvar(yytext);