Update to v098r10 release.

byuu says:

Changelog:
- synchronized tomoko, loki, icarus with extensive changes to nall
  (118KiB diff)
This commit is contained in:
Tim Allen
2016-05-16 19:51:12 +10:00
parent 6ae0abe3d3
commit 3ebc77c148
105 changed files with 1281 additions and 824 deletions

View File

@@ -74,7 +74,7 @@ protected:
if(length == 0) throw "Invalid attribute name";
node->_name = slice(p, 0, length);
node->parseData(p += length);
node->_value.rtrim("\n", 1L);
node->_value.trimRight("\n", 1L);
_children.append(node);
}
}
@@ -101,7 +101,7 @@ protected:
_children.append(node);
}
_value.rtrim("\n", 1L);
_value.trimRight("\n", 1L);
}
//read top-level nodes
@@ -127,7 +127,7 @@ protected:
memory::move(output, origin, p - origin);
output += p - origin;
}
document.resize(document.size() - (p - output)).rtrim("\n");
document.resize(document.size() - (p - output)).trimRight("\n");
if(document.size() == 0) return; //empty document
auto text = document.split("\n");

View File

@@ -31,7 +31,7 @@ auto ManagedNode::_evaluate(string query) const -> bool {
}
string data = string{_value}.strip();
if(side(0).empty() == false) {
if(side(0)) {
auto result = _find(side(0));
if(result.size() == 0) return false;
data = result[0].value();
@@ -60,19 +60,19 @@ auto ManagedNode::_find(const string& query) const -> vector<Node> {
uint lo = 0u, hi = ~0u;
if(name.match("*[*]")) {
auto p = name.rtrim("]", 1L).split("[", 1L);
auto p = name.trimRight("]", 1L).split("[", 1L);
name = p(0);
if(p(1).find("-")) {
p = p(1).split("-", 1L);
lo = p(0).empty() ? 0u : p(0).natural();
hi = p(1).empty() ? ~0u : p(1).natural();
lo = !p(0) ? 0u : p(0).natural();
hi = !p(1) ? ~0u : p(1).natural();
} else {
lo = hi = p(1).natural();
}
}
if(name.match("*(*)")) {
auto p = name.rtrim(")", 1L).split("(", 1L);
auto p = name.trimRight(")", 1L).split("(", 1L);
name = p(0);
rule = p(1);
}

View File

@@ -125,7 +125,7 @@ protected:
while(isName(*p)) p++;
const char* nameEnd = p;
copy(_name, nameStart, nameEnd - nameStart);
if(_name.empty()) throw "missing element name";
if(!_name) throw "missing element name";
//parse attributes
while(*p) {
@@ -141,7 +141,7 @@ protected:
while(isName(*p)) p++;
const char* nameEnd = p;
copy(attribute->_name, nameStart, nameEnd - nameStart);
if(attribute->_name.empty()) throw "missing attribute name";
if(!attribute->_name) throw "missing attribute name";
//parse attribute data
if(*p++ != '=') throw "missing attribute value";