Skip to content

1.3.1-RC1

Compare
Choose a tag to compare
@X39 X39 released this 24 Apr 09:58
· 840 commits to master since this release
Changelog
  • CLI: Added --disable-macro-warnings to disable #undef and #define warnings.
  • CLI: Added --disable-runtime-warnings to disable runtime warnings
  • VM: Added nular time operator
  • VM: Added default defines _SQF_VM, _SQF_VM_MAJOR, _SQF_VM_MINOR, _SQF_VM_REVISION
  • VM: Added callstack__ command that returns the whole callstack in an array.
  • VM: Added additional warning messages to all callstacks
  • VM: Added allFiles__ [STRING] command that allows to receive all files in current paths
  • VM: Added pwd__ command that returns current file
  • VM: Added currentDirectory__ command that returns current file's directory
  • VM: Added trim__ STRING command
  • VM: Added exit__ SCALAR command to allow for exit codes in VM scripts
  • VM: Added try CODE command
  • VM: Added EXCEPTION catch CODE command
  • VM: Added throw ANY command
  • VM: Added functionality to stringify code
  • VM: Fixed duplicate defines did not error
  • VM: Fixed isNil STRING only checking local variables scope (global variables have been ignored)
  • VM: Fixed default function parameters not working when accepted type list is provided (params)
  • VM: Fixed crash on [1] select true
  • VM: Fixed [1, 2, 3] select 1.6 would get floored instead of rounded
  • VM: Fixed "12345" select [0.6, 3] would get floored instead of rounded
  • VM: Fixed [1, 2, 3, 4, 5] select [0] would return everything instead of nothing
  • VM: Fixed ARRAY select ARRAY would floor numbers instead of rounding
  • VM: Fixed wrong return value for ARRAY select ARRAY on eg. [] select [10, 10]
  • VM: Fixed preprocessFile* commands lacked file information when compiled
  • VM: Fixed 1 / 0 would not raise a warning message
  • VM: Fixed ARRAY deleteAt SCALAR would not return deleted value
  • VM: #undef with a non-defined macro no longer errors (now a warning instead)
  • VM #define when another with the same name already existed no longer errors (now a warning instead)
  • VM: CODE except__ CODE now also has a _callstack variable that contains the callstack
  • VM: Changed how callstacks (scopes) work in SQF-VM internally
  • VM: Tabs now will be replaced by spaces in error messages
  • VM: Rewrote macro expander (PreProcessor)
Help Output
.\sqfvm.exe --help

USAGE:

   C:\@X39\vm\RelWithDebInfo\sqfvm.exe  [-h] [--version] [--] [--cli-file
                                        <PATH>] [-i <PATH>] ...
                                        [--input-sqf <PATH>] ...
                                        [--input-config <PATH>] ...
                                        [--input-pbo <PATH>] ...  [--sqf
                                        <CODE>] ...  [--config <CODE>] ...
                                        [--pretty-print <PATH>] ...  [-E
                                        <PATH>] ...  [--command-dummy-nular
                                        <NAME>] ...  [--command-dummy-unary
                                        <NAME>] ...
                                        [--command-dummy-binary <PRECEDENCE
                                        |NAME>] ...  [-a] [-d <PORT>] [-m
                                        <NUMBER>] [-c]
                                        [--disable-macro-warnings]
                                        [--disable-runtime-warnings] [-l
                                        <PATH>] ...  [-v <PATH|VIRTUAL>]
                                        ...  [--verbose] [--parse-only]
                                        [--no-work-print]
                                        [--no-execute-print]
                                        [--no-load-execdir]
                                        [--no-assembly-creation]


