scan.l simplifications

From: "Robert B(dot) Easter" <reaster(at)comptechnews(dot)com>
To: pgsql-hackers(at)postgresql(dot)org
Subject: scan.l simplifications
Date: 2001-01-29 07:36:06
Message-ID: 01012902360610.08820@comptechnews
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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(at)comptechnews(dot)com ---------
-- CompTechNews Message Board http://www.comptechnews.com/ --
-- CompTechServ Tech Services http://www.comptechserv.com/ --
---------- http://www.comptechnews.com/~reaster/ ------------

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Lamar Owen 2001-01-29 07:43:55 Re: Re: Sure enough, the lock file is gone
Previous Message Lamar Owen 2001-01-29 07:35:00 7.1beta4 RPMs.