jwalton512 / vim-blade

Vim syntax highlighting for Blade templates.
225 stars 37 forks source link

Comment not highlighting immediately after @include() #8

Closed tremby closed 10 years ago

tremby commented 10 years ago

In the following snippet the comment and the end of the @include line and at the beginning of the @endforeach line is not highlighting.

{{-- It's important there's no whitespace between and around ol's children --}}
<ol class="nested-sortable">{{--
    --}}@foreach ($model['children'] as $node){{--
        --}}@include('admin.menu-items.item', ['model' => $node, 'parentId' => $model]){{--
    --}}@endforeach{{--
--}}</ol>
jwalton512 commented 10 years ago

Hmm -- so i know what is causing this, not sure quite how to fix it yet.

The problem is that the syntax is expecting anything after a @keyword( (if, foreach, etc) is part of the expression related to that keyword, all the way to the end of the line. The reason why it works properly after the @foreach in the example above is because there is a space between foreach and the opening (

I will continue to research a good way to resolve. The proper way to do it would be to match to the closing ), but i'm not familiar with how to do that properly without running into issues with parens within parens, ie @if($count > ($a*3))

jwalton512 commented 10 years ago

recent rewrite should resolve this issue