Skip to content
Snippets Groups Projects
Commit 68bdf1af authored by Houtan Bastani's avatar Houtan Bastani
Browse files

remove unused portion of code, code cleanup

parent 06ab26f7
Branches
Tags
No related merge requests found
...@@ -103,43 +103,26 @@ NativeStatement::computingPass() ...@@ -103,43 +103,26 @@ NativeStatement::computingPass()
string newstr = ""; string newstr = "";
sregex date_expr = sregex::compile( "-?[0-9]+[Mm](1[0-2]|[1-9])|-?[0-9]+[Qq][1-4]|-?[0-9]+[Ww]([1-4][0-9]|5[0-2]|[1-9])" ); sregex date_expr = sregex::compile( "-?[0-9]+[Mm](1[0-2]|[1-9])|-?[0-9]+[Qq][1-4]|-?[0-9]+[Ww]([1-4][0-9]|5[0-2]|[1-9])" );
string format( "dynDate('$&')" ); string format( "dynDate('$&')" );
size_t length, i, lastidx, commentidx; size_t lastidx = 0;
length = lastidx = 0; for (size_t i = 0; i < apostrophes.size(); i++)
for (i = 0; i < apostrophes.size(); i++)
if (apostrophes[i] == 0) if (apostrophes[i] == 0)
skip = true; skip = true;
else else
{
if (skip) if (skip)
{ {
skip = false;
newstr.append(native_statement.substr(lastidx, apostrophes[i] - lastidx)); newstr.append(native_statement.substr(lastidx, apostrophes[i] - lastidx));
lastidx = apostrophes[i];
skip = false;
} }
else else
{ {
length = apostrophes[i] - lastidx; newstr.append(regex_replace(native_statement.substr(lastidx, apostrophes[i] - lastidx),
commentidx = native_statement.substr(lastidx, length).find("%", 0); date_expr, format));
if (commentidx != string::npos)
length = commentidx;
newstr.append(regex_replace(native_statement.substr(lastidx, length), date_expr, format));
if (commentidx != string::npos)
{
lastidx += commentidx;
while (i++ < apostrophes.size())
{
newstr.append(native_statement.substr(lastidx, apostrophes[i] - lastidx));
lastidx = apostrophes[i]; lastidx = apostrophes[i];
}
native_statement = newstr;
return;
}
skip = true; skip = true;
} }
lastidx = apostrophes[i]; size_t length = native_statement.length() - lastidx;
} size_t commentidx = native_statement.substr(lastidx, length).find("%", 0);
length = native_statement.length() - lastidx;
commentidx = native_statement.substr(lastidx, length).find("%", 0);
if (commentidx != string::npos) if (commentidx != string::npos)
length = commentidx; length = commentidx;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment