Localization error (typer / compiler) implementation is not optimal, not elegant!
To avoid having long type constructors with systematic localization attribute in expressions and statements, it would probably be better to factorize ("decorate") expr and stmt types.
For example, in AST :
type ident = { id: string; id_loc: loc }
type expr = {
expr_node: expr_node;
expr_loc: loc;
}
type stmt = {
stmt_node: stmt_node;
stmt_loc: loc;
}
Localization error (typer / compiler) implementation is not optimal, not elegant! To avoid having long type constructors with systematic localization attribute in expressions and statements, it would probably be better to factorize ("decorate") expr and stmt types.
For example, in AST :
This refactoring seems interesting ;)