git-svn-id: svn://db.shs.com.ru/pip@893 12ceb7fc-bf1f-11e4-8940-5bc7170c53b5

This commit is contained in:
2020-03-02 13:02:06 +00:00
parent a9ef4fbec8
commit 9d1135f2fa
2 changed files with 8 additions and 7 deletions

View File

@@ -163,7 +163,7 @@ bool PICodeParser::parseFileInternal(const PIString & file, bool follow_includes
}
//piCout << "add" << file;
proc_files << f.path();
PIString fc = f.readAll();
PIString fc = PIString::fromUTF8(f.readAll());
piCout << "parsing" << f.path() << "...";
bool is_main = isMainFile(fc);
if (is_main) main_file = f.path();
@@ -201,6 +201,7 @@ bool PICodeParser::parseFileContent(PIString & fc, bool main) {
fc.replaceAll("\r\n", "\n");
fc.replaceAll("\r", "\n");
for (int i = 0; i < fc.size_s() - 1; ++i) {
if (fc[i].unicode16Code() >= 255) continue;
if (i > 0) pc = c;
c = fc[i].toAscii();
if (c == '"' && !mlc && pc != '\'') {
@@ -226,7 +227,7 @@ bool PICodeParser::parseFileContent(PIString & fc, bool main) {
if (fc.mid(i, 2) == "*/" && mlc) {mlc = false; fc.cutMid(mls, i - mls + 2); i = mls - 1; continue;}
if (fc.mid(i, 2) == "//" && !mlc) {ole = fc.find('\n', i); fc.cutMid(i, ole < 0 ? -1 : ole - i); --i; continue;}
}
//piCout << fc;
//PICout(PICoutManipulators::DefaultControls) << fc;
pfc = procMacros(fc);
replaceMeta(pfc);