var rewritePattern = require("regexpu/rewrite-pattern");
var b              = require("acorn-ast-types").builders;
var _              = require("lodash");

exports.Literal = function (node) {
  var regex = node.regex;
  if (!regex) return;

  var flags = regex.flags.split("");
  if (!_.contains(regex.flags, "u")) return;
  _.pull(flags, "u");

  regex.pattern = rewritePattern(regex.pattern, regex.flags);
};

var rewritePattern = require("regexpu/rewrite-pattern");
var b              = require("acorn-ast-types").builders;
var _              = require("lodash");

exports.Literal = function (node) {
  var regex = node.regex;
  if (!regex) return;

  var flags = regex.flags.split("");
  if (!_.contains(regex.flags, "u")) return;
  _.pull(flags, "u");

  regex.pattern = rewritePattern(regex.pattern, regex.flags);
  regex.flags   = flags.join("");
};

add back regex.flags in unicode regex transformer