pg.ddx.io  pgsql-interfaces@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: Axel at ansonic <goddyna@ansonic.com.au>
Cc: pgsql-interfaces@postgreSQL.org, "Ross J. Reedstrom" <reedstrm@wallace.ece.rice.edu>
Cc: blackw@sfu.ca
Subject: Re: [INTERFACES] Bug in parser?
Date: Mon, 07 Feb 2000 22:51:16 -0500
Message-ID: <27734.949981876@sss.pgh.pa.us> (raw)
In-Reply-To: <NABBLEOMMPNHHMBPOBPFIENAFFAA.goddyna@ansonic.com.au>
References: <NABBLEOMMPNHHMBPOBPFIENAFFAA.goddyna@ansonic.com.au>

"Axel at ansonic" <goddyna@ansonic.com.au> writes:
> reedited the file, take the line break out of it with one backspace (taking
> out asci char 10)
> Note asci char 13 still lives in the file, and is invisible.
> Compiling is ok.
> After executing the cgi PQtrace tells me:"ERROR:  parser: parse error at or
> near ""

Hmm.  It looks like scan.l already thinks \r is whitespace,
*except* in the situation where you're trying to continue a literal
string across lines, eg.

	INSERT INTO table VALUES('some data'
		'some more data');

If the intermediate end-of-line is only \r and hasn't got a \n,
the lexer will spit up because its rule for collapsing out the
two quotes and intervening whitespace is

xqcat			{quote}{space}*\n{space}*{quote}

If there's not a genuine honest-to-god \n in there, you lose.

My question to the lex gurus: why doesn't this rule simply read

xqcat			{quote}{space}*{quote}

considering that both \r and \n are members of {space}?  In fact,
shouldn't xqdouble and xqcat be combined and defined as above?
Unless lex has some weird built-in special treatment of \n,
I don't see why we need to call it out explicitly.

Similar comments apply to xbcat and xhcat --- and I'm kind of
wondering about xqliteral, xcline, and xcstop, all of which seem
to accord undeserved special status to \n ...

			regards, tom lane



view thread (12+ messages)  latest in thread

Message-ID: <27734.949981876@sss.pgh.pa.us>
Permalink:  ../27734.949981876@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/27734.949981876@sss.pgh.pa.us

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-interfaces@postgresql.org
  Cc: tgl@sss.pgh.pa.us, goddyna@ansonic.com.au, reedstrm@wallace.ece.rice.edu, blackw@sfu.ca
  Subject: Re: [INTERFACES] Bug in parser?
  In-Reply-To: <27734.949981876@sss.pgh.pa.us>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox