Peter Eisentraut <peter_e@gmx.net> writes:
> Tom Lane wrote:
>> BTW, I think it's a bad idea to assign made-up parse locations, as
>> you did here:
> Hmm, @$ is the location of the complete rule, so it should point to the
> "empty" spot in theory. Or am I misunderstanding something?
Well, yeah, but what is that? If you did get an error complaining
about, say, an invalid integral constant, the cursor wouldn't be
pointing at anything sensible.
I'm not even very sure that bison would produce a valid offset at all in
this case; it looks to me like the location macro just copies a value
that might not have been initialized. Did you test what gets produced?
But even stipulating that the cursor would point at the next or previous
token, it seems it'd be more confusing than useful.
regards, tom lane