reason icon indicating copy to clipboard operation
reason copied to clipboard

[refmt] parseRE throws an error when code contains line comment

Open jcsherin opened this issue 5 years ago • 0 comments

The parseRE(code: string): astAndComments throws an error when the code contains one or more line comments.

The usage of the JS API is documented here.

const refmt = require('reason');

const ast = refmt.parseRE('let x = 1; // line comment');
Thrown: {
  message: '2864: <syntax error>',
  location: {
    startLine: 1,
    startLineStartChar: 12,
    endLine: 1,
    endLineEndChar: 13
  }
}

The reason package version is ^3.3.4.

jcsherin avatar Jun 27 '20 09:06 jcsherin