Compare commits

..

No commits in common. "a69bedb033192927bf7625493a7a03aaa1a3a171" and "ee0653c2bb23639c409b3a11c425cf57ff7f2f90" have entirely different histories.

6 changed files with 10 additions and 61 deletions

View File

@ -1,5 +1,3 @@
30.08.2024 Экстеор 4.9.4
• исправлена загрузка файлов версий 2017-2020 годов
14.06.2024 Экстеор 4.9.3
• Грамматика: разрешено использование одного аргумента для мультифильтра - Fi1,2[X1*X1](S1)
• исправлена ошибка, приводившая к некорректному вычислению типизаций рекурсии с пустым множеством

View File

@ -1182,8 +1182,8 @@ END
//
VS_VERSION_INFO VERSIONINFO
FILEVERSION 4,9,4,1000
PRODUCTVERSION 4,9,4,1000
FILEVERSION 4,9,3,1000
PRODUCTVERSION 4,9,3,1000
FILEFLAGSMASK 0x3fL
#ifdef _DEBUG
FILEFLAGS 0x1L
@ -1201,13 +1201,13 @@ BEGIN
VALUE "Comments", "Ýêñïëèêàòîð òåîðèé "
VALUE "CompanyName", "ÍÏ ÖÈÂÒ ÊÎÍÖÅÏÒ"
VALUE "FileDescription", "Ýêñòåîð 4.9"
VALUE "FileVersion", "4.9.4.1000"
VALUE "FileVersion", "4.9.3.1000"
VALUE "InternalName", "Ýêñòåîð 4.9"
VALUE "LegalCopyright", "Copyright © NPMP CIHT CONCEPT 1994-2024"
VALUE "LegalTrademarks", "Ýêñòåîð™"
VALUE "OriginalFilename", "Exteor.exe"
VALUE "ProductName", "Ýêñòåîð 4.9"
VALUE "ProductVersion", "4.9.4.1000"
VALUE "ProductVersion", "4.9.3.1000"
END
END
BLOCK "VarFileInfo"

View File

@ -4,11 +4,6 @@
#include "xtr/core/Encoder.h"
#include <string>
#include <string_view>
#include <regex>
#include <algorithm>
using ccl::semantic::ConceptRecord;
using ccl::semantic::CstType;
using ccl::lang::ManagedText;
@ -16,40 +11,6 @@ using ccl::lang::LexicalTerm;
namespace xtr::io {
namespace details {
static void FixOldReferences(std::string& target) {
static const std::regex referencePattern(R"(\@\{([A-Z]\d+)\|([A-Z]+)\|([A-Z]+)\|\d+\})");
std::vector<std::pair<std::string, std::string>> replacements{};
std::sregex_iterator iter(target.begin(), target.end(), referencePattern);
std::sregex_iterator end{};
while (iter != end) {
std::smatch match = *iter;
std::string part1 = match[1].str(); // e.g., "D4"
std::string part2 = match[2].str(); // e.g., "ABLT"
std::string part3 = match[3].str(); // e.g., "PLUR"
std::transform(part2.begin(), part2.end(), part2.begin(),
[](unsigned char c) { return static_cast<char>(std::tolower(c)); });
std::transform(part3.begin(), part3.end(), part3.begin(),
[](unsigned char c) { return static_cast<char>(std::tolower(c)); });
std::string newReference = "@{" + part1 + "|" + part2 + "," + part3 + "}";
replacements.emplace_back(match.str(), newReference);
iter++;
}
for (const auto& [oldRef, newRef] : replacements) {
size_t pos = 0;
while ((pos = target.find(oldRef, pos)) != std::string::npos) {
target.replace(pos, oldRef.length(), newRef);
pos += newRef.length();
}
}
}
}
void LegacyCstLoader::LoadBasicProperties(BOOL oldType) {
const auto sName = ar.Load<CString>();
auto sComment = ar.Load<CString>();
@ -112,15 +73,9 @@ void LegacyCstLoader::LoadTerms(const BOOL hasTerms, const BOOL multipleTerms) {
termRefs.at(0) = terms.at(0);
}
auto termRaw = mfc::ToSTL(termRefs.at(0));
details::FixOldReferences(termRaw);
cst->term = LexicalTerm{ termRaw, mfc::ToSTL(terms.at(0)) };
cst->term = LexicalTerm{ mfc::ToSTL(termRefs.at(0)), mfc::ToSTL(terms.at(0)) };
for (uint8_t j = 0; j < size(TERM_FORMS); ++j) {
auto manualForm = mfc::ToSTL(termForms.at(0).at(j));
if (!manualForm.empty()) {
details::FixOldReferences(manualForm);
cst->term.SetForm(TERM_FORMS.at(j), manualForm);
}
cst->term.SetForm(TERM_FORMS.at(j), mfc::ToSTL(termForms.at(0).at(j)));
}
}
@ -133,9 +88,7 @@ void LegacyCstLoader::LoadInterpretation(const BOOL loadWithRef) {
if (needEncoding) {
encode::EncodeToUnicode(sInterpretation);
}
auto interpretationRaw = mfc::ToSTL(sInterpretationRef);
details::FixOldReferences(interpretationRaw);
cst->definition = ManagedText{ interpretationRaw, mfc::ToSTL(sInterpretation) };
cst->definition = ManagedText{ mfc::ToSTL(sInterpretationRef), mfc::ToSTL(sInterpretation) };
}
void LegacyCstLoader::LoadID() {
@ -164,9 +117,8 @@ void LegacyCoreLoader::DoLoad(ccl::semantic::RSCore& core) {
}
ccl::lang::ManagedText LegacyCoreLoader::LoadText() {
auto rawText = ar.Load<std::string>();
const auto rawText = ar.Load<std::string>();
const auto cache = ar.Load<std::string>();
details::FixOldReferences(rawText);
return ccl::lang::ManagedText{ rawText, cache };
}
@ -174,9 +126,8 @@ ccl::lang::LexicalTerm LegacyCoreLoader::LoadTerm() {
using ccl::lang::TERM_FORMS;
ccl::lang::LexicalTerm term{ LoadText() };
for (uint8_t j = 0; j < size(TERM_FORMS); ++j) {
auto manualForm = ar.Load<std::string>();
const auto manualForm = ar.Load<std::string>();
if (!std::empty(manualForm)) {
details::FixOldReferences(manualForm);
term.SetForm(TERM_FORMS.at(j), manualForm);
}
}

Binary file not shown.

Binary file not shown.

View File

@ -152,7 +152,7 @@ TEST_F(UTDocuments, RSModelSaveLoad) {
TEST_F(UTDocuments, RSModelCalculate) {
MockRSModelDoc document{};
const auto filePath = ::LocalPathToGlobal(LR"(Data\Model\TestCalculate.rsm)");
const auto filePath = ::LocalPathToGlobal(LR"(Data\Тест_Модели\TestCalculate.rsm)");
ASSERT_TRUE(document.LoadFrom(filePath));
document.model->Calculations().RecalculateAll();
EXPECT_EQ(document.model->Calculations().Count(ccl::semantic::EvalStatus::AXIOM_FAIL), 0U);