Skip to content

Commit 70f5ebe

Browse files
authored
Merge pull request #183 from sdebacker/master
Added support for special if statement @empty & @endempty
2 parents 4b57d19 + fe7dc7f commit 70f5ebe

File tree

2 files changed

+9
-5
lines changed

2 files changed

+9
-5
lines changed

blade.sublime-syntax

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ contexts:
9090
pop: true
9191
- include: 'scope:source.php'
9292

93-
- match: '(\s{0}|^)(\@)\b(acfrepeater|auth|block|break|can|cannot|canany|choice|case|component|continue|dd|debug|dump|each|elsecan|elsecannot|elsecanany|elseif|embed|error|extends|for|foreach|forelse|guest|hasSection|hipchat|if|isset|include|includeIf|includeWhen|inject|lang|layout|macro|macrodef|method|minify|partial|php|push|render|section|servers|set|slack|slot|stack|story|switch|task|unless|unset|while|wpposts|yield)\b(?=(|\s*|)\(\()'
93+
- match: '(\s{0}|^)(\@)\b(acfrepeater|auth|block|break|can|cannot|canany|choice|case|component|continue|dd|debug|dump|each|elsecan|elsecannot|elsecanany|elseif|embed|error|extends|for|foreach|forelse|guest|hasSection|hipchat|if|isset|empty|include|includeIf|includeWhen|inject|lang|layout|macro|macrodef|method|minify|partial|php|push|render|section|servers|set|slack|slot|stack|story|switch|task|unless|unset|while|wpposts|yield)\b(?=(|\s*|)\(\()'
9494
captures:
9595
0: punctuation.section.embedded.php
9696
2: constant.other.inline-data.html
@@ -102,7 +102,7 @@ contexts:
102102
pop: true
103103
- include: 'scope:source.php'
104104

105-
- match: '(\s{0}|^)(\@)\b(acfrepeater|auth|block|break|can|cannot|canany|choice|case|component|continue|dd|debug|dump|each|elsecan|elsecannot|elsecanany|elseif|embed|error|extends|for|foreach|forelse|guest|hasSection|hipchat|if|isset|include|includeIf|includeWhen|inject|lang|layout|macro|macrodef|method|minify|partial|php|push|render|section|servers|set|slack|slot|stack|story|switch|task|unless|unset|while|wpposts|yield)\b(?=(|\s*|)\()'
105+
- match: '(\s{0}|^)(\@)\b(acfrepeater|auth|block|break|can|cannot|canany|choice|case|component|continue|dd|debug|dump|each|elsecan|elsecannot|elsecanany|elseif|embed|error|extends|for|foreach|forelse|guest|hasSection|hipchat|if|isset|empty|include|includeIf|includeWhen|inject|lang|layout|macro|macrodef|method|minify|partial|php|push|render|section|servers|set|slack|slot|stack|story|switch|task|unless|unset|while|wpposts|yield)\b(?=(|\s*|)\()'
106106
captures:
107107
0: punctuation.section.embedded.php
108108
2: constant.other.inline-data.html
@@ -114,7 +114,7 @@ contexts:
114114
pop: true
115115
- include: 'scope:source.php'
116116

117-
- match: '(\s{0}|^)(\@)\b(acfend|after|append|auth|break|breakpoint|continue|csrf|default|else|empty|endswitch|endafter|endauth|endblock|endcan|endcannot|endcanany|endcomponent|endembed|endempty|enderror|endfor|endforeach|endforelse|endguest|endif|endisset|endmacro|endmarkdown|endminify|endpartial|endpush|endsection|endsetup|endslot|endstory|endtask|endunless|endwhile|guest|markdown|overwrite|parent|setup|show|stop|verbatim|endverbatim|wpempty|wpend|wpquery)\b'
117+
- match: '(\s{0}|^)(\@)\b(acfend|after|append|auth|break|breakpoint|continue|csrf|default|else|empty|endswitch|endafter|endauth|endblock|endcan|endcannot|endcanany|endcomponent|endembed|endempty|enderror|endfor|endforeach|endforelse|endguest|endif|endisset|endempty|endmacro|endmarkdown|endminify|endpartial|endpush|endsection|endsetup|endslot|endstory|endtask|endunless|endwhile|guest|markdown|overwrite|parent|setup|show|stop|verbatim|endverbatim|wpempty|wpend|wpquery)\b'
118118
scope: custom.compiler.blade.php
119119
captures:
120120
0: punctuation.section.embedded.php

test.blade.php

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -101,6 +101,10 @@
101101
Hello, {{ $name }}.
102102
@endisset
103103

104+
@empty($name)
105+
Hello, {{ $name }}.
106+
@endempty
107+
104108
@unless (Auth::check())
105109
You are not signed in.
106110
@endunless
@@ -401,7 +405,7 @@
401405
@endswitch
402406

403407
{{-- Complex conditional --}}
404-
@if(($x == true) && ($y == false))
408+
@if(($x == true) && ($y == false))
405409
<a>foo</a>
406410
@endif
407411

@@ -422,4 +426,4 @@
422426

423427
{{-- Validation Errors --}}
424428
@error('title')
425-
@enderror
429+
@enderror

0 commit comments

Comments
 (0)