version 3.13.2

This commit is contained in:
2023-07-14 22:14:02 +03:00
parent 56aed70425
commit ac76e07d9d
3 changed files with 12 additions and 75 deletions

View File

@@ -323,7 +323,7 @@ void PICodeParser::clear() {
<< "a2"
<< "n2"
<< "a3"
<< "n3");
<< "n3");
}
@@ -445,6 +445,7 @@ bool PICodeParser::parseFileContent(PIString & fc, bool main) {
PIString prev_namespace = cur_namespace, ccmn;
cur_namespace += pfc.takeCWord() + s_ns;
ccmn = pfc.takeRange('{', '}');
// piCout << "namespace" << cur_namespace;
parseClass(0, ccmn, true);
cur_namespace = prev_namespace;
continue;
@@ -462,12 +463,15 @@ bool PICodeParser::parseFileContent(PIString & fc, bool main) {
}
if (pfc.left(5) == s_class || pfc.left(6) == s_struct || pfc.left(5) == s_union) {
int dind = pfc.find('{', 0), find = pfc.find(';', 0);
// piCout << pfc.left(6) << dind << find;
if (dind < 0 && find < 0) {
pfc.cutLeft(6);
continue;
}
if (dind < 0 || find < dind) {
pfc.cutLeft(6);
// piCout << "skip FC" << (find + 1) << pfc.left(find + 1);
pfc.cutLeft(find + 1);
// pfc.cutLeft(6);
continue;
}
ccmn = pfc.left(dind) + s_bo + pfc.mid(dind).takeRange('{', '}') + s_bc;
@@ -557,7 +561,7 @@ PICodeParser::Entity * PICodeParser::parseClassDeclaration(const PIString & fc)
bool has_name = !cn.isEmpty();
if (cn.isEmpty()) cn = PIStringAscii("<unnamed_") + PIString::fromNumber(anon_num++) + '>';
// piCout << "found " << typename_ << cn;
if (cn.isEmpty()) return 0;
if (cn.isEmpty()) return nullptr;
Entity * e = new Entity();
e->meta = meta;
e->name = cur_namespace + cn;
@@ -587,10 +591,6 @@ void PICodeParser::parseClass(Entity * parent, PIString & fc, bool is_namespace)
Visibility prev_vis = cur_def_vis;
int dind = fc.find('{'), find = fc.find(';'), end = 0;
if (dind < 0 && find < 0) return;
if (dind < 0 || find < dind) {
fc.left(find);
return;
}
// piCout << "parse class <****\n" << fc << "\n****>";
Entity * ce = parent;
if (!is_namespace) {
@@ -598,7 +598,6 @@ void PICodeParser::parseClass(Entity * parent, PIString & fc, bool is_namespace)
fc.trim().cutLeft(1).cutRight(1).trim();
}
// piCout << "found class <****\n" << fc << "\n****>";
/// if (!ce) return PIString();
if (ce) {
if (parent) parent->children << ce;
ce->parent_scope = parent;
@@ -636,6 +635,7 @@ void PICodeParser::parseClass(Entity * parent, PIString & fc, bool is_namespace)
continue;
}
if (cw == s_class || cw == s_struct || cw == s_union) {
// piCout << cw << isDeclaration(fc, 0, &end);
if (isDeclaration(fc, 0, &end)) {
fc.cutLeft(end);
fc.takeSymbol();