Module Name:    src
Committed By:   christos
Date:           Mon Jan 11 16:28:06 UTC 2010

Modified Files:
        src/usr.bin/xlint/lint1: scan.l

Log Message:
fix hex double parsing.


To generate a diff of this commit:
cvs rdiff -u -r1.46 -r1.47 src/usr.bin/xlint/lint1/scan.l

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/usr.bin/xlint/lint1/scan.l
diff -u src/usr.bin/xlint/lint1/scan.l:1.46 src/usr.bin/xlint/lint1/scan.l:1.47
--- src/usr.bin/xlint/lint1/scan.l:1.46	Thu Oct 29 10:49:03 2009
+++ src/usr.bin/xlint/lint1/scan.l	Mon Jan 11 11:28:06 2010
@@ -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));

Reply via email to