Git Product home page Git Product logo

armascriptcompiler's People

Contributors

dahlgren avatar dedmen avatar killerswin2 avatar leopard20 avatar pabstmirror avatar sharplol avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

armascriptcompiler's Issues

sqfc script not found issue

When i define functions in CfgFunction and place *.sqfc file in the mission (instead .sqf) then arma generate error: "File not found". Game search ".sqf" files. I must to place empty *.sqf file with same names to avoid this error.

class myFSMFunction
{
ext = ".sqfc";
}
does not solving issue.

Optimize && operator

baermitumlaut [5:01 PM]
@dedmen another optimization idea: transform BOOL && BOOL to BOOL && CODE

dedmen [5:03 PM]
Yeah. Thought about that but wasn't sure if there might be any caveats that are complicated to solve maybe.
More specifically, I thought about adding a "lazy compare" script function/instruction. That you just give a array of code to.
That does real lazy eval. And not still evaluate all the other &&'s even though it's already false.

Incorrect slash in filepaths

Output SQFC files filepath is written as /z/ace/addons/advanced_ballistics/functions/fnc_calculateAmmoTemperatureVelocityShift.sqf
But thats wrong, Arma internal filepaths use backslash.
This could also be issue in SQF-VM, but can probably remedied by passing filepaths a different way.

Output path doesn't use relative names

Situation
inputdir "C:/Users/testuser/Desktop/a3/Functions_F/"
OutputDir "C:/Users/testuser/Desktop/a3/Functions_F/"

result file C:/Users/testuser/Desktop/a3/Functions_F/User/testuser/Desktop/a3/Functions_F/initFunctions.sqf
Expected result file C:/Users/testuser/Desktop/a3/Functions_F/initFunctions.sqf

Stuck on infinite loop in some scripts

The problem seems to be with parsing something like this (which works fine in SQF):

#define X__ '
#define __X '
#define XX__ "
#define __XX "

e.g.

#define X__ '
#define __X '
#define XX__ "
#define __XX "

#define PICS_PATH(x) XX__##PREFIX\pictures\x.paa##__XX

#ifdef MISSION
#define PICTURE_PATH(x) getMissionPath(PICS_PATH(x))
#else
#define PICTURE_PATH(x) PICS_PATH(x)
#endif

PICTURE_PATH(blabla)

Params const optimization is not a constant in all cases

params ["_unit", "_pos", ["_target", objNull], ["_buildings", []]];
_buildings pushBack [1,2,3];

Compiles fine.
But after first run, assembly prints this

push ["_unit","_pos",["_target",<NULL-object>],["_buildings",[[1,2,3]]]]
callFunction params;

pushBack modified the reference inside the compiled script.
Need to insert + operator call between the const array and params call, if the default values contain an array because otherwise the array will leak into the script.

https://github.com/dedmen/ArmaScriptCompiler/blob/master/src/optimizer/optimizerModuleConstantFold.cpp#L230

Cannot handle files that are not on a pdrive properly

https://github.com/dedmen/ArmaScriptCompiler/blob/master/src/main.cpp#L54

root_path is drive letter root, works fine for p-drive, doesn't work fine for not p-drive
example, compile directory
O:\dev\CBA_A3

for O:\dev\CBA_A3\addons\xeh\test
The virtual path should be assembled from pboprefix, and relative path

iterate up directory structure till first pboprefix
x\cba\addons\xeh

pathRelative = path.lexically_relative(directory of pboprefix file);
->
pathRelative = /test

virtual path -> prefix/pathRelative -> x\cba\addons\xeh/test

Detect #if __has_include

__has_include in SQF scripts cannot be reliably resolved at offline compile. These files should not be compiled

Cleanup optimizer, better/more safer pattern matching

Instead of just

the "-" operator do a
the "-" operator if left side arg is type number and right side is also number

instead of matching possible optimizations only by what script command is used, also take argument type into account and implement seperate functions per argument type combinations

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.