function createParser(parseMethod) {
  return {
    astFormat: "estree",
    parse(text) {
      const node = parseMethod(text);

      return {
        type: "NGRoot",
        node:
          parseMethod === parseAction && node.type !== "NGChainedExpression"
            ? { ...node, type: "NGChainedExpression", expressions: [node] }
            : node,
      };
    },
    locStart,
    locEnd,
  };
}
@param {parseAction | parseBinding | parseInterpolationExpression | parseTemplateBindings} parseMethod