Skip to content

Commit

Permalink
Fix blade scopes consistency
Browse files Browse the repository at this point in the history
  • Loading branch information
zaynali53 committed Jul 2, 2016
1 parent 18afe13 commit f338c41
Showing 1 changed file with 44 additions and 43 deletions.
87 changes: 44 additions & 43 deletions blade.sublime-syntax
Original file line number Diff line number Diff line change
Expand Up @@ -14,27 +14,64 @@ contexts:

- match: '{{--'
captures:
0: punctuation.definition.comment.html
0: punctuation.definition.comment.begin.blade
push:
- meta_scope: comment.block.blade.html
- meta_scope: comment.block.html.blade
- match: '--}}'
scope: punctuation.definition.comment.end.blade
pop: true
- match: "--"
scope: invalid.illegal.bad-comments-or-CDATA.html
scope: invalid.illegal.bad-comments-or-CDATA.html.blade

- match: '\{(!!)|(\{\{\{?)-?'
captures:
0: entity.name.tag.block.any.html
0: punctuation.section.embedded.begin.blade
push:
- meta_scope: meta.embedded.line.blade.php
- meta_scope: entity.name.tag.blade
- meta_content_scope: source.php.blade
- match: '-?(\}?\}\})|(!!)\}'
captures:
0: entity.name.tag.block.any.html
1: entity.name.tag.block.any.html
0: punctuation.section.embedded.end.blade
1: punctuation.section.embedded.end.blade
pop: true
- include: 'scope:source.php'

- match: '@\{\{\{?-?'
captures:
0: punctuation.section.embedded.ignore.begin.blade
push:
- meta_scope: 'scope:text.html.basic'
- meta_content_scope: 'scope:text.html.basic'
- match: '-?\}?\}\}'
captures:
0: punctuation.section.embedded.ignore.end.blade
1: punctuation.section.embedded.ignore.end.blade
pop: true

- match: '<\?(?i:php|=)?(?![^?]*\?>)'
scope: punctuation.section.embedded.begin.php
push:
- meta_content_scope: source.php
- meta_scope: meta.embedded.block.blade.php
- include: 'scope:source.php'
with_prototype:
- match: (?=\?>)(\?>)
captures:
0: punctuation.section.embedded.end.php
pop: true

- match: '<\?(?i:php|=)?'
scope: punctuation.section.embedded.begin.php
push:
- meta_content_scope: source.php.blade
- meta_scope: meta.embedded.line.blade.php
- include: 'scope:source.php'
with_prototype:
- match: (?=\?>)(\?>)
captures:
0: punctuation.section.embedded.end.php
pop: true

- match: '(\s{0}|^)(\@)\b(debug|embed|macrodef|set|unset|if|elseif|forelse|foreach|for|while|extends|unless|each|yield|lang|choice|section|include|render|block|can|cannot|inject|partial|hasSection|elsecan|elsecannot|stack|push|layout|continue|break|minify|macro)\b(?=(|\s*|)\()'
captures:
0: entity.name.tag.block.any.html
Expand Down Expand Up @@ -72,39 +109,3 @@ contexts:
0: constant.other.inline-data.html
2: constant.other.inline-data.html
pop: false

- match: '@\{\{\{?-?'
captures:
0: entity.name.tag.block.any.html
push:
- meta_scope: 'scope:text.html.basic'
- meta_content_scope: 'scope:text.html.basic'
- match: '-?\}?\}\}'
captures:
0: entity.name.tag.block.any.html
1: entity.name.tag.block.any.html
pop: true

- match: '<\?(?i:php|=)?(?![^?]*\?>)'
scope: punctuation.section.embedded.begin.php
push:
- meta_content_scope: source.php
- meta_scope: meta.embedded.block.blade.php
- include: 'scope:source.php'
with_prototype:
- match: (?=\?>)(\?>)
captures:
0: punctuation.section.embedded.end.php
pop: true

- match: '<\?(?i:php|=)?'
scope: punctuation.section.embedded.begin.php
push:
- meta_content_scope: source.php.blade
- meta_scope: meta.embedded.line.blade.php
- include: 'scope:source.php'
with_prototype:
- match: (?=\?>)(\?>)
captures:
0: punctuation.section.embedded.end.php
pop: true

0 comments on commit f338c41

Please sign in to comment.