-
-
Notifications
You must be signed in to change notification settings - Fork 31
/
source.qmake.js
167 lines (165 loc) · 5.86 KB
/
source.qmake.js
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
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
// This is a TextMate grammar distributed by `starry-night`.
// This grammar is licensed permissive.
// See <https://github.com/wooorm/starry-night> for more info.
/**
* @import {Grammar} from '@wooorm/starry-night'
*/
/** @type {Grammar} */
const grammar = {
extensions: ['.pri'],
names: ['qmake'],
patterns: [
{
begin: '(TEMPLATE)\\s*(=)',
captures: {
1: {name: 'variable.language.qmake'},
2: {name: 'punctuation.separator.key-value.qmake'}
},
end: '$\\n?',
name: 'markup.other.template.qmake',
patterns: [
{
match: '\\b(app|lib|subdirs|vcapp|vclib)\\b',
name: 'keyword.other.qmake'
}
]
},
{
begin: '(CONFIG)\\s*(\\+|\\-)?(=)',
captures: {
1: {name: 'variable.language.qmake'},
3: {name: 'punctuation.separator.key-value.qmake'}
},
end: '$\\n?',
name: 'markup.other.config.qmake',
patterns: [
{
match:
'\\b(release|debug|warn_(on|off)|qt|opengl|thread|x11|windows|console|dll|staticlib|plugin|designer|uic3|no_lflags_merge|exceptions|rtti|stl|flat|app_bundle|no_batch|qtestlib|ppc|x86)\\b',
name: 'keyword.other.qmake'
}
]
},
{
begin: '(QT)\\s*(\\+|\\-)?(=)',
captures: {
1: {name: 'variable.language.qmake'},
3: {name: 'punctuation.separator.key-value.qmake'}
},
end: '$\\n?',
name: 'markup.other.qt.qmake',
patterns: [
{
match: '\\b(core|gui|network|opengl|sql|svg|xml|qt3support)\\b',
name: 'keyword.other.qmake'
}
]
},
{
match:
'\\b(R(C(C_DIR|_FILE)|E(S_FILE|QUIRES))|M(OC_DIR|AKE(_MAKEFILE|FILE(_GENERATOR)?))|S(RCMOC|OURCES|UBDIRS)|HEADERS|YACC(SOURCES|IMPLS|OBJECTS)|CONFIG|T(RANSLATIONS|ARGET(_(EXT|\\d+(\\.\\d+\\.\\d+)?))?)|INCLUDEPATH|OBJ(MOC|ECTS(_DIR)?)|D(SP_TEMPLATE|ISTFILES|E(STDIR(_TARGET)?|PENDPATH|F(_FILE|INES))|LLDESTDIR)|UI(C(IMPLS|OBJECTS)|_(SOURCES_DIR|HEADERS_DIR|DIR))|P(RE(COMPILED_HEADER|_TARGETDEPS)|OST_TARGETDEPS)|V(PATH|ER(SION|_(M(IN|AJ)|PAT)))|Q(MAKE(SPEC|_(RUN_C(XX(_IMP)?|C(_IMP)?)|MOC_SRC|C(XXFLAGS_(RELEASE|MT(_D(BG|LL(DBG)?))?|SHLIB|THREAD|DEBUG|WARN_O(N|FF))|FLAGS_(RELEASE|MT(_D(BG|LL(DBG)?))?|SHLIB|THREAD|DEBUG|WARN_O(N|FF))|LEAN)|TARGET|IN(CDIR(_(X|THREAD|OPENGL|QT))?|FO_PLIST)|UIC|P(RE_LINK|OST_LINK)|EXT(_(MOC|H|CPP|YACC|OBJ|UI|PRL|LEX)|ENSION_SHLIB)|Q(MAKE|T_DLL)|F(ILETAGS|AILED_REQUIREMENTS)|L(N_SHLIB|I(B(S(_(RT(MT)?|X|CONSOLE|THREAD|OPENGL(_QT)?|QT(_(OPENGL|DLL))?|WINDOWS))?|_FLAG|DIR(_(X|OPENGL|QT|FLAGS))?)|NK_SHLIB_CMD)|FLAGS(_(RELEASE|S(H(LIB|APP)|ONAME)|CONSOLE(_DLL)?|THREAD|DEBUG|PLUGIN|QT_DLL|WINDOWS(_DLL)?))?)|A(R_CMD|PP_(OR_DLL|FLAG))))?|T_THREAD)|FORMS|L(IBS|EX(SOURCES|IMPLS|OBJECTS)))\\b',
name: 'variable.language.qmake'
},
{
begin: '(\\b([\\w\\d_]+\\.[\\w\\d_]+|[A-Z_]+))?\\s*(\\+|\\-)?(=)',
captures: {
1: {name: 'variable.other.qmake'},
4: {name: 'punctuation.separator.key-value.qmake'}
},
end: '$\\n?',
name: 'markup.other.assignment.qmake',
patterns: [
{
captures: {1: {name: 'punctuation.definition.variable.qmake'}},
match:
'(\\$\\$)([A-Z_]+|[\\w\\d_]+\\.[\\w\\d_]+)|\\$\\([\\w\\d_]+\\)',
name: 'variable.other.qmake'
},
{
match: '[\\w\\d\\/_\\-\\.\\:]+',
name: 'constant.other.filename.qmake'
},
{
begin: '"',
beginCaptures: {
0: {name: 'punctuation.definition.string.begin.qmake'}
},
end: '"',
endCaptures: {0: {name: 'punctuation.definition.string.end.qmake'}},
name: 'string.quoted.double.qmake'
},
{
begin: '`',
beginCaptures: {
0: {name: 'punctuation.definition.string.begin.qmake'}
},
end: '`',
endCaptures: {0: {name: 'punctuation.definition.string.end.qmake'}},
name: 'string.interpolated.qmake'
},
{
begin: '(\\\\)',
captures: {1: {name: 'string.regexp.qmake'}},
end: '^[^#]',
name: 'markup.other.assignment.continuation.qmake',
patterns: [
{
captures: {1: {name: 'punctuation.definition.comment.qmake'}},
match: '(#).*$\\n?',
name: 'comment.line.number-sign.qmake'
}
]
},
{
begin: '(^[ \\t]+)?(?=#)',
beginCaptures: {
1: {name: 'punctuation.whitespace.comment.leading.qmake'}
},
end: '(?!\\G)',
patterns: [
{
begin: '#',
beginCaptures: {
0: {name: 'punctuation.definition.comment.qmake'}
},
end: '\\n',
name: 'comment.line.number-sign.qmake'
}
]
}
]
},
{
begin:
'\\b(basename|CONFIG|contains|count|dirname|error|exists|find|for|include|infile|isEmpty|join|member|message|prompt|quote|sprintf|system|unique|warning)\\s*(\\()',
beginCaptures: {
1: {name: 'entity.name.function.qmake'},
2: {name: 'punctuation.definition.parameters.qmake'}
},
contentName: 'variable.parameter.qmake',
end: '(\\))',
endCaptures: {1: {name: 'punctuation.definition.parameters.qmake'}}
},
{
match: '\\b(unix|win32|mac|debug|release)\\b',
name: 'keyword.other.scope.qmake'
},
{
begin: '(^[ \\t]+)?(?=#)',
beginCaptures: {
1: {name: 'punctuation.whitespace.comment.leading.qmake'}
},
end: '(?!\\G)',
patterns: [
{
begin: '#',
beginCaptures: {0: {name: 'punctuation.definition.comment.qmake'}},
end: '\\n',
name: 'comment.line.number-sign.qmake'
}
]
}
],
scopeName: 'source.qmake'
}
export default grammar