version 4.8.0
fix PICodeParser: complex static array dimensions, member template types for multideclaration PIJSON::serialize and PIJSON::deserialize helpers
This commit is contained in:
@@ -818,7 +818,7 @@ bool PICodeParser::parseMember(Entity * parent, PIString & fc) {
|
||||
if (fc.trim().isEmpty()) return true;
|
||||
if (fc.find(s_operator) >= 0) return true;
|
||||
tmp_temp.clear();
|
||||
// piCout << "parse member" << fc;
|
||||
// piCout << "\nparse member <<<<" << fc << ">>>>";
|
||||
int ts = fc.find('<'), te = 0;
|
||||
PIString ctemp, crepl;
|
||||
while (ts >= 0) {
|
||||
@@ -847,10 +847,8 @@ bool PICodeParser::parseMember(Entity * parent, PIString & fc) {
|
||||
}
|
||||
fc.cutRight(fc.size_s() - fc.findLast(')') - 1);
|
||||
te = fc.find('(');
|
||||
// piCout << fc;
|
||||
for (ts = te - 1; ts >= 0; --ts)
|
||||
if (!_isCChar(fc[ts]) && !(fc[ts].isDigit())) break;
|
||||
// piCout << "takeMid" << ts + 1 << te - ts - 1;
|
||||
me.meta = meta;
|
||||
me.name = fc.takeMid(ts + 1, te - ts - 1);
|
||||
if (me.name == parent->name) return true;
|
||||
@@ -899,53 +897,46 @@ bool PICodeParser::parseMember(Entity * parent, PIString & fc) {
|
||||
if (fc.startsWith(s_using) || !(fc.contains(' ') || fc.contains('\t') || fc.contains('\n'))) return true;
|
||||
int bits = extractMemberBits(fc);
|
||||
tl = fc.split(',');
|
||||
// piCout << "member" << fc << tl;
|
||||
// piCout << "member after eb" << fc << ", bits =" << bits;
|
||||
if (tl.isEmpty()) return true;
|
||||
for (auto & v: tl)
|
||||
removeAssignment(v);
|
||||
bool vn = true;
|
||||
ctemp = tl.front().trim();
|
||||
// piCout << "member" << tl;
|
||||
ctemp = s_s5 + tl.front().trim();
|
||||
PIString meta_t;
|
||||
if (ctemp.contains(s_M)) {
|
||||
meta_t = ctemp.takeMid(ctemp.find(s_M), 5);
|
||||
ctemp.trim();
|
||||
}
|
||||
for (ts = ctemp.size_s() - 1; ts > 0; --ts) {
|
||||
if (vn) {
|
||||
if (!_isCChar(ctemp[ts]) && !ctemp[ts].isDigit() && ctemp[ts] != '[' && ctemp[ts] != ']') vn = false;
|
||||
} else {
|
||||
if (_isCChar(ctemp[ts]) || ctemp[ts].isDigit()) break;
|
||||
}
|
||||
if (ctemp.find(s_s_const_s) >= 0) {
|
||||
me.attributes |= Const;
|
||||
ctemp.replaceAll(s_s_const_s, ' ');
|
||||
}
|
||||
me.type = ctemp.takeLeft(ts + 1);
|
||||
if (ctemp.find(s_s_static_s) >= 0) {
|
||||
me.attributes |= Static;
|
||||
ctemp.replaceAll(s_s_static_s, ' ');
|
||||
}
|
||||
if (ctemp.find(s_s_mutable_s) >= 0) {
|
||||
me.attributes |= Mutable;
|
||||
ctemp.replaceAll(s_s_mutable_s, ' ');
|
||||
}
|
||||
if (ctemp.find(s_s_volatile_s) >= 0) {
|
||||
me.attributes |= Volatile;
|
||||
ctemp.replaceAll(s_s_volatile_s, ' ');
|
||||
}
|
||||
if (ctemp.find(s_s_extern_s) >= 0) {
|
||||
me.attributes |= Extern;
|
||||
ctemp.replaceAll(s_s_extern_s, ' ');
|
||||
}
|
||||
PIString type = ctemp.trim().takeWord();
|
||||
ctemp.trim();
|
||||
me.visibility = cur_def_vis;
|
||||
ctemp += meta_t;
|
||||
restoreTmpTemp(&me);
|
||||
PIString type = s_s5 + me.type;
|
||||
if (type.find(s_s_const_s) >= 0) {
|
||||
me.attributes |= Const;
|
||||
type.replaceAll(s_s_const_s, ' ');
|
||||
}
|
||||
if (type.find(s_s_static_s) >= 0) {
|
||||
me.attributes |= Static;
|
||||
type.replaceAll(s_s_static_s, ' ');
|
||||
}
|
||||
if (type.find(s_s_mutable_s) >= 0) {
|
||||
me.attributes |= Mutable;
|
||||
type.replaceAll(s_s_mutable_s, ' ');
|
||||
}
|
||||
if (type.find(s_s_volatile_s) >= 0) {
|
||||
me.attributes |= Volatile;
|
||||
type.replaceAll(s_s_volatile_s, ' ');
|
||||
}
|
||||
if (type.find(s_s_extern_s) >= 0) {
|
||||
me.attributes |= Extern;
|
||||
type.replaceAll(s_s_extern_s, ' ');
|
||||
}
|
||||
// me.type = s_s5 + me.type;
|
||||
type.trim();
|
||||
normalizeEntityNamespace(type);
|
||||
tl[0] = ctemp.trim();
|
||||
// piCout << "type" << type;
|
||||
// piCout << "vars" << tl;
|
||||
for (const auto & v: tl) {
|
||||
crepl.clear();
|
||||
@@ -972,6 +963,7 @@ bool PICodeParser::parseMember(Entity * parent, PIString & fc) {
|
||||
}
|
||||
// PICout(PICoutManipulators::AddAll) << "var" << me.type << me.name << me.bits;
|
||||
// piCout << "var" << v << me.type << me.name << me.bits;
|
||||
restoreTmpTemp(&me);
|
||||
parent->members << me;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user