ptal / oak

A typed parser generator embedded in Rust code for Parsing Expression Grammars
Apache License 2.0
142 stars 14 forks source link

Analyse function call to match expression type #48

Closed ptal closed 8 years ago

ptal commented 9 years ago

Compiling the grammar into the host-language should not introduce error. However we want to keep the middle phase agnostic to the host-language.

In the case of function call, if an expression has an incompatible type, there will be a type mismatch. We think that errors generated by the host-language compiler (Rust) will be harder to analyse, that's why we would like the PEG compiler to handle this case and to output better error message.

ptal commented 8 years ago

I am not agree anymore. I think the error generated by the Rust compiler will be easy to understand as the name of the semantic action will be the same (as the one appearing in the grammar).