mirror of
https://github.com/amyinspace/MagicSetEditor2.git
synced 2026-06-12 05:36:59 -04:00
Added support for separators that are part of a parameter;
Keywords match whole words only; Added english_singular/plural functions; Fixed possible infinite loop in reader git-svn-id: svn://svn.code.sf.net/p/magicseteditor/code/trunk@347 0fc631ac-6414-0410-93d0-97cfa31319b6
This commit is contained in:
@@ -132,6 +132,7 @@ void Reader::readLine(bool in_string) {
|
||||
}
|
||||
key = cannocial_name_form(trim(key));
|
||||
value = pos == String::npos ? _("") : trim_left(line.substr(pos+1));
|
||||
if (key.empty() && pos!=String::npos) key = _(" "); // we don't want an empty key if there was a colon
|
||||
}
|
||||
|
||||
void Reader::unknownKey() {
|
||||
@@ -162,7 +163,7 @@ void Reader::unknownKey() {
|
||||
return;
|
||||
}
|
||||
}
|
||||
if (indent == expected_indent) {
|
||||
if (indent >= expected_indent) {
|
||||
warning(_("Unexpected key: '") + key + _("'"));
|
||||
do {
|
||||
moveNext();
|
||||
|
||||
@@ -386,11 +386,6 @@ String remove_tag_contents(const String& str, const String& tag) {
|
||||
|
||||
// ----------------------------------------------------------------------------- : Updates
|
||||
|
||||
/// Return all open or close tags in the given range from a string
|
||||
/** for example:
|
||||
* if close_tags == false, "text<tag>text</tag>text" --> "<tag>"
|
||||
* if close_tags == true, "text<tag>text</tag>text" --> "</tag>"
|
||||
*/
|
||||
String get_tags(const String& str, size_t start, size_t end, bool open_tags, bool close_tags) {
|
||||
String ret;
|
||||
bool intag = false;
|
||||
|
||||
@@ -143,6 +143,13 @@ String remove_tag_contents(const String& str, const String& tag);
|
||||
|
||||
// ----------------------------------------------------------------------------- : Updates
|
||||
|
||||
/// Return all open or close tags in the given range from a string
|
||||
/** for example:
|
||||
* if close_tags == false, "text<tag>text</tag>text" --> "<tag>"
|
||||
* if close_tags == true, "text<tag>text</tag>text" --> "</tag>"
|
||||
*/
|
||||
String get_tags(const String& str, size_t start, size_t end, bool open_tags, bool close_tags);
|
||||
|
||||
/// Replace a subsection of 'input' with 'replacement'.
|
||||
/** The section to replace is indicated by [start...end).
|
||||
* This function makes sure tags still match. It also attempts to cancel out tags.
|
||||
|
||||
Reference in New Issue
Block a user