Re: Fwd: polite request about syntax

From: Andrew Dunstan <andrew(at)dunslane(dot)net>
To: Ricardo Malafaia <rmalafaia(at)gmail(dot)com>
Cc: pgsql-hackers(at)postgresql(dot)org
Subject: Re: Fwd: polite request about syntax
Date: 2006-09-15 16:42:25
Message-ID: 450AD7F1.1010806@dunslane.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Ricardo Malafaia wrote:
>
> And the $$ is indeed needed for allowing languages with different
> syntaxes. agreed. However, Tom, i could counter example your plperl
> example:
>
>> realize that qq/end/ does not represent a matching "end"?
>
> What happens then when it sees something like a double variable
> interpolation as in $$foobar? ;)
>

The delimiter does not have to be $$. It can be
$any_unquoted_identifier_without_a_dollar_sign$.

the lexer says:

/* $foo$ style quotes ("dollar quoting")
* The quoted string starts with $foo$ where "foo" is an optional string
* in the form of an identifier, except that it may not contain "$",
* and extends to the first occurrence of an identical string.
* There is *no* processing of the quoted text.
*
*/
dolq_start [A-Za-z\200-\377_]
dolq_cont [A-Za-z\200-\377_0-9]
dolqdelim \$({dolq_start}{dolq_cont}*)?\$

So for a plperl function you just use something like $func$ at each end.

cheers

andrew

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Alvaro Herrera 2006-09-15 16:43:46 Re: Fwd: polite request about syntax
Previous Message Ricardo Malafaia 2006-09-15 16:39:48 Re: Fwd: polite request about syntax