Re: scan.l simplifications

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: scan.l simplifications
Дата
Msg-id 24381.980780620@sss.pgh.pa.us
обсуждение исходный текст
Ответ на scan.l simplifications  ("Robert B. Easter" <reaster@comptechnews.com>)
Список pgsql-hackers
"Robert B. Easter" <reaster@comptechnews.com> writes:
> 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}))

I think it's better style as it stands.  The latter might be fewer
characters but it's not easier to understand (IMHO anyway), because
you have to refer back to more nonterminals to decipher it, and said
nonterminals have meanings much more complicated than digit.

Also, as you noted, it'd link the definitions of integer/decimal/real
in ways that might cause trouble later.
        regards, tom lane


В списке pgsql-hackers по дате отправления:

Предыдущее
От: Jan Wieck
Дата:
Сообщение: Security hole in PL/pgSQL
Следующее
От: Tom Lane
Дата:
Сообщение: Re: Security hole in PL/pgSQL