Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

enh(sqf) improve function name highlighting (slightly broader) #3181

Merged
merged 8 commits into from
May 10, 2021
1 change: 1 addition & 0 deletions CHANGES.md
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,7 @@ Grammars:
- enh(nginx) improving highlighting of some sections [Josh Goebel][]
- fix(vim) variable names may not be zero length [Josh Goebel][]
- enh(sqf) Updated keywords to Arma 3 v2.02 (#3084) [R3voA3][]
- enh(sqf) Refactored function regex to match CBA component func naming scheme (#3181) [JonBons][]
JonBons marked this conversation as resolved.
Show resolved Hide resolved
- enh(nim) highlight types properly (not as built-ins) [Josh Goebel][]
- (chore) throttle deprecation messages (#3092) [Mihkel Eidast][]
- enh(c) Update keyword list for C11/C18 (#3010) [Josh Goebel][]
Expand Down
2 changes: 1 addition & 1 deletion src/languages/sqf.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ export default function(hljs) {
// https://community.bistudio.com/wiki/Functions_Library_(Arma_3)#Adding_a_Function
const FUNCTION = {
className: 'title',
begin: /[a-zA-Z][a-zA-Z0-9]+_fnc_\w*/
begin: /[a-zA-Z]\w+_fnc_\w+/
};

// In SQF strings, quotes matching the start are escaped by adding a consecutive.
Expand Down
1 change: 1 addition & 0 deletions test/detect/sqf/default.txt
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,5 @@ _unit addAction ["Eat Energy Bar", {
// 4 - means something...
Z_obj_vip = nil;
[_boat, ["Black", 1], true] call BIS_fnc_initVehicle;
[_boat] call myTag_component_fnc_initVehicle;
}];
1 change: 1 addition & 0 deletions test/markup/sqf/default.expect.txt
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,5 @@
<span class="hljs-comment">// 4 - means something...</span>
Z_obj_vip = <span class="hljs-literal">nil</span>;
[<span class="hljs-variable">_boat</span>, [<span class="hljs-string">&quot;Black&quot;</span>, <span class="hljs-number">1</span>], <span class="hljs-literal">true</span>] <span class="hljs-built_in">call</span> <span class="hljs-title">BIS_fnc_initVehicle</span>;
[<span class="hljs-variable">_boat</span>] <span class="hljs-built_in">call</span> <span class="hljs-title">myTag_component_fnc_initVehicle</span>;
}];
1 change: 1 addition & 0 deletions test/markup/sqf/default.txt
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,5 @@ _unit addAction ["Eat Energy Bar", {
// 4 - means something...
Z_obj_vip = nil;
[_boat, ["Black", 1], true] call BIS_fnc_initVehicle;
[_boat] call myTag_component_fnc_initVehicle;
}];