Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/usr.bin/xlint/lint1 fix hex double parsing.



details:   https://anonhg.NetBSD.org/src/rev/1549ab0386e8
branches:  trunk
changeset: 750708:1549ab0386e8
user:      christos <christos%NetBSD.org@localhost>
date:      Mon Jan 11 16:28:06 2010 +0000

description:
fix hex double parsing.

diffstat:

 usr.bin/xlint/lint1/scan.l |  15 +++++++++------
 1 files changed, 9 insertions(+), 6 deletions(-)

diffs (44 lines):

diff -r 4229a2802c24 -r 1549ab0386e8 usr.bin/xlint/lint1/scan.l
--- a/usr.bin/xlint/lint1/scan.l        Mon Jan 11 14:30:02 2010 +0000
+++ b/usr.bin/xlint/lint1/scan.l        Mon Jan 11 16:28:06 2010 +0000
@@ -1,5 +1,5 @@
 %{
-/* $NetBSD: scan.l,v 1.46 2009/10/29 14:49:03 christos Exp $ */
+/* $NetBSD: scan.l,v 1.47 2010/01/11 16:28:06 christos Exp $ */
 
 /*
  * Copyright (c) 1996 Christopher G. Demetriou.  All Rights Reserved.
@@ -35,7 +35,7 @@
 
 #include <sys/cdefs.h>
 #if defined(__RCSID) && !defined(lint)
-__RCSID("$NetBSD: scan.l,v 1.46 2009/10/29 14:49:03 christos Exp $");
+__RCSID("$NetBSD: scan.l,v 1.47 2010/01/11 16:28:06 christos Exp $");
 #endif
 
 #include <stdlib.h>
@@ -89,6 +89,8 @@
 OD     [0-7]
 HD     [0-9A-Fa-f]
 EX     ([eE][+-]?[0-9]+)
+HX     (p[+-]?[0-9A-Fa-f]+)
+TL     ([fFlL]?[i]?)
 
 %option nounput
 
@@ -98,10 +100,11 @@
 0{OD}*[lLuU]*                  return (icon(8));
 {NZD}{D}*[lLuU]*               return (icon(10));
 0[xX]{HD}+[lLuU]*              return (icon(16));
-{D}+\.{D}*{EX}?[fFlL]?[i]?     |
-{D}+{EX}[fFlL]?[i]?            |
-0[xX]{HD}+p{HD}+[fFlL]?[i]?    |
-\.{D}+{EX}?[fFlL]?[i]?         return (fcon());
+{D}+\.{D}*{EX}?{TL}    |
+{D}+{EX}{TL}           |
+0[xX]{HD}+\.{HD}*{HX}{TL} |
+0[xX]{HD}+{HX}{TL}     |
+\.{D}+{EX}?{TL}                return (fcon());
 "="                            return (operator(T_ASSIGN, ASSIGN));
 "*="                           return (operator(T_OPASS, MULASS));
 "/="                           return (operator(T_OPASS, DIVASS));



Home | Main Index | Thread Index | Old Index