Обсуждение: RE: [HACKERS] Postgres' lexer

Поиск
Список
Период
Сортировка

RE: [HACKERS] Postgres' lexer

От
"Ansley, Michael"
Дата:
I've just grabbed it now, I'll get back to you Monday.

>> -----Original Message-----
>> From: Leon [mailto:leon@udmnet.ru]
>> Sent: Friday, August 20, 1999 8:28 PM
>> To: Ansley, Michael
>> Cc: hackers
>> Subject: Re: [HACKERS] Postgres' lexer
>> 
>> 
>> Ansley, Michael wrote:
>> > 
>> > Leon, if you manage to find a replacement for this, please 
>> let me know.
>> > I'll probably only pick it up after the weekend.
>> > 
>> > I think that we need to find another way to tokenise the 
>> minus.  First of
>> > all, though, how is the parser supposed to tell whether this:
>> > a -2
>> > means this:
>> > (a - 2)
>> > or this:
>> > a (-2)
>> 
>> I think that the current behavior is ok - it is what we would expect
>> from expressions like 'a -2'.
>> 
>> I have produced a patch to cleanup the code. It works due to the
>> fact that unary minus gets processed in doNegate() in parser anyway,
>> and it is by no way lexer's job to do grammatical parsing - i.e.
>> deciding if operator is to be treated as binary or unary. 
>> 
>> I ran regression tests, everything seems to be ok. It is my first
>> diff/patch experience in *NIX, so take it with mercy :) But it 
>> seems to be correct. It is to be applied against 6.5.0 (I have
>> not upgraded to 6.5.1 yet, but hope lexer hasn't changed since
>> then.) The patch mainly contains nuked code. The only thing added
>> is my short comment :)
>> 
>> Have I done some right thing? :)
>> 
>> -- 
>> Leon.
>> ---------
>> "This may seem a bit weird, but that's okay, because it is weird." -
>> Perl manpage.
>>