Where:

   -h,  --help
     Displays usage information and exits.

   --version
     Displays version information and exits.

   --,  --ignore_rest
     Ignores the rest of the labeled arguments following this flag.

   --cli-file <PATH>
     Allows to provide a file from which to load arguments from. If passed,
     all other arguments will be ignored! Each argument needs to be
     separated by line-feed. Supports absolut and relative pathing using
     '.\path\to\file' or 'C:\path\to\file'.

   -i <PATH>,  --input <PATH>  (accepted multiple times)
     Loads provided file from disk. File-Type is determined using default
     file extensions (sqf, cpp, hpp, pbo). Supports absolut and relative
     pathing using '.\path\to\file' or 'C:\path\to\file'.!BE AWARE! This is
     case-sensitive!

   --input-sqf <PATH>  (accepted multiple times)
     Loads provided SQF file from disk. Will be executed before files,
     added using '--input'. Supports absolut and relative pathing using
     '.\path\to\file' or 'C:\path\to\file'.!BE AWARE! This is
     case-sensitive!

   --input-config <PATH>  (accepted multiple times)
     Loads provided config file from disk. Will be parsed before files,
     added using '--input'. Supports absolut and relative pathing using
     '.\path\to\file' or 'C:\path\to\file'.!BE AWARE! This is
     case-sensitive!

   --input-pbo <PATH>  (accepted multiple times)
     Loads provided PBO file from disk. Will be parsed before files, added
     using '--input'. Supports absolut and relative pathing using
     '.\path\to\file' or 'C:\path\to\file'.!BE AWARE! This is
     case-sensitive!

   --sqf <CODE>  (accepted multiple times)
     Loads provided sqf-code directly into the VM. Input is not getting
     preprocessed!

   --config <CODE>  (accepted multiple times)
     Loads provided config-code directly into the VM. Input is not getting
     preprocessed!

   --pretty-print <PATH>  (accepted multiple times)
     Loads provided file from disk and pretty-prints it onto console.!BE
     AWARE! This is case-sensitive!

   -E <PATH>,  --preprocess-file <PATH>  (accepted multiple times)
     Runs the preprocessor on provided file and prints it to stdout.
     Supports absolut and relative pathing using '.\path\to\file' or
     'C:\path\to\file'.!BE AWARE! This is case-sensitive!

   --command-dummy-nular <NAME>  (accepted multiple times)
     Adds the provided command as dummy.

   --command-dummy-unary <NAME>  (accepted multiple times)
     Adds the provided command as dummy.

   --command-dummy-binary <PRECEDENCE|NAME>  (accepted multiple times)
     Adds the provided command as dummy. Note that you need to also provide
     a precedence. Example: 4|commandname

   -a,  --automated
     Disables all possible prompts.

   -d <PORT>,  --debugger <PORT>
     Causes the sqf-vm to start a network server that allows to attach a
     single debugger to it.

   -m <NUMBER>,  --max-instructions <NUMBER>
     Sets the maximum ammount of instructions to execute before a hard exit
     may occur. Setting this to 0 will disable the limit.

   -c,  --check-classnames
     Enables the config checking for eg. createVehicle.

   --disable-macro-warnings
     Disables the warning for duplicate defines and undefines without a
     corresponding define.


   --disable-runtime-warnings
     Disables the runtime warning messages raised by SQF-VM.


   -l <PATH>,  --load <PATH>  (accepted multiple times)
     Adds provided path to the allowed locations list. Supports absolut and
     relative pathing using '.\path\to\file' or 'C:\path\to\file'.

     An allowed location, is a location SQF-VM will be allowed to load
     files from.If you try to load a file from a given directory that is
     not in the allowed list,the file loading WILL fail.Only the root path
     of a given folder needs to be added, sub-folders are accessible
     automatically.!BE AWARE! This is case-sensitive!

   -v <PATH|VIRTUAL>,  --virtual <PATH|VIRTUAL>  (accepted multiple times)
     Creates a mapping for a virtual and a physical path.Mapping is
     separated by a '|', with the left side being the physical, and the
     right argument the virtual path. Supports absolut and relative pathing
     using '.\path\to\file' or 'C:\path\to\file'.

   --verbose
     Enables additional output.

   --parse-only
     Disables all code execution entirely and performs only the parsing &
     assembly generation tasks. Note that this also will prevent the
     debugger to start. To disable assembly generation too, refer to
     --no-assembly-creation.

   --no-work-print
     Disables the printing of all values which are on the work stack.

   --no-execute-print
     Disables the `Executing...` and two horizontal lines hint printing.

   --no-load-execdir
     Prevents automatically adding the workspace to the path of allowed
     locations.

   --no-assembly-creation
     Will force to use only the SQF parser. Execution of SQF-code will not
     work with this. Useful, if one only wants to perform syntax checks.


   Emulates the ArmA-Series SQF environment.
