-
Notifications
You must be signed in to change notification settings - Fork 4
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
Macros cause parsing to fail (#define and #include statements) #9
Comments
I've just seen #2 and your comment #2 (comment) 🤦 i'll take a read through and see what's up |
Hi, I was thinking of tackling the includes when I'd be done with figuring out #8 in a meaningful way. What needs to be kept in mind when making changes to the library is that we need to be able to use it to make small changes to the config and to write it back to disk with minimal changes. What I would much rather see is that the library detects that something is most probably a macro (because it looks like a macro and doesn't match anything else), and mark it as such. I can't tell when I'd go back to this as I'm currently quite busy IRL. However, there are a few things that I was planning to add to this library, like some fuzzing in the CI step, etc... so I hope that it's going to happen rather sooner than later. PRs are welcome neverthless. Even if I start working on a feature myself, having a PR will certainly speed up the time to have that feature shipped. I'm assuming the chances of you knowing Cython are fairly small, so I'm going to have to rewrite some bits of your (potential) PR anyway, to make use of Cython's enhancements. |
Was parsing Mike Force vehicle configs as the tag inclusions/exclusions can be pain to work out the final results without starting the gamemode and manually testing.
The parser would fail on these first macro lines
#include
is a similar issue to #8 as it loads in additional config classes from somewhere else (inheritance is so fun isn't it :P )But
#define
macros are used to inject common values later in the config file.... and they don't necessarily have a key that can be parsed by armaclassNOTE -- I think the lack of a key caused errors without doing with the macro replacement on
RESPAWN_SHORT
. However, it was over 12 hours ago and i'm about to go to bed as it's 6am. so I could be wrong!https://github.com/Savage-Game-Design/Mike-Force/blob/development/mission/config/subconfigs/vehicle_respawn_info.hpp#L503
I've got a very messy, hacked together script which could possibly turn into a PR at some point.
readlines
#include
macros#define
macros and parses themreadlines
data that matches the macro keyreadlines
data toarmaclass.parse
Of course, there's also another option which is just to flat out exclude macros and any lines that don't have an appropriate key!
The text was updated successfully, but these errors were encountered: