Hello
I would like to extend the sql language definition to support PostgreSQL's dollar quoting semantics.
http://www.postgresql.org/docs/current/static/sql-syntax-lexical.html#SQL-SY...
Ideally, I'd like to be able to fold dollar quoted strings as they're often used for large chunks of text, particularly function definitions.
What is the right place to start in order to implement this? Should I modify the existing sql bundle?
Andrew
On 13. Jul 2007, at 23:34, Andrew Hammond wrote:
[...] Ideally, I'd like to be able to fold dollar quoted strings as they're often used for large chunks of text, particularly function definitions.
Unfortunately not possible since the start and stop token for foldings needs to differ. You might be able to make it work by introducing a convention like placing a comment after the stop marker, like:
$foo$ «the dollar quoted string here» $foo$ -- end
What is the right place to start in order to implement this? Should I modify the existing sql bundle?
Since dollar-quoting is psql specific we probably do not want to put rules to match them in the standard SQL grammar, so the best approach I think is to create a new PostgreSQL grammar which includes the old one, and place the dollar-quoted string rule there. This would then also hold the folding patterns.