reasonml / reasonml.github.io

Reason's documentation site
https://reasonml.github.io
MIT License
333 stars 400 forks source link

Single line comments do not work in "Try" section of the website #785

Open gabriel-bezerra opened 3 weeks ago

gabriel-bezerra commented 3 weeks ago

https://reasonml.github.io/en/try?rrjsx=true&reason=PTAEBsFMBdQQ1AXlNATgV0gKCrByAzOcAZ0iA

// let a = true
let a = false

shows

Line 1:1-2 <syntax error>

I tried the same with reason locally and it does not show the same error at version 3.11.0 and ocaml-base-compiler at 5.1.0. I didn't figure out how to get version 3.12.0 to test it too.

$ opam install 'reason>=3.12.0'
[ERROR] Package reason has no version >=3.12.0.
gabriel-bezerra commented 3 weeks ago

I managed to use opam pin add reason https://github.com/reasonml/reason.git\#3.12.0 and did not get the error.

$ opam pin add reason https://github.com/reasonml/reason.git\#3.12.0
[reason.3.11.0] synchronised (git+https://github.com/reasonml/reason.git#3.12.0)
reason is now pinned to git+https://github.com/reasonml/reason.git#3.12.0 (version 3.8.2)

The following actions will be performed:
=== downgrade 1 package
  ↘ reason 3.11.0 to 3.8.2 (pinned)

Proceed with ↘ 1 downgrade? [y/n] y

<><> Processing actions <><><><><><><><><><><><><><><><><><><><><><><><><><>  🐫
⊘ removed   reason.3.11.0
∗ installed reason.3.8.2
Done.
$ ls
_build       _opam        dune         dune-project hello.opam   hello.re
$ cat hello.re
print_endline("Hello, world!");
// test comment
$ dune clean
$ dune build
$ dune exec hello
Hello, world!

and the same with the current commit on reasonml/reason master branch:

$ opam pin add reason https://github.com/reasonml/reason.git\#6455bb6d339aa613155cff13e0bc0eea9bd220d8
[NOTE] Package reason is currently pinned to
       git+https://github.com/reasonml/reason.git#3.12.0 (version 3.8.2).
[reason.3.8.2] synchronised (git+https://github.com/reasonml/reason.git#6455bb6d339aa613155cff13e0bc0eea9bd220d8)
reason is now pinned to git+https://github.com/reasonml/reason.git#6455bb6d339aa613155cff13e0bc0eea9bd220d8 (version 3.8.2)

The following actions will be performed:
=== recompile 1 package
  ↻ reason 3.8.2 (pinned)

Proceed with ↻ 1 recompilation? [y/n] y

<><> Processing actions <><><><><><><><><><><><><><><><><><><><><><><><><><>  🐫
⊘ removed   reason.3.8.2
∗ installed reason.3.8.2
Done.
$ dune clean
$ dune build
$ dune exec hello
Hello, world!