this is a big (or dare I say, huge) commit that pretty much fixes every
problem I've had so far with the basic parsing
I still need to do a custom operator>> for some types but at this point
the parser goes through the entire file and prints out everything which
is a large milestone I'd say
changes in this commit:
- add SECTION_LIST for a section containing a single list of values
examples: TimingPoints, HitObjects
- improve operator>> for enums making it accept int values and fail
properly when the value is incorrect (there's a warning I need to get
rid of but it's ok for now)
- skip over blank lines: adding this single line (src/osuparser.cpp:52)
made the parser go from shitting itself to actually going through the
whole file and printing everything (with some errors but still)
- new string util: isBlank() used for the above
- new __VA_ARGS__ util: ARG_COUNT() and rename foreach.hpp to
va_args_util.hpp as that name no longer fits
basically before this commit, the default value was set *before* the
prefix check which means it was set on each line instead of only when
the current var is being parsed (as it should)
I restructured the beginnings of the preprocessed files for debugging to
make the awks in the makefile not eat headers which are needed for
debugging (e.g. the FOR_EACH macro)
it's done by putting awk marker comments:
// awk stop marker (check make pp)
after the macros to be eaten by awk and before the ones we wanna keep
I hate this I hate this I hate this I hate this I hate this I hate this I hate this I hate this I hate this I hate this I hate this I hate this I hate this I hate this I hate this I hate this I hate this I hate this I hate this I hate this I hate this I hate this I hate this I hate this I hate this I hate this I hate this I hate this I hate this I hate this I hate this I hate this I hate this I hate this I hate this I hate this I hate this I hate this I hate this I hate this I hate this I hate this I hate this I hate this I hate this I hate this I hate this I hate this I hate this I hate this I hate this I hate this I hate this I hate this I hate this I hate this I hate this I hate this I hate this I hate this I hate this I hate this I hate this I hate this I hate this I hate this I hate this I hate this I hate this I hate this I hate this I hate this I hate this I hate this I hate this I hate this I hate this I hate this I hate this I hate this I hate this I hate this I hate this I hate this I hate this I hate this I hate this I hate this I hate this I hate this I hate this I hate this I hate this I hate this I hate this I hate this I hate this I hate this I hate this I hate this I hate this I hate this I hate this I hate this I hate this I hate this I hate this I hate this I hate this I hate this I hate this I hate this
this is done by removing all headers from the top of the file using that
awk written by the amazing Jappie3 from the hyprland discord
g++ -E itself was pretty fast but clang-format took a while to format a
52k line file (wonder why), removing std makes the files considerably
smaller and makes the whole operation almost instant
one small issue is currently the script removes every single header
unless it hits something else - not ideal since my own headers will get
wiped too and in the preprocessed output not all macros will be
evaluated (e.g. FOR_EACH from for_each.hpp in config.hpp)
fun story - I had this exact piece of code without a single changed not
work the prior 2 times, then I changed a bit, a part started working so
I changed it back to this and the 3rd time it somehow works