OpShin/opshin

Linter/Compiler: output more than one syntactic error at the same time

Opened this issue · 3 comments

Is your feature request related to a problem? Please describe.
When compiling or linting, we can only output one compile error, which means that there is at least one syntactic error in the smart contract.
But there could be more syntactic errors which we cannot show to the user at the same time.

Describe the solution you'd like
something like: catch the errors, but progress with checking the AST

Describe alternatives you've considered
-/-

Additional context
come up from this PR

it would be also nice that the linter shows warnings of the compiler, such as #172

The current structure relies heavily on raising exceptions. Maybe we can instead use the python built-tin logging library to log errors. This would include warnings, errors, etc. If any error was logged, the compilation pipeline will abort at some point, but all errors logged until then can be displayed i.e. by a linter.

A useful first step for this would be error reporting inside the typing system: for a lot of type related errors, compilation can likely continue, just choosing either of the applied types. This would allow for several errors. During compilation, after each step it should be checked whether an error remains and the compilation stopped.