Supported Commands
[
    ["n","parsingnamespace"],
    ["n","pi"],
    ["n","sidelogic"],
    ["n","nil"],
    ["n","sideunknown"],
    ["n","east"],
    ["n","missionnamespace"],
    ["n","uinamespace"],
    ["n","profilenamespace"],
    ["n","resistance"],
    ["n","player"],
    ["n","productversion"],
    ["n","exit__"],
    ["n","cansuspend"],
    ["n","allunits"],
    ["n","diag_ticktime"],
    ["n","halt"],
    ["n","cmds__"],
    ["n","cmdsimplemented__"],
    ["n","allobjects__"],
    ["n","vm__"],
    ["n","respawn__"],
    ["n","grpnull"],
    ["n","callstack__"],
    ["n","pwd__"],
    ["n","currentdirectory__"],
    ["n","true"],
    ["n","false"],
    ["n","confignull"],
    ["n","configfile"],
    ["n","blufor"],
    ["n","allmapmarkers"],
    ["n","west"],
    ["n","opfor"],
    ["n","independent"],
    ["n","civilian"],
    ["n","sideempty"],
    ["n","sideenemy"],
    ["n","sidefriendly"],
    ["n","objnull"],
    ["u","abs","SCALAR"],
    ["u","throw","ANY"],
    ["u","sqrt","SCALAR"],
    ["u","preprocessfilelinenumbers","STRING"],
    ["u","deg","SCALAR"],
    ["u","acos","SCALAR"],
    ["u","switch","ANY"],
    ["u","selectmax","ARRAY"],
    ["u","log","SCALAR"],
    ["u","sin","SCALAR"],
    ["u","-","SCALAR"],
    ["u","tan","SCALAR"],
    ["u","rad","SCALAR"],
    ["u","sleep","SCALAR"],
    ["u","ceil","SCALAR"],
    ["u","exp","SCALAR"],
    ["u","random","SCALAR"],
    ["u","systemchat","STRING"],
    ["u","+","SCALAR"],
    ["u","+","NaN"],
    ["u","+","ARRAY"],
    ["u","!","BOOL"],
    ["u","atg","SCALAR"],
    ["u","floor","SCALAR"],
    ["u","asin","SCALAR"],
    ["u","if","BOOL"],
    ["u","selectmin","ARRAY"],
    ["u","ln","SCALAR"],
    ["u","nearestobjects","ARRAY"],
    ["u","atan","SCALAR"],
    ["u","cos","SCALAR"],
    ["u","assert","BOOL"],
    ["u","deletemarkerlocal","STRING"],
    ["u","round","SCALAR"],
    ["u","private","STRING"],
    ["u","private","ARRAY"],
    ["u","vectormagnitude","ARRAY"],
    ["u","velocity","OBJECT"],
    ["u","param","ARRAY"],
    ["u","vectormagnitudesqr","ARRAY"],
    ["u","vectornormalized","ARRAY"],
    ["u","default","CODE"],
    ["u","side","GROUP"],
    ["u","side","OBJECT"],
    ["u","comment","STRING"],
    ["u","tofixed","SCALAR"],
    ["u","allvariables","NAMESPACE"],
    ["u","allvariables","OBJECT"],
    ["u","allvariables","GROUP"],
    ["u","call","CODE"],
    ["u","with","NAMESPACE"],
    ["u","count","ARRAY"],
    ["u","count","STRING"],
    ["u","count","CONFIG"],
    ["u","compile","STRING"],
    ["u","try","CODE"],
    ["u","typename","ANY"],
    ["u","while","CODE"],
    ["u","gettext","CONFIG"],
    ["u","prettyprintsqf__","STRING"],
    ["u","str","ANY"],
    ["u","for","STRING"],
    ["u","selectrandom","ARRAY"],
    ["u","reverse","ARRAY"],
    ["u","isnil","STRING"],
    ["u","isnil","CODE"],
    ["u","hint","STRING"],
    ["u","hint","TEXT"],
    ["u","scriptname","STRING"],
    ["u","case","ANY"],
    ["u","scriptdone","SCRIPT"],
    ["u","tree__","STRING"],
    ["u","params","ARRAY"],
    ["u","createmarker","ARRAY"],
    ["u","preprocessfile","STRING"],
    ["u","preprocessfile","STRING"],
    ["u","exit__","SCALAR"],
    ["u","diag_log","ANY"],
    ["u","deletemarker","STRING"],
    ["u","configparse__","STRING"],
    ["u","damage","OBJECT"],
    ["u","help__","STRING"],
    ["u","preprocess__","STRING"],
    ["u","assembly__","CODE"],
    ["u","allfiles__","ARRAY"],
    ["u","trim__","STRING"],
    ["u","tolower","STRING"],
    ["u","toupper","STRING"],
    ["u","format","ARRAY"],
    ["u","toarray","STRING"],
    ["u","commander","OBJECT"],
    ["u","tostring","ARRAY"],
    ["u","configname","CONFIG"],
    ["u","confighierarchy","CONFIG"],
    ["u","inheritsfrom","CONFIG"],
    ["u","isnumber","CONFIG"],
    ["u","istext","CONFIG"],
    ["u","isclass","CONFIG"],
    ["u","vehicle","OBJECT"],
    ["u","markerdir","STRING"],
    ["u","isarray","CONFIG"],
    ["u","getnumber","CONFIG"],
    ["u","getarray","CONFIG"],
    ["u","isnull","CONFIG"],
    ["u","isnull","GROUP"],
    ["u","isnull","OBJECT"],
    ["u","configproperties","ARRAY"],
    ["u","creategroup","SIDE"],
    ["u","groupid","GROUP"],
    ["u","units","GROUP"],
    ["u","units","OBJECT"],
    ["u","deletegroup","GROUP"],
    ["u","typeof","OBJECT"],
    ["u","createvehicle","ARRAY"],
    ["u","alive","OBJECT"],
    ["u","deletevehicle","OBJECT"],
    ["u","position","OBJECT"],
    ["u","getpos","OBJECT"],
    ["u","getdammage","OBJECT"],
    ["u","crew","OBJECT"],
    ["u","objectparent","OBJECT"],
    ["u","driver","OBJECT"],
    ["u","gunner","OBJECT"],
    ["u","getmarkertype","STRING"],
    ["u","markertype","STRING"],
    ["u","getmarkersize","STRING"],
    ["u","markersize","STRING"],
    ["u","getmarkercolor","STRING"],
    ["u","markercolor","STRING"],
    ["u","getmarkerpos","STRING"],
    ["u","markerpos","STRING"],
    ["u","markerbrush","STRING"],
    ["u","markertext","STRING"],
    ["u","markershape","STRING"],
    ["u","markeralpha","STRING"],
    ["u","createmarkerlocal","ARRAY"],
    ["b","SCALAR","atan2","SCALAR"],
    ["b","SCALAR","min","SCALAR"],
    ["b","OBJECT","domove","ARRAY"],
    ["b","ARRAY","domove","ARRAY"],
    ["b","ARRAY","vectorcrossproduct","ARRAY"],
    ["b","SCALAR","^","SCALAR"],
    ["b","CODE","foreach","ARRAY"],
    ["b","ARRAY","vectordiff","ARRAY"],
    ["b","SCALAR","max","SCALAR"],
    ["b","ARRAY","vectoradd","ARRAY"],
    ["b","ARRAY","set","ARRAY"],
    ["b","SCALAR","mod","SCALAR"],
    ["b","ANY","spawn","CODE"],
    ["b","SCALAR","-","SCALAR"],
    ["b","ARRAY","-","ARRAY"],
    ["b","SCALAR","%","SCALAR"],
    ["b","SCALAR","+","SCALAR"],
    ["b","ARRAY","+","ARRAY"],
    ["b","STRING","+","STRING"],
    ["b","ARRAY","findif","CODE"],
    ["b","SCALAR","*","SCALAR"],
    ["b","ANY","in","ARRAY"],
    ["b","OBJECT","in","OBJECT"],
    ["b","SCALAR","tofixed","SCALAR"],
    ["b","SCALAR","/","SCALAR"],
    ["b","CONFIG","/","STRING"],
    ["b","BOOL","||","BOOL"],
    ["b","BOOL","||","CODE"],
    ["b","ARRAY","vectorcos","ARRAY"],
    ["b","IF","exitwith","CODE"],
    ["b","ANY","call","CODE"],
    ["b","ARRAY","vectordistance","ARRAY"],
    ["b","SWITCH",":","CODE"],
    ["b","ARRAY","vectordistancesqr","ARRAY"],
    ["b","ARRAY","vectordotproduct","ARRAY"],
    ["b","SCALAR","<=","SCALAR"],
    ["b","ARRAY","#","SCALAR"],
    ["b","ARRAY","vectormultiply","SCALAR"],
    ["b","SCALAR",">=","SCALAR"],
    ["b","WITH","do","CODE"],
    ["b","WHILE","do","CODE"],
    ["b","FOR","do","CODE"],
    ["b","SWITCH","do","CODE"],
    ["b","NAMESPACE","getvariable","STRING"],
    ["b","NAMESPACE","getvariable","ARRAY"],
    ["b","OBJECT","getvariable","STRING"],
    ["b","OBJECT","getvariable","ARRAY"],
    ["b","GROUP","getvariable","STRING"],
    ["b","GROUP","getvariable","ARRAY"],
    ["b","SCALAR","==","SCALAR"],
    ["b","SIDE","==","SIDE"],
    ["b","STRING","==","STRING"],
    ["b","OBJECT","==","OBJECT"],
    ["b","GROUP","==","GROUP"],
    ["b","TEXT","==","TEXT"],
    ["b","CONFIG","==","CONFIG"],
    ["b","DISPLAY","==","DISPLAY"],
    ["b","CONTROL","==","CONTROL"],
    ["b","LOCATION","==","LOCATION"],
    ["b","NAMESPACE","setvariable","ARRAY"],
    ["b","OBJECT","setvariable","ARRAY"],
    ["b","GROUP","setvariable","ARRAY"],
    ["b","CODE","count","ARRAY"],
    ["b","STRING","callextension","STRING"],
    ["b","STRING","callextension","ARRAY"],
    ["b","IF","then","ARRAY"],
    ["b","IF","then","CODE"],
    ["b","STRING","setmarkerdir","SCALAR"],
    ["b","CODE","else","CODE"],
    ["b","CONFIG","merge__","CONFIG"],
    ["b","ARRAY","pushbackunique","ANY"],
    ["b","FOR","from","SCALAR"],
    ["b","BOOL","or","BOOL"],
    ["b","BOOL","or","CODE"],
    ["b","FOR","to","SCALAR"],
    ["b","FOR","step","SCALAR"],
    ["b","STRING","setmarkercolorlocal","STRING"],
    ["b","BOOL","&&","BOOL"],
    ["b","BOOL","&&","CODE"],
    ["b","ARRAY","select","SCALAR"],
    ["b","ARRAY","select","BOOL"],
    ["b","ARRAY","select","ARRAY"],
    ["b","ARRAY","select","CODE"],
    ["b","STRING","select","ARRAY"],
    ["b","CONFIG","select","SCALAR"],
    ["b","SCALAR",">","SCALAR"],
    ["b","ARRAY","append","ARRAY"],
    ["b","ARRAY","resize","SCALAR"],
    ["b","ARRAY","pushback","ANY"],
    ["b","ARRAY","sort","BOOL"],
    ["b","SCALAR","<","SCALAR"],
    ["b","ARRAY","apply","CODE"],
    ["b","ARRAY","deleteat","SCALAR"],
    ["b","ARRAY","arrayintersect","ARRAY"],
    ["b","ARRAY","find","ANY"],
    ["b","STRING","find","STRING"],
    ["b","ARRAY","params","ARRAY"],
    ["b","ANY","param","ARRAY"],
    ["b","STRING","setmarkershape","STRING"],
    ["b","EXCEPTION","catch","CODE"],
    ["b","CODE","except__","CODE"],
    ["b","BOOL","and","BOOL"],
    ["b","BOOL","and","CODE"],
    ["b","ANY","!=","ANY"],
    ["b","SIDE","!=","SIDE"],
    ["b","STRING","!=","STRING"],
    ["b","OBJECT","!=","OBJECT"],
    ["b","GROUP","!=","GROUP"],
    ["b","TEXT","!=","TEXT"],
    ["b","CONFIG","!=","CONFIG"],
    ["b","DISPLAY","!=","DISPLAY"],
    ["b","CONTROL","!=","CONTROL"],
    ["b","LOCATION","!=","LOCATION"],
    ["b","ANY","isequalto","ANY"],
    ["b","ANY","isequaltype","ANY"],
    ["b","ARRAY","joinstring","STRING"],
    ["b","CONFIG",">>","STRING"],
    ["b","STRING","configclasses","CONFIG"],
    ["b","STRING","createvehicle","ARRAY"],
    ["b","STRING","setmarkeralpha","SCALAR"],
    ["b","ANY","createvehiclelocal","ANY"],
    ["b","STRING","setmarkeralphalocal","SCALAR"],
    ["b","OBJECT","setpos","ARRAY"],
    ["b","OBJECT","setvelocity","ARRAY"],
    ["b","GROUP","createunit","ARRAY"],
    ["b","STRING","createunit","ARRAY"],
    ["b","ARRAY","distance","ARRAY"],
    ["b","OBJECT","distance","ARRAY"],
    ["b","ARRAY","distance","OBJECT"],
    ["b","OBJECT","distance","OBJECT"],
    ["b","OBJECT","iskindof","STRING"],
    ["b","STRING","iskindof","STRING"],
    ["b","STRING","iskindof","ARRAY"],
    ["b","OBJECT","setdamage","SCALAR"],
    ["b","STRING","setmarkertext","STRING"],
    ["b","STRING","setmarkershapelocal","STRING"],
    ["b","STRING","setmarkerbrush","STRING"],
    ["b","STRING","setmarkerbrushlocal","STRING"],
    ["b","STRING","setmarkerpos","ARRAY"],
    ["b","STRING","setmarkerposlocal","ARRAY"],
    ["b","STRING","setmarkertype","STRING"],
    ["b","STRING","setmarkertypelocal","STRING"],
    ["b","STRING","setmarkertextlocal","STRING"],
    ["b","STRING","setmarkerdirlocal","SCALAR"],
    ["b","STRING","setmarkercolor","STRING"],
    ["b","STRING","setmarkersize","ARRAY"],
    ["b","STRING","setmarkersizelocal","ARRAY"]
]