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

Added SQF language #2079

Merged
merged 12 commits into from
Oct 16, 2019
2 changes: 1 addition & 1 deletion components.js

Large diffs are not rendered by default.

5 changes: 5 additions & 0 deletions components.json
Original file line number Diff line number Diff line change
Expand Up @@ -893,6 +893,11 @@
"title": "Splunk SPL",
"owner": "RunDevelopment"
},
"sqf": {
"title": "SQF: Status Quo Function (Arma 3)",
"require": "clike",
"owner": "RunDevelopment"
},
"sql": {
"title": "SQL",
"owner": "multipetros"
Expand Down
33 changes: 33 additions & 0 deletions components/prism-sqf.js

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions components/prism-sqf.min.js

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions plugins/autoloader/prism-autoloader.js
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,7 @@
"solidity": "clike",
"soy": "markup-templating",
"sparql": "turtle",
"sqf": "clike",
"swift": "clike",
"tap": "yaml",
"textile": "markup",
Expand Down
2 changes: 1 addition & 1 deletion plugins/autoloader/prism-autoloader.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions plugins/show-language/prism-show-language.js
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,7 @@
"sparql": "SPARQL",
"rq": "SPARQL",
"splunk-spl": "Splunk SPL",
"sqf": "SQF: Status Quo Function (Arma 3)",
"sql": "SQL",
"tap": "TAP",
"toml": "TOML",
Expand Down
2 changes: 1 addition & 1 deletion plugins/show-language/prism-show-language.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

13 changes: 13 additions & 0 deletions tests/languages/sqf/boolean_feature.test
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
true
false

----------------------------------------------------

[
["boolean", "true"],
["boolean", "false"]
]

----------------------------------------------------

Checks for booleans.
15 changes: 15 additions & 0 deletions tests/languages/sqf/comment_feature.test
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
// comment
/*
comment
*/

----------------------------------------------------

[
["comment", "// comment"],
["comment", "/*\r\n comment\r\n */"]
]

----------------------------------------------------

Checks for comments.
51 changes: 51 additions & 0 deletions tests/languages/sqf/keyword_feature.test
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
call
case
catch
default
do
echo
else
endsWith
for
forEach
from
goto
if
nil
private
step
switch
then
to
try
while

----------------------------------------------------

[
["keyword", "call"],
["keyword", "case"],
["keyword", "catch"],
["keyword", "default"],
["keyword", "do"],
["keyword", "echo"],
["keyword", "else"],
["keyword", "endsWith"],
["keyword", "for"],
["keyword", "forEach"],
["keyword", "from"],
["keyword", "goto"],
["keyword", "if"],
["keyword", "nil"],
["keyword", "private"],
["keyword", "step"],
["keyword", "switch"],
["keyword", "then"],
["keyword", "to"],
["keyword", "try"],
["keyword", "while"]
]

----------------------------------------------------

Checks for keywords.
65 changes: 65 additions & 0 deletions tests/languages/sqf/macro_feature.test
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
#define FOO 3
#define HINTARG(ARG) hint ("Passed argument: " + str ARG)
#define DRAWBUTTON(NAME)\
__EXEC(idcNav = idcNav + 4)

#undef NAME

#ifdef NAME
#ifndef NAME
#else
#endif

#include "file.hpp"
#include <file.txt> // Brackets are equivalent to quotation marks and may be used in their place.

----------------------------------------------------

[
["macro", [
["directive", "#define"],
" FOO 3"
]],
["macro", [
["directive", "#define"],
" HINTARG(ARG) hint (\"Passed argument: \" + str ARG)"
]],
["macro", [
["directive", "#define"],
" DRAWBUTTON(NAME)\\\r\n\t__EXEC(idcNav = idcNav + 4)"
]],

["macro", [
["directive", "#undef"],
" NAME"
]],

["macro", [
["directive", "#ifdef"],
" NAME"
]],
["macro", [
["directive", "#ifndef"],
" NAME"
]],
["macro", [
["directive", "#else"]
]],
["macro", [
["directive", "#endif"]
]],

["macro", [
["directive", "#include"],
" \"file.hpp\""
]],
["macro", [
["directive", "#include"],
" <file.txt> ",
["comment", "// Brackets are equivalent to quotation marks and may be used in their place."]
]]
]

----------------------------------------------------

Checks for macros.
35 changes: 35 additions & 0 deletions tests/languages/sqf/magic-variable_feature.test
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
_exception
_fnc_scriptName
_fnc_scriptNameParent
_forEachIndex
_this
_thisEventHandler
_thisFSM
_thisScript
_time
RunDevelopment marked this conversation as resolved.
Show resolved Hide resolved
_x
this
thisList
thisTrigger

----------------------------------------------------

[
["magic-variable", "_exception"],
["magic-variable", "_fnc_scriptName"],
["magic-variable", "_fnc_scriptNameParent"],
["magic-variable", "_forEachIndex"],
["magic-variable", "_this"],
["magic-variable", "_thisEventHandler"],
["magic-variable", "_thisFSM"],
["magic-variable", "_thisScript"],
["magic-variable", "_time"],
["magic-variable", "_x"],
["magic-variable", "this"],
["magic-variable", "thisList"],
["magic-variable", "thisTrigger"]
]

----------------------------------------------------

Checks for magic variables.
35 changes: 35 additions & 0 deletions tests/languages/sqf/number_feature.test
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
5.197
0.47
16.0
.8314
12345

1.23E4
5e-2

0xa5
$5C
$FFFFFF
0x123ABC

----------------------------------------------------

[
["number", "5.197"],
["number", "0.47"],
["number", "16.0"],
["number", ".8314"],
["number", "12345"],

["number", "1.23E4"],
["number", "5e-2"],

["number", "0xa5"],
["number", "$5C"],
["number", "$FFFFFF"],
["number", "0x123ABC"]
]

----------------------------------------------------

Checks for numbers.
47 changes: 47 additions & 0 deletions tests/languages/sqf/operator_feature.test
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
+ - * / % ^ #

!= == >= <= > <

! && ||
=

>> ##

mod
and or not

----------------------------------------------------

[
["operator", "+"],
["operator", "-"],
["operator", "*"],
["operator", "/"],
["operator", "%"],
["operator", "^"],
["operator", "#"],

["operator", "!="],
["operator", "=="],
["operator", ">="],
["operator", "<="],
["operator", ">"],
["operator", "<"],

["operator", "!"],
["operator", "&&"],
["operator", "||"],
["operator", "="],

["operator", ">>"],
["operator", "##"],

["operator", "mod"],
["operator", "and"],
["operator", "or"],
["operator", "not"]
]

----------------------------------------------------

Checks for operators.
Loading