xshade-lang / xshade

"cross shade" meta shading language and compiler
MIT License
38 stars 3 forks source link

Feature: Better Compiler Errors #21

Open Vengarioth opened 7 years ago

Vengarioth commented 7 years ago

Feature: Better Compiler Errors

Summary

After all AST nodes have spans we should add nice error messages.

Examples

An example error message.

error: type `vec3` is unknown or not included.
D:\Workspace\xshade\examples\phong.xs:2:15
 1 | struct VertexInput {
 2 |     position: vec3,
   |               ^^^^ unknown type `vec3`
 3 | }
implementations for `vec3` are found in:
* std::vec3 (type alias for `Vector<f32; 3>`)

References