-
Notifications
You must be signed in to change notification settings - Fork 33
/
Copy pathCMake C Header.sublime-syntax
40 lines (40 loc) · 1.32 KB
/
CMake C Header.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
%YAML 1.2
---
# http://www.sublimetext.com/docs/3/syntax.html
name: CMake C Header
file_extensions: [h.in]
scope: source.cmake.config.c
variables:
identifier: '\b[[:alpha:]_][[:alnum:]_]*\b'
contexts:
main:
- match: ""
push: "Packages/C++/C.sublime-syntax"
with_prototype:
- match: \$\{
scope: keyword.other.block.start.cmake
push:
- meta_include_prototype: true
- meta_scope: variable.cmake
- match: \}
scope: keyword.other.block.end.cmake
pop: true
- match: \@
scope: keyword.other.block.start.cmake
push:
- meta_include_prototype: true
- meta_scope: variable.cmake
- match: \@
scope: keyword.other.block.end.cmake
pop: true
- match: ^\s*(\#\s*cmakedefine)\b
captures:
1: meta.preprocessor.macro.c keyword.control.import.cmakedefine.c
push:
- meta_content_scope: meta.preprocessor.macro.c
- include: scope:source.c#preprocessor-line-continuation
- include: scope:source.c#preprocessor-line-ending
- include: scope:source.c#preprocessor-comments
- match: '{{identifier}}'
scope: entity.name.variable.cmake
pop: true