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

CfgFunctions parser fails on some macros combinations #56

Open
AlexTriada opened this issue May 19, 2019 · 11 comments
Open

CfgFunctions parser fails on some macros combinations #56

AlexTriada opened this issue May 19, 2019 · 11 comments
Assignees

Comments

@AlexTriada
Copy link

Great module, I really like it, man, you can deal with the functions, or suggest how to prescribe them in .hpp so that they do not create notifications of type "Possibly undefined variable some_fnc_name_function" - it's very distracting

@AlexTriada AlexTriada changed the title Functions Mission functions May 19, 2019
@AlexTriada AlexTriada changed the title Mission functions Mission functions generating many alerts May 19, 2019
@SkaceKamen
Copy link
Owner

Functions need to be defined in description.ext (or the definition must be included there) and the expected format is described here:
https://community.bistudio.com/wiki/Arma_3_Functions_Library#Adding_a_Function

there is also limited support for macros, so there's posibility your functions wont get recognized properly if the definitions rely on macros.

@AlexTriada
Copy link
Author

Functions define in file functions.hpp, mission https://github.com/AlexTriada/A3-AntiStaki

@Wyqer
Copy link

Wyqer commented Jun 9, 2019

Similar to: #20
Current Version: 0.10.0

Description
We're also getting the "possibly undefined variable" on each of our own created functions, which worked fine (even with header as tooltip for parameters, etc.) some versions ago.

Way to reproduce:

Structure of project explained

Screenshot
warnings

@SkaceKamen
Copy link
Owner

Thanks for detailed info, I'll look into it when I have time

@SkaceKamen
Copy link
Owner

@Wyqer: This issue with your description.ext is usage of __EVAL()
That is really complicated macro in terms of parsing ... I'll try to work around it.

@Wyqer
Copy link

Wyqer commented Jun 11, 2019

Ok, good to know the possible cause of the issue.
So when you've removed the __EVAL(), it was fine so far?
We've a similar issue also on the old framework. There it seems that the indexing can't finish fully and therefore the whole linting and the functions/commands tooltips aren't working.
If you've some time to spare, you could have a look at it with the master branch of the liberation repository. Maybe you find something useful to improve anything.
But in the end the old framework isn't that important and it could also be just bad code which causes the issue, even if it worked fine earlier also in the old framework.

In any case many thanks for your support and work on sqflint, you're making our work so much easier.

@SkaceKamen
Copy link
Owner

Yes, when you remove the __EVAL, it's fine. I've already wrote a fix and will publish it soon, I just want to test if it doesn't break anything else.

@AlexTriada Your description.ext has multiline macros, which aren't supported yet, let me see if I can do anything about it.

@SkaceKamen
Copy link
Owner

@AlexTriada sorry, but the usage of macros in your description.ext (and correlating hpp files) is way too complicated right now, maybe when I have time to completely rewrite the preprocessor :'(

@Wyqer the issue with __EVAL should be fixed now (0.10.1)

@SkaceKamen SkaceKamen changed the title Mission functions generating many alerts CfgFunctions parser fails on some macros combinations Jun 11, 2019
@Wyqer
Copy link

Wyqer commented Jun 11, 2019

Works perfect now again. Just some other thing, but I'll create a new issue for that. Thanks for adding the feature to support the __EVAL() in description.ext
function

@Wyqer
Copy link

Wyqer commented Jun 11, 2019

Edit, the leftover now is just what I reported in #55

@jonathan-richer
Copy link

jonathan-richer commented Mar 27, 2020

Are the functions getting parsed in the config.cpp?

image

class CfgFunctions {
	class JRS_VehicleDeploy {
		tag = "JRS";
		class vehicle {
			file = "\jrs_vehicle_deploy\functions\vehicle";
			class deployObjects { };
			class initVehicle { };
		};
		class utils {
			file = "\jrs_vehicle_deploy\functions\utils";
			class createObject { };
		};
	};
};

Or am I doing something wrong?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants