mirror of
https://github.com/amyinspace/MagicSetEditor2.git
synced 2026-06-10 04:57:00 -04:00
add include localized file token
This commit is contained in:
+12
-1
@@ -181,7 +181,18 @@ void TokenIterator::readToken() {
|
||||
newline = true;
|
||||
} else if (isSpace(c)) {
|
||||
++pos;
|
||||
// ignore
|
||||
// ignore
|
||||
} else if (is_substr(pos, end, "include localized file:")) {
|
||||
pos += 23; // "include localized file:"
|
||||
const char* newlines = "\r\n";
|
||||
auto eol = find_first_of(pos, end, newlines, newlines + 2);
|
||||
String include_file = trim(StringView(pos, eol)) + _("_") + settings.locale;
|
||||
// include_file("filename_en")
|
||||
addToken(TOK_NAME, "include_file", pos - 23);
|
||||
addToken(TOK_LPAREN, "(", pos);
|
||||
addToken(TOK_STRING, include_file, pos);
|
||||
addToken(TOK_RPAREN, ")", eol);
|
||||
pos = eol;
|
||||
} else if (is_substr(pos, end, "include file:")) {
|
||||
pos += 13; // "include file:"
|
||||
const char* newlines = "\r\n";
|
||||
|
||||
Reference in New Issue
Block a user