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

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

parent 7b882b2f
No related branches found
No related tags found
No related merge requests found
......@@ -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('$&')");
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment