code: function(rule) {
      var reg = rule.reg;
      //如果已经是regexp了就转为string
      if (typeOf(reg) === "regexp") reg = reg.toString().slice(1, -1);
      //将macro替换
      rule.regexp = reg.replace(replaceReg, function(a, b) {
        if (b in macros) return macros[b];
        else throw new Error('can"t replace undefined macros:' + b);
      });
      return rule;
    }
docs: Parser 相关