Skip to content

Commit 8d62989

Browse files
committed
Initial commit
0 parents  commit 8d62989

File tree

4 files changed

+248
-0
lines changed

4 files changed

+248
-0
lines changed

Comments.tmPreferences

+42
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
3+
<plist version="1.0">
4+
<dict>
5+
<key>name</key>
6+
<string>Comments</string>
7+
<key>scope</key>
8+
<string>text.html.stone, source.js.stone, custom.compiler.stone.js</string>
9+
<key>settings</key>
10+
<dict>
11+
<key>shellVariables</key>
12+
<array>
13+
<dict>
14+
<key>name</key>
15+
<string>TM_COMMENT_START</string>
16+
<key>value</key>
17+
<string>{{-- </string>
18+
</dict>
19+
<dict>
20+
<key>name</key>
21+
<string>TM_COMMENT_END</string>
22+
<key>value</key>
23+
<string> --}}</string>
24+
</dict>
25+
<dict>
26+
<key>name</key>
27+
<string>TM_COMMENT_START_2</string>
28+
<key>value</key>
29+
<string>&lt;!-- </string>
30+
</dict>
31+
<dict>
32+
<key>name</key>
33+
<string>TM_COMMENT_END_2</string>
34+
<key>value</key>
35+
<string> --&gt;</string>
36+
</dict>
37+
</array>
38+
</dict>
39+
<key>uuid</key>
40+
<string>725f59db-0615-49e0-b206-f9574e1db5ec</string>
41+
</dict>
42+
</plist>

