Tool to check if two WML string are equivalent. More...
#include "serialization/preprocessor.hpp"
Go to the source code of this file.
Functions | |
config | preprocess_and_parse (const std::string &wml_str, preproc_map *macro_map=nullptr) |
Make a syntax tree by preprocessing and parsing a WML string. More... | |
void | check_wml_equivalence (const std::string &a, const std::string &b) |
Assert two WML strings are equivalent. More... | |
Tool to check if two WML string are equivalent.
Specifically, the check_wml_equivalence function would first preprocess and parse the two WML string to yield two syntax trees (defined by config objects). Subsequently, the function would assert if the two syntax trees are identical.
Definition in file wml_equivalence.hpp.
void check_wml_equivalence | ( | const std::string & | a, |
const std::string & | b | ||
) |
Assert two WML strings are equivalent.
The function performs two steps:
Definition at line 67 of file wml_equivalence.cpp.
References b, and preprocess_and_parse().
Referenced by BOOST_AUTO_TEST_CASE().
config preprocess_and_parse | ( | const std::string & | wml_str, |
preproc_map * | macro_map = nullptr |
||
) |
Make a syntax tree by preprocessing and parsing a WML string.
[in] | wml_str | The string |
[out] | macro_map | Store preprocessor macros found by the preprocessor |
Definition at line 57 of file wml_equivalence.cpp.
References b, tmp_file::path, preprocess_file(), read(), and tmp_file::set().
Referenced by check_wml_equivalence().