mirror of
https://github.com/amyinspace/MagicSetEditor2.git
synced 2026-06-10 04:57:00 -04:00
Remove reader_pragma_handler hack
This commit is contained in:
@@ -23,19 +23,6 @@
|
||||
|
||||
// ----------------------------------------------------------------------------- : Locale class
|
||||
|
||||
// when reading, ignore "#_ADD" start of line pragmas
|
||||
|
||||
typedef void (*ReaderPragmaHandler)(String&);
|
||||
DECLARE_DYNAMIC_ARG(ReaderPragmaHandler,reader_pragma_handler);
|
||||
|
||||
void ignore_add_pragma(String& str) {
|
||||
if (starts_with(str,_("#_ADD "))) str = str.substr(6);
|
||||
else if (starts_with(str,_("#_ADD"))) str = str.substr(5);
|
||||
else if (starts_with(str,_("#_DEL"))) str.clear();
|
||||
}
|
||||
|
||||
// ----------------------------------------------------------------------------- : Locale class
|
||||
|
||||
LocaleP the_locale;
|
||||
|
||||
String Locale::typeName() const { return _("locale"); }
|
||||
@@ -47,7 +34,6 @@ LocaleP Locale::byName(const String& name) {
|
||||
|
||||
IMPLEMENT_REFLECTION_NO_SCRIPT(Locale) {
|
||||
REFLECT_BASE(Packaged);
|
||||
WITH_DYNAMIC_ARG(reader_pragma_handler, ignore_add_pragma);
|
||||
REFLECT_N("menu", translations[LOCALE_CAT_MENU]);
|
||||
REFLECT_N("help", translations[LOCALE_CAT_HELP]);
|
||||
REFLECT_N("tool", translations[LOCALE_CAT_TOOL]);
|
||||
|
||||
@@ -15,10 +15,6 @@
|
||||
#undef small
|
||||
using boost::tribool;
|
||||
|
||||
typedef void (*ReaderPragmaHandler)(String&);
|
||||
DECLARE_DYNAMIC_ARG (ReaderPragmaHandler,reader_pragma_handler);
|
||||
IMPLEMENT_DYNAMIC_ARG(ReaderPragmaHandler,reader_pragma_handler,nullptr);
|
||||
|
||||
// ----------------------------------------------------------------------------- : Reader
|
||||
|
||||
Reader::Reader(wxInputStream& input, Packaged* package, const String& filename, bool ignore_invalid)
|
||||
@@ -201,8 +197,6 @@ void Reader::readLine(bool in_string) {
|
||||
} catch (const ParseError& e) {
|
||||
throw ParseError(e.what() + String(_(" on line ")) << line_number);
|
||||
}
|
||||
// pragma handler
|
||||
if (reader_pragma_handler()) reader_pragma_handler()(line);
|
||||
// read indentation
|
||||
indent = 0;
|
||||
while ((UInt)indent < line.size() && line.GetChar(indent) == _('\t')) {
|
||||
|
||||
Reference in New Issue
Block a user