Skip to content

Commit

Permalink
E0061,E0079が発生しない問題を修正
Browse files Browse the repository at this point in the history
  • Loading branch information
ponapalt committed Jan 2, 2024
1 parent 08a4b3b commit 41ccde8
Showing 1 changed file with 10 additions and 4 deletions.
14 changes: 10 additions & 4 deletions parser0.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1904,10 +1904,13 @@ char CParser0::ConvertEmbedStringToFormula(yaya::string_t& str, const yaya::stri
size_t bdepth = 1;
size_t len = str.size();
size_t spos = 0;
size_t validlen = 0;
for(spos = 2; spos < len; spos++) {
bdepth += ((str[spos] == L'(') - (str[spos] == L')'));
if (!bdepth)
break;
if (str[spos] != L' ' && str[spos] != L'\t')
validlen++;
}
if (spos < len) {
spos++;
Expand All @@ -1917,11 +1920,11 @@ char CParser0::ConvertEmbedStringToFormula(yaya::string_t& str, const yaya::stri
vm.logger().Error(E_E, 60, dicfilename, linecount);
return 1;
}
if (spos == 2) {
if (validlen == 0) {
vm.logger().Error(E_E, 61, dicfilename, linecount);
return 1;
}
else if (spos < 2) {
if (spos < 2) {
vm.logger().Error(E_E, 62, dicfilename, linecount);
return 1;
}
Expand Down Expand Up @@ -1957,10 +1960,13 @@ char CParser0::ConvertEmbedStringToFormula(yaya::string_t& str, const yaya::stri
size_t bdepth = 1;
size_t len = str.size();
size_t spos = 0;
size_t validlen = 0;
for(spos = 2; spos < len; spos++) {
bdepth += ((str[spos] == L'[') - (str[spos] == L']'));
if (!bdepth)
break;
if (str[spos] != L' ' && str[spos] != L'\t')
validlen++;
}
if (spos < len) {
spos++;
Expand All @@ -1970,11 +1976,11 @@ char CParser0::ConvertEmbedStringToFormula(yaya::string_t& str, const yaya::stri
vm.logger().Error(E_E, 78, dicfilename, linecount);
return 1;
}
if (spos == 2) {
if (validlen == 0) {
vm.logger().Error(E_E, 79, dicfilename, linecount);
return 1;
}
else if (spos < 2) {
if (spos < 2) {
vm.logger().Error(E_E, 80, dicfilename, linecount);
return 1;
}
Expand Down

0 comments on commit 41ccde8

Please sign in to comment.