[TxMt] extending sql language to support PostgreSQL $dollar$ quoting

Allan Odgaard throw-away-1 at macromates.com
Mon Jul 16 20:27:24 UTC 2007


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.





More information about the textmate mailing list