The 'file' compiler directive is often used in generated code to specify a location in an origin file where the code was generated from. This needs to interact properly with diagnostics.
I'm thinking the best way of doing things would be to show compiler errors in the actual file, but display runtime errors in the origin file.
Unless you already had an implementation in mind, I think a decent way of doing things would be to store source span => origin file line mappings in an auxiliary data structure outside of the diagnostics itself, and reference that when generating debug information for the runtime.
Thoughts @bitwalker?
I implemented a stub implementation in preprocessor.rs in order to get code compiling.
The 'file' compiler directive is often used in generated code to specify a location in an origin file where the code was generated from. This needs to interact properly with diagnostics.
I'm thinking the best way of doing things would be to show compiler errors in the actual file, but display runtime errors in the origin file.
Unless you already had an implementation in mind, I think a decent way of doing things would be to store source span => origin file line mappings in an auxiliary data structure outside of the diagnostics itself, and reference that when generating debug information for the runtime.
Thoughts @bitwalker?
I implemented a stub implementation in
preprocessor.rsin order to get code compiling.