Joe Conway <mail@joeconway.com> writes:
>> I noticed that, with the PoC patch, "json" is the only format that must be
>> quoted. Without quotes, I see a syntax error. I'm assuming there's a
>> conflict with another json-related rule somewhere in gram.y, but I haven't
>> tracked down exactly which one is causing it.
While I've not looked too closely, I suspect this might be due to the
FORMAT_LA hack in base_yylex:
/* Replace FORMAT by FORMAT_LA if it's followed by JSON */
switch (next_token)
{
case JSON:
cur_token = FORMAT_LA;
break;
}
So if you are writing a production that might need to match
FORMAT followed by JSON, you need to match FORMAT_LA too.
(I spent a little bit of time last week trying to get rid of
FORMAT_LA, thinking that it didn't look necessary. Did not
succeed yet.)
regards, tom lane