internal: Report macro definition errors on the definition

This commit is contained in:
Lukas Wirth 2023-04-16 14:15:59 +02:00
parent 0bb9a17312
commit a5558cdfe5
10 changed files with 115 additions and 14 deletions

View file

@ -39,6 +39,7 @@ diagnostics![
InvalidDeriveTarget,
IncoherentImpl,
MacroError,
MacroDefError,
MalformedDerive,
MismatchedArgCount,
MissingFields,
@ -131,6 +132,13 @@ pub struct MacroError {
pub message: String,
}
#[derive(Debug, Clone, Eq, PartialEq)]
pub struct MacroDefError {
pub node: InFile<AstPtr<ast::Macro>>,
pub message: String,
pub name: Option<TextRange>,
}
#[derive(Debug)]
pub struct UnimplementedBuiltinMacro {
pub node: InFile<SyntaxNodePtr>,