preprocessor: don't substitute 'dates' when preceded by an underscore

issue#70
Houtan Bastani 2014-04-18 16:08:39 +02:00
parent 578da1e0bc
commit 03833cee2f
1 changed files with 1 additions and 1 deletions

View File

@ -83,7 +83,7 @@ NativeStatement::writeOutput(ostream &output, const string &basename) const
{
using namespace boost::xpressive;
string date_regex = "(-?\\d+([YyAa]|[Mm]([1-9]|1[0-2])|[Qq][1-4]|[Ww]([1-9]{1}|[1-4]\\d|5[0-2])))";
sregex regex_lookbehind = sregex::compile("(?<!\\$|\\d|[a-zA-Z]|\\')" + date_regex);
sregex regex_lookbehind = sregex::compile("(?<!\\$|\\d|[a-zA-Z_]|\\')" + date_regex);
sregex regex_dollar = sregex::compile("(\\$)"+date_regex);
string ns = regex_replace(native_statement, regex_lookbehind, "dates('$&')");