-
Notifications
You must be signed in to change notification settings - Fork 1
/
FlexLex.YAML-tmLanguage
56 lines (48 loc) · 1.27 KB
/
FlexLex.YAML-tmLanguage
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
# [PackageDev] target_format: plist, ext: tmLanguage
#
# GNU Flex/Lex syntax highlighting grammer for Sublime Text.
#
---
name: Flex/Lex
scopeName: source.flexlex
fileTypes: [l]
uuid: 3b745f3d-ae63-4d44-8779-eeb786911228
patterns:
- comment: flex verbatim code
begin: ^/\*\* BEGIN CPP_SOURCECODE \*\*/
end: ^/\*\* END CPP_SOURCECODE \*\*/
patterns:
- include: source.c++
- comment: flex verbatim code
begin: ^/\*\* BEGIN C_SOURCECODE \*\*/
end: ^/\*\* END C_SOURCECODE \*\*/
patterns:
- include: source.c
- comment: flex verbatim code
begin: ^%\{
end: ^%\}
patterns:
- include: source.c++
- comment: c style comments
begin: /\*
end: \*/
name: comment.block.flexlex
- comment: flex directive
name: keyword.other.flexlex
match: ^\%\s*[a-zA-Z][^\s]+
- comment: flex rules section
begin: ^%%
end: ^%%
patterns:
- comment: flex rule pattern
match: ^(\{([^\}]+)\}|\[[^\]]+?\]|[^\s]+)+\s*(.+)$
captures:
'1': {name: keyword.other.flexlex}
'2': {name: constant.numeric.flexlex}
# '3': {include: source.c++} # this doesn't work unfortunately
- comment: flex definitions section
name: keyword.other.flexlex
match: ^([A-Z][^\s]+)\s+(.+)\s*$
captures:
'1': {name: constant.numeric.flexlex}
'2': {name: keyword.other.flexlex}