scan.l simplifications - Mailing list pgsql-hackers

From Robert B. Easter
Subject scan.l simplifications
Date
Msg-id 01012902360610.08820@comptechnews
Whole thread Raw
Responses Re: scan.l simplifications
List pgsql-hackers
In scan.l, there is:

decimal (({digit}*\.{digit}+)|({digit}+\.{digit}*))
real 
((({digit}*\.{digit}+)|({digit}+\.{digit}*)|({digit}+))([Ee][-+]?{digit}+))

Could this be simplified as:

decimal (({integer}?\.{integer})|({integer}\.{integer}?))
real ((({decimal})|({integer}))([Ee][-+]?{integer}))

What is the reason if it shouldn't be?  This is just an educational question, 
I guess. I wouldn't want to waste time writing bad patches. :)  I ran regress 
with this change and it looked ok.

One reason I can think of right now, is that if the definition of integer or 
decimal were to change, it might break decimal and real.  Another reason 
might be a performance loss?

-- 
-------- Robert B. Easter  reaster@comptechnews.com ---------
-- CompTechNews Message Board http://www.comptechnews.com/ --
-- CompTechServ Tech Services http://www.comptechserv.com/ --
---------- http://www.comptechnews.com/~reaster/ ------------


pgsql-hackers by date:

Previous
From: Lamar Owen
Date:
Subject: 7.1beta4 RPMs.
Next
From: Lamar Owen
Date:
Subject: Re: Re: Sure enough, the lock file is gone