-
-
Notifications
You must be signed in to change notification settings - Fork 34
Expand file tree
/
Copy pathsource.sqf.js
More file actions
91 lines (89 loc) · 3.58 KB
/
source.sqf.js
File metadata and controls
91 lines (89 loc) · 3.58 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
// This is a TextMate grammar distributed by `starry-night`.
// This grammar is developed at
// <https://github.com/JonBons/Sublime-SQF-Language>
// and licensed `apache-2.0`.
// See <https://github.com/wooorm/starry-night> for more info.
/**
* @import {Grammar} from '@wooorm/starry-night'
*/
/** @type {Grammar} */
const grammar = {
extensions: ['.sqf', '.hqf'],
names: ['sqf'],
patterns: [
{match: '\\#ifdef|\\#ifndef|\\#else|\\#endif', name: 'keyword.other.sqf'},
{match: '\\#include', name: 'keyword.control.import.sqf'},
{match: 'private|\\#define|\\#undef', name: 'keyword.declaration.sqf'},
{
match:
'\\b(?i:_exception|_foreachindex|_this|_thisfsm|_thislist|_thisscript|_x)\\b',
name: 'variable.language.sqf'
},
{
match:
'\\b(?i:__eval|__exec|__file__|__line__|blufor|civilian|confignull|controlnull|displaynull|east|endl|false|grpnull|independent|linebreak|locationnull|nil|objnull|opfor|pi|resistance|scriptnull|sideambientlife|sideempty|sidelogic|sideunknown|tasknull|teammembernull|true|west)\\b|\\:|\\!|&&|\\|\\||>>',
name: 'constant.language.sqf'
},
{
match:
'\\b(?i:and|break|breakout|breakto|breakwith|call|case|catch|continue|continuewith|default|do|else|execfsm|execvm|exitwith|for|foreach|foreachmember|foreachmemberagent|foreachmemberteam|from|if|not|or|preprocessfile|preprocessfilelinenumbers|scopename|spawn|step|switch|then|throw|to|try|while|with)\\b|\\:|\\!|&&|\\|\\||>>',
name: 'keyword.control.sqf'
},
{
match:
'\\b(?i:abs|acctime|acos|asin|atan|atan2|behaviour|boundingbox|boundingcenter|breakout|breakto|call|ceil|combatmode|cos|count|deleteat|diag_log|exp|floor|format|group|isnull|ln|log|max|min|objnull|player|random|round|select|sin|sqrt|str|tan|typename|vectordir|vectorup|vehicle)\\b',
name: 'support.function.sqf'
},
{match: '\\b(?i:isequalto|isequaltype)\\b', name: 'support.function.sqf'},
{name: 'support.function.sqf'},
{
match:
'\\b0x[a-fA-F\\d]+|\\b\\d+(\\.\\d+)?([eE]-?\\d+)?|\\.\\d+([eE]-?\\d+)?',
name: 'constant.numeric.sqf'
},
{
match: '<\\=|>\\=|\\=\\=|<|>|\\!\\=',
name: 'keyword.operator.comparison.sqf'
},
{
begin: '//',
beginCaptures: {0: {name: 'punctuation.definition.comment.sqf'}},
end: '$\\n?',
name: 'comment.line.sqf'
},
{
begin: '/\\*',
captures: {0: {name: 'punctuation.definition.comment.sqf'}},
end: '\\*/',
name: 'comment.block.sqf'
},
{match: '\\+|\\-|\\*|\\/|%|\\^', name: 'keyword.operator.arithmetic.sqf'},
{match: '\\=', name: 'keyword.operator.assignment.sqf'},
{
begin: '"',
beginCaptures: {0: {name: 'punctuation.definition.string.begin.sqf'}},
end: '"',
endCaptures: {0: {name: 'punctuation.definition.string.end.sqf'}},
name: 'string.quoted.double.sqf'
},
{
begin: "'",
beginCaptures: {0: {name: 'punctuation.definition.string.begin.sqf'}},
end: "'",
endCaptures: {0: {name: 'punctuation.definition.string.end.sqf'}},
name: 'string.quoted.sqf'
},
{
begin: '@"',
beginCaptures: {0: {name: 'punctuation.definition.string.begin.sqf'}},
end: '"@',
endCaptures: {0: {name: 'punctuation.definition.string.end.sqf'}},
name: 'string.quoted.region.sqf'
},
{match: '\\b_[a-zA-Z_][a-zA-Z0-9_]*', name: 'variable.other.sqf'},
{match: '[a-zA-Z]\\w+_fnc_\\w+', name: 'variable.function.sqf'},
{match: '\\b__[a-zA-Z_][a-zA-Z0-9_]*', name: 'constant.other.sqf'}
],
scopeName: 'source.sqf'
}
export default grammar