-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathparser.sublime-syntax
More file actions
101 lines (79 loc) · 2.13 KB
/
parser.sublime-syntax
File metadata and controls
101 lines (79 loc) · 2.13 KB
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
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
%YAML1.2
---
# See http://www.sublimetext.com/docs/3/syntax.html
name: Parser
file_extensions: [p, pp, bp, html]
scope: source.parser
contexts:
main:
# Comments
- match: '^(#).*'
scope: punctuation.definition.comment.parser
push: line_comment
- match: '\^rem{'
# scope: punctuation.definition.comment.parser
push: block_comment
# SQL
# Here to avoid func
- match: '(?i)(\^.*\.sql\.(table|int|void|string|hash)){'
scope: meta.sql
captures:
1: support.function
push: "Packages/SQL/SQL.sublime-syntax"
with_prototype:
- match: '(?=})'
pop: true
- match: '(?i)(.*)(:{1,2}sql)\{'
scope: meta.sql
captures:
2: variable.other
push: "Packages/SQL/SQL.sublime-syntax"
with_prototype:
- match: '(?=})'
pop: true
- match: '(.*)(\$sql\[)'
captures:
2: variable.other
push: "Packages/SQL/SQL.sublime-syntax"
with_prototype:
- match: '(?=])'
pop: true
# Types
- match: '\d|\btrue\b|\bfalse\b'
scope: constant.numeric
- match: '(?:\[)([^;^$\]]+)(?:\])'
scope: string
- match: '^(@CLASS|@USE|@BASE|@PARTIAL)'
scope: entity.name.class
# Keywords
- match: '\^(if|for|eval|process|while|s(witch|leep)|c(a(se|che)|on(nect|tinue))|t(aint|hrow|ry)|u(ntaint|se)|apply-taint|break)\b'
scope: keyword.control
# Functions
- match: '^(@[-_\w\d]+)(\[.*\])$'
captures:
1: entity.name.function
2: punctuation.definition.parameters
- match: '\^(?:[\w]+(?:\.|:|::)){0,}(?:[\w]+)'
scope: support.function
# other
- match: '\(|\)'
scope: meta.group.braces.round
- match: '\$(?:[.{]{0,1})(?:[\w:]+\.){0,}(?:[\w:}-]+)'
scope: variable
# other contexts
line_comment:
- meta_scope: comment.line.parser
- match: $
pop: true
block_comment:
- meta_scope: comment.block.parser
- match: '}'
pop: true
- match: '{'
push: block_code
block_code:
- meta_scope: block.parser
- match: '}'
pop: true
- match: '{'
push: block_code