-
Notifications
You must be signed in to change notification settings - Fork 0
/
samb.sublime-syntax
67 lines (57 loc) · 2.05 KB
/
samb.sublime-syntax
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
%YAML 1.2
---
# http://www.sublimetext.com/docs/3/syntax.html
name: SAMB
file_extensions:
- se
scope: source.se
contexts:
main:
- match: \{
push: brackets
- match: \}
scope: invalid.illegal.stray-bracket-end
# Strings begin and end with quotes, and use backslashes as an escape
# character
- match: '"'
scope: punctuation.definition.string.begin.example-c
push: double_quoted_string
# Comments begin with a '//' and finish at the end of the line
- match: '#'
scope: punctuation.definition.comment.example-c
push: line_comment
# Keywords are if, else for and while.
# Note that blackslashes don't need to be escaped within single quoted
# strings in YAML. When using single quoted strings, only single quotes
# need to be escaped: this is done by using two single quotes next to each
# other.
- match: '\b(server|require|import|include|package|author|routes|templates)\b'
scope: support.class.example-c
- match: '\b(bool|byte|complex(64|128)|error|float(32|64)|rune|string|u?int(8|16|32|64)?|uintptr)\b'
scope : storage.type.example-c
- match: '\b(GET|POST|PUT|DELETE|PATCH|global|go|server|provider|package|routes|templates|start|shutdown|recover|init|route|template)\b'
scope: entity.name.interface.example-c
- match: '\b(\w+)\b(?=\()'
scope: support.function.example-c
- match: '\b(do|host|port|host|port|name|method|path|handler|provide|type|return|author)\b'
scope: variable.language.example-c
# Numbers
- match: '\b(-)?[0-9.]+\b'
scope: constant.numeric.example-c
- match: '\b(nil|false|true)\b'
scope: constant.language.example-c
brackets:
- match: \}
pop: true
- include: main
double_quoted_string:
- meta_scope: string.quoted.double.example-c
- match: '\\.'
scope: constant.character.escape.example-c
- match: '"'
scope: punctuation.definition.string.end.example-c
pop: true
line_comment:
- meta_scope: comment.line.example-c
- match: $
pop: true