Skip to content

Commit 54a49c8

Browse files
authored
Merge pull request #181 from dmitrybubyakin/master
Fix @php highlighting of the null coalescing and shorthand ternary operators
2 parents 6c4c6cb + dd32c6a commit 54a49c8

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

blade.sublime-syntax

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -59,8 +59,8 @@ contexts:
5959
0: punctuation.section.embedded.end.blade
6060
pop: true
6161
- include: 'scope:source.php'
62-
63-
- match: '((\s{0}|^)(@)(php)(?![^?]*\(*\))|<\?(?i:php|=)?)(?![^?]*\?>)'
62+
63+
- match: '((\s{0}|^)(@)(php)(?!.*\(*\))|<\?(?i:php|=)?)(?![^?]*\?>)'
6464
scope: punctuation.section.embedded.begin.php
6565
captures:
6666
0: punctuation.section.embedded.begin.php

test.blade.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,8 @@
4141
{{-- Inline PHP --}}
4242
<div class="container">
4343
@php(custom_function())
44+
@php($bool = $var ?? false)
45+
@php($bool = $bool ?: true)
4446
</div>
4547

4648
@include('footer')

0 commit comments

Comments
 (0)