• Tom Lane's avatar
    Fix parse location tracking for lists that can be empty. · 70726354
    Tom Lane authored
    The previous coding of the YYLLOC_DEFAULT macro behaved strangely for empty
    productions, assigning the previous nonterminal's location as the parse
    location of the result.  The usefulness of that was (at best) debatable
    already, but the real problem is that in list-generating nonterminals like
    	OptFooList: /* EMPTY */ { ... } | OptFooList Foo { ... } ;
    the initially-identified location would get copied up, so that even a
    nonempty list would be given a bogus parse location.  Document how to work
    around that, and do so for OptSchemaEltList, so that the error condition
    just added for CREATE SCHEMA IF NOT EXISTS produces a sane error cursor.
    So far as I can tell, there are currently no other cases where the
    situation arises, so we don't need other instances of this coding yet.
    70726354
namespace.out 1.62 KB