janestreet / toplevel_expect_test

Toplevel expectation test
MIT License
13 stars 5 forks source link

syntax errors don't work #3

Closed yminsky closed 8 years ago

yminsky commented 8 years ago

When I try something with a syntax error, the whole script fails, rather than reporting the syntax error. In particular, this file:

let x-y = 3
[%%expect]

fails as follows:

$ ocaml-expect w.ml
File "w.ml", line 1, characters 6-7:
Error: Syntax error
ghost commented 8 years ago

That's a known limitation. [%%expect] nodes are part of the syntax, so supporting this would require a parser that support syntax errors. Maybe using the merlin parser would work...

yminsky commented 8 years ago

Got it. This seems like a minor issue, and probably not worth fixing right now. Closing.