rescript-association / reasonml.org

Deprecated in favor of rescript-lang.org
MIT License
125 stars 34 forks source link

[Testing] use line number / filename directive for better line number reporting #200

Closed ryyppy closed 3 years ago

ryyppy commented 4 years ago

OCaml has this really neat feature of setting the line number / filename context of an executed script:

# 200 "some/file.mdx"

let a 1;

which will report an error like this:

File "some/file.mdx", line 201, characters 7-8:
Error: Syntax error

Here, the line number is correctly reported as 201. This can potentially replace the weird regex magic done in scripts/test-examples.js.

\cc @rizo for giving the tip

ryyppy commented 3 years ago

this is not needed anymore, we got a way better way on testing all snippets that's at least 20 times faster