README.markdown

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
## Grind Stone Syntax Highlighter for Sublime
2+
3+
This package adds syntax definitions to Sublime for the [Grind](https://grind.rocks) Stone engine. This package has been adapted from [Medalink/laravel-blade](https://github.com/Medalink/laravel-blade).

grind-stone.sublime-syntax

+87
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,87 @@
1+
%YAML 1.2
2+
---
3+
name: Grind Stone
4+
file_extensions: [ stone ]
5+
scope: text.stone
6+
contexts:
7+
main:
8+
- match: ''
9+
push:
10+
- include: 'scope:text.html.basic'
11+
- meta_scope: text.html.stone
12+
pop: true
13+
with_prototype:
14+
15+
- match: '{{--'
16+
captures:
17+
0: punctuation.definition.comment.begin.stone
18+
push:
19+
- meta_scope: comment.block.html.stone
20+
- match: '--}}'
21+
scope: punctuation.definition.comment.end.stone
22+
pop: true
23+
- match: "--"
24+
scope: invalid.illegal.bad-comments-or-CDATA.html.stone
25+
26+
- match: '\{(!!)|(\{\{)-?'
27+
captures:
28+
0: punctuation.section.embedded.begin.stone
29+
push:
30+
- meta_scope: entity.name.tag.stone
31+
- meta_content_scope: source.js.stone
32+
- match: '-?(\}?\}\})|(!!)\}'
33+
captures:
34+
0: punctuation.section.embedded.end.stone
35+
1: punctuation.section.embedded.end.stone
36+
pop: true
37+
- include: 'scope:source.js'
38+
39+
- match: '@\{\{\{?-?'
40+
captures:
41+
0: punctuation.section.embedded.ignore.begin.stone
42+
push:
43+
- meta_scope: 'scope:text.html.basic'
44+
- meta_content_scope: 'scope:text.html.basic'
45+
- match: '-?\}?\}\}'
46+
captures:
47+
0: punctuation.section.embedded.ignore.end.stone
48+
1: punctuation.section.embedded.ignore.end.stone
49+
pop: true
50+
51+
- match: '(\s{0}|^)(\@)\b(asset|babel|block|break|coffee|component|continue|css|debug|dump|each|elseif|extends|for|foreach|forelse|hasSection|if|include|js|layout|less|macro|push|sass|scss|script|section|set|slot|stack|styl|style|stylus|unless|while|yield)\b(?=(|\s*|)\()'
52+
captures:
53+
0: punctuation.section.embedded.js
54+
2: keyword.control.flow.js
55+
3: keyword.control.flow.js
56+
push:
57+
- meta_scope: custom.compiler.stone.js
58+
- meta_content_scope: source.js.stone
59+
- match: '(?<=\))'
60+
pop: true
61+
- include: 'scope:source.js'
62+
63+
- match: '(\s{0}|^)(\@)\b(break|continue|else|empty|endblock|endcomponent|endfor|endforeach|endforelse|endif|endmacro|endpush|endsection|endslot|endspaceless|endunless|endwhile|parent|setup|show|spaceless|super)\b'
64+
scope: custom.compiler.stone.js
65+
captures:
66+
0: punctuation.section.embedded.js
67+
2: keyword.control.flow.js
68+
3: keyword.control.flow.js
69+
pop: false
70+
71+
- match: '(\s{0}|^)(\@)\b([a-zA-Z_]+)\b(?=(|\s*|)\()'
72+
captures:
73+
0: support.function
74+
2: constant.other.inline-data.html
75+
push:
76+
- meta_scope: custom.compiler.stone.js
77+
- meta_content_scope: source.js.stone
78+
- match: '(?<=\))'
79+
pop: true
80+
- include: 'scope:source.js'
81+
82+
- match: '(\s{0}|^)(\@)\b([a-zA-Z_]+)\b(\s?)\b'
83+
scope: custom.compiler.stone.js
84+
captures:
85+
0: support.function
86+
2: constant.other.inline-data.html
87+
pop: false

test.stone

+116
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,116 @@
1+
{{-- Output Data --}}
2+
Hello, {{ name }}.
3+
The current UNIX timestamp is {{ Date.now() }}.
4+
5+
{{-- Outputting Data After Checking For Existence --}}
6+
{{ name || 'Default' }}
7+
8+
{{-- Displaying Raw Text With Curly Braces --}}
9+
@{{ This will 'not be processed' <strong>by Grind</strong> }}
10+
11+
{{-- Do not escape data --}}
12+
Hello, {!! name || '<i>Default</i>' !!}.
13+
14+
@include('header')
15+
16+
@include('footer')
17+
18+
@macro('a')
19+
@endmacro
20+
21+
{{-- Define Grind Layout --}}
22+
<html>
23+
<head>
24+
<title>
25+
@hasSection('title')
26+
@yield('title') - App Name
27+
@else
28+
App Name
29+
@endif
30+
</title>
31+
</head>
32+
<body>
33+
@section('sidebar')
34+
This is the master sidebar.
35+
@endsection
36+
37+
<div class="container">
38+
@yield('content')
39+
</div>
40+
</body>
41+
</html>
42+
43+
{{-- Use Grind Layout --}}
44+
@extends('layouts.master')
45+
46+
@section('sidebar')
47+
<p>This is appended to the master sidebar.</p>
48+
@endsection
49+
50+
@section('content')
51+
@super
52+
<p>This is my body content.</p>
53+
@endsection
54+
55+
{{-- yield section --}}
56+
@yield('section', 'Default Content')
57+
58+
{{-- If Statement --}}
59+
@if(records.length === 1)
60+
I have one record!
61+
@elseif(records.length > 1)
62+
I have multiple records!
63+
@else
64+
I don't have any records!
65+
@endif
66+
67+
@unless(Auth.check())
68+
You are not signed in.
69+
@endunless
70+
71+
{{-- Loops --}}
72+
@for(let i = 0; i < 10; i++)
73+
The current value is {{ i }}
74+
@endfor
75+
76+
@for(const user of users)
77+
<p>This is user {{ user.id }}</p>
78+
@endforeach
79+
80+
@forelse(const user of users)
81+
<li>{{ user.name }}</li>
82+
@empty
83+
<p>No users</p>
84+
@endforelse
85+
86+
@while(true)
87+
<p>I'm looping forever.</p>
88+
@endwhile
89+
90+
{{-- Include --}}
91+
@include('view.name')
92+
@include('view.name', { some: 'data' })
93+
94+
{{-- Overwriting Sections --}}
95+
@extends('list.item.container')
96+
97+
@section('list.item.content')
98+
<p>This is an item of type {{ item.type }}</p>
99+
@overwrite
100+
101+
{{-- This comment will not be in the rendered HTML --}}
102+
103+
{{--
104+
This comment will not be in the rendered HTML
105+
This comment will not be in the rendered HTML
106+
This comment will not be in the rendered HTML
107+
--}}
108+
109+
{{-- Stacks --}}
110+
@push('scripts')
111+
<script src="/example.js"></script>
112+
@endpush
113+
114+
<head>
115+
@stack('scripts')
116+
</head>

0 commit comments

Comments
 (0)