import espree from 'espree';

const ESPREE_OPTS = {
  ecmaVersion: 9,
  ecmaFeatures: {jsx: true}
};

/**
 * An Esprima-compatible parser with JSX and object rest/spread parsing enabled.
 */
export default {
  parse(js, opts) {
    return espree.parse(js, {...opts, ...ESPREE_OPTS});
  },
  tokenize(js, opts) {
    return espree.tokenize(js, {...opts, ...ESPREE_OPTS});
  },
};

@@ -90,16 +90,49 @@
 x: true%7D
+,%0A  comment: true,%0A  tokens: true
 %0A%7D;%0A%0A/**
@@ -404,9 +404,8 @@
 %0A  %7D,%0A%7D;
-%0A

add comment and tokens option to espree