Skip to content

Commit

Permalink
Allow whitespace after q/qq in heredocs
Browse files Browse the repository at this point in the history
  • Loading branch information
hinrik committed Apr 11, 2015
1 parent 50ce2fe commit 40c9080
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 4 deletions.
4 changes: 2 additions & 2 deletions syntax/perl6.vim
Original file line number Diff line number Diff line change
Expand Up @@ -454,8 +454,8 @@ syn match p6QuoteQ_qww display "qww[A-Za-z(]\@!" nextgroup=p6PairsQ_qww skipwhi
syn match p6QuoteQ_qq display "qq[pwx]\?[A-Za-z(]\@!" nextgroup=p6PairsQ_qq skipwhite skipempty contained
syn match p6QuoteQ_qto display "qto[A-Za-z(]\@!" nextgroup=p6StringQ_qto skipwhite skipempty contained
syn match p6QuoteQ_qqto display "qqto[A-Za-z(]\@!" nextgroup=p6StringQ_qqto skipwhite skipempty contained
syn match p6QuoteQ_qto display "q\%(:\%(to\|heredoc\)[A-Za-z(]\@!\)\@=" nextgroup=p6PairsQ_qto skipwhite skipempty contained
syn match p6QuoteQ_qqto display "qq\%(:\%(to\|heredoc\)[A-Za-z(]\@!\)\@=" nextgroup=p6PairsQ_qqto skipwhite skipempty contained
syn match p6QuoteQ_qto display "q\s*\%(:\%(to\|heredoc\)[A-Za-z(]\@!\)\@=" nextgroup=p6PairsQ_qto skipwhite skipempty contained
syn match p6QuoteQ_qqto display "qq\s*\%(:\%(to\|heredoc\)[A-Za-z(]\@!\)\@=" nextgroup=p6PairsQ_qqto skipwhite skipempty contained
syn match p6PairsQ "\%(\_s*:!\?\%([A-Za-z_\xC0-\xFF]\%([A-Za-z_\xC0-\xFF0-9]\|[-'][A-Za-z_\xC0-\xFF]\@=\)*\)\%(([^)]*)\)\?\)*" contained transparent skipwhite skipempty nextgroup=p6StringQ
syn match p6PairsQ_q "\%(\_s*:!\?\%([A-Za-z_\xC0-\xFF]\%([A-Za-z_\xC0-\xFF0-9]\|[-'][A-Za-z_\xC0-\xFF]\@=\)*\)\%(([^)]*)\)\?\)*" contained transparent skipwhite skipempty nextgroup=p6StringQ_q
syn match p6PairsQ_qww "\%(\_s*:!\?\%([A-Za-z_\xC0-\xFF]\%([A-Za-z_\xC0-\xFF0-9]\|[-'][A-Za-z_\xC0-\xFF]\@=\)*\)\%(([^)]*)\)\?\)*" contained transparent skipwhite skipempty nextgroup=p6StringQ_qww
Expand Down
4 changes: 2 additions & 2 deletions syntax/perl6.vim.pre
Original file line number Diff line number Diff line change
Expand Up @@ -454,8 +454,8 @@ syn match p6QuoteQ_qww display "qww[A-Za-z(]\@!" nextgroup=p6PairsQ_qww skipwhi
syn match p6QuoteQ_qq display "qq[pwx]\?[A-Za-z(]\@!" nextgroup=p6PairsQ_qq skipwhite skipempty contained
syn match p6QuoteQ_qto display "qto[A-Za-z(]\@!" nextgroup=p6StringQ_qto skipwhite skipempty contained
syn match p6QuoteQ_qqto display "qqto[A-Za-z(]\@!" nextgroup=p6StringQ_qqto skipwhite skipempty contained
syn match p6QuoteQ_qto display "q\%(:\%(to\|heredoc\)[A-Za-z(]\@!\)\@=" nextgroup=p6PairsQ_qto skipwhite skipempty contained
syn match p6QuoteQ_qqto display "qq\%(:\%(to\|heredoc\)[A-Za-z(]\@!\)\@=" nextgroup=p6PairsQ_qqto skipwhite skipempty contained
syn match p6QuoteQ_qto display "q\s*\%(:\%(to\|heredoc\)[A-Za-z(]\@!\)\@=" nextgroup=p6PairsQ_qto skipwhite skipempty contained
syn match p6QuoteQ_qqto display "qq\s*\%(:\%(to\|heredoc\)[A-Za-z(]\@!\)\@=" nextgroup=p6PairsQ_qqto skipwhite skipempty contained
syn match p6PairsQ "@@ADVERBS@@" contained transparent skipwhite skipempty nextgroup=p6StringQ
syn match p6PairsQ_q "@@ADVERBS@@" contained transparent skipwhite skipempty nextgroup=p6StringQ_q
syn match p6PairsQ_qww "@@ADVERBS@@" contained transparent skipwhite skipempty nextgroup=p6StringQ_qww
Expand Down
3 changes: 3 additions & 0 deletions t_source/perl6/quoting.t
Original file line number Diff line number Diff line change
Expand Up @@ -39,5 +39,8 @@ dfgdfgdfg
dfg
bla

say qq :to 'TEXT';
Wow, this is $description!
TEXT
# vim: ft=perl6
3 changes: 3 additions & 0 deletions t_source/perl6/quoting.t.html
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,9 @@
<span class="synString">dfg</span>
<span class="synDelimiter">bla</span>

say <span class="synDelimiter">qq </span><span class="synOperator">:</span><span class="synString">to</span> <span class="synDelimiter">'TEXT'</span><span class="synString">;</span>
<span class="synString"> Wow, this is </span><span class="synIdentifier">$description</span><span class="synString">!</span>
<span class="synDelimiter"> TEXT</span>

<span class="synComment"># vim: ft=perl6</span>
</pre>
Expand Down

0 comments on commit 40c9080

Please sign in to comment.