preprocessor: don't substitute 'dates' when preceded by an underscore
parent
578da1e0bc
commit
03833cee2f
|
@ -83,7 +83,7 @@ NativeStatement::writeOutput(ostream &output, const string &basename) const
|
||||||
{
|
{
|
||||||
using namespace boost::xpressive;
|
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])))";
|
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);
|
sregex regex_dollar = sregex::compile("(\\$)"+date_regex);
|
||||||
|
|
||||||
string ns = regex_replace(native_statement, regex_lookbehind, "dates('$&')");
|
string ns = regex_replace(native_statement, regex_lookbehind, "dates('$&')");
|
||||||
|
|
Loading…
Reference in New Issue