Closed Casperento closed 1 year ago
Could you move this out of the parser and put it into a separate class (thinking of possibly modifying this in the future to allow customization)
I'm having trouble when trying to reference the parser inside the new class for the sqf formatter:
::sqf::parser::sqf::formatter::formatter(::sqf::runtime::runtime& r, ::sqf::parser::sqf::parser& p_ptr, std::string c, ::sqf::runtime::fileio::pathinfo f) : runtime{ r }, contents{ c }, file{ f } {
tokenizer t(contents.begin(), contents.end(), file.physical);
::sqf::parser::sqf::bison::parser p(t, this->res, p_ptr, this->runtime);
this->hasError = p.parse() != 0;
}
::sqf::parser::sqf::formatter fmt(m_runtime, m_runtime.parser_sqf(), str, {path.string(), {}});
m_runtime.parser_sqf()
type is sqf::runtime::parser::sqf
...then i got the following error:'C++ no instance of constructor matches the argument list argument types are: (sqf::runtime::runtime, sqf::runtime::parser::sqf, std::string, {...})'
what am i doing wrong ?
Sorry for the last comment.
I managed to fix the issue and created a new class called formatter
successfully.
Build is still passing cmake tests.
There is no need to sorry.
Thanks, will check the full pr tomorrow :)
Minor changes are technically required (+=
vs <<
)
I've started the reimplementation of the old --pretty-print command.
Result example (
sqfvm --automated --parse-only --pretty-print filename.sqf
): https://pastebin.com/RaT1SwwwCurrently, build is passing all cmake tests (tested on Windows and Linux). I've been trying to modify less code as possible, so maybe I've missed something 😅