Skip to content

Commit 8a63eba

Browse files
author
Dominik Gehlich
committed
function body $$ with spaces and comments afterwards
1 parent 16b81cb commit 8a63eba

1 file changed

Lines changed: 11 additions & 4 deletions

File tree

‎PostgreSQL.tmLanguage‎

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@
9595
<array>
9696
<dict>
9797
<key>begin</key>
98-
<string>(\$[\w_0-9]*\$)$</string>
98+
<string>(\$[\w_]*\$)(?=[^\$]*$)</string>
9999
<key>beginCaptures</key>
100100
<dict>
101101
<key>1</key>
@@ -105,7 +105,11 @@
105105
</dict>
106106
</dict>
107107
<key>comment</key>
108-
<string>Assume multiline dollar quote is SQL; start if quote is at the end of the line.</string>
108+
<string>Assume multiline dollar quote is SQL body!
109+
Start if double dollor quote is followed by no dollor quote till line ending.
110+
See match for dollar quotes as string: string.unquoted.dollar.pgsql
111+
This could easily support other PL languages like PHP and Ruby -- see PHP heredoc as an example.
112+
</string>
109113
<key>contentName</key>
110114
<string>meta.dollar-quote.pgsql</string>
111115
<key>end</key>
@@ -558,9 +562,12 @@
558562
</dict>
559563
<dict>
560564
<key>begin</key>
561-
<string>(\$[\w_0-9]*\$)</string>
565+
<string>(\$[\w_]*\$)</string>
562566
<key>comment</key>
563-
<string>Color as a string if dollar quote did not start at the end of a line.</string>
567+
<string>
568+
Color dollar double quotes as a string if in one line.
569+
No multiline supported because function body is with dollar quotes, see meta.dollar-quote.pgsql.
570+
</string>
564571
<key>end</key>
565572
<string>\1</string>
566573
<key>name</key>

0 commit comments

Comments
 (0)