Display flow-parser errors like other parsers
Describe the bug
Right now the flow-parser appears to accept anything and spit out a bogus AST for bogus input.
But what's really happening is the Program node it generates also has an errors property containing the parse errors.
At some point I'll try to make a PR to fix this.
To Reproduce Steps to reproduce the behavior:
- Select
flowparser - Enter code
type switch = number - See output screenshot
Expected behavior Something like babel does, "Unexpected token, expected ";" (1:5)" and line 1 highlighted in red
We should probably just make the flow parser wrapper check the errors property and throw something if there are errors. @fkling does AST explorer have infrastructure for displaying multiple error messages at once? If not we could just throw the first error.
And, is it possible to highlight errors in red but also still display the questionable AST output on the right?
Screenshots

Browser (please complete the following information): irrelevant, happens on any browser
astexplorer settings:
- Selected parser: [e.g. flow]
- code:
type switch = number
Additional context
This had been confusing me for awhile, I mistakenly thought that flow-parser was stupidly permissive until I noticed the errors property on the output AST
Sounds like a good idea!