reasonml / reason

Simple, fast & type safe code that leverages the JavaScript & OCaml ecosystems
http://reasonml.github.io
MIT License
10.12k stars 428 forks source link

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

Closed jcsherin closed 1 month ago

jcsherin commented 4 years ago

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.

anmonteiro commented 1 month ago

this doesn't throw an error anymore, but it takes substantially longer to compile for some reason

anmonteiro commented 1 month ago

ends up being the same issue as https://github.com/melange-re/melange/issues/808