Make register_[long_]diagnostics hygienic

This commit is contained in:
Matthew Jasper 2019-07-13 10:02:40 +01:00
parent 313ba7c4d1
commit 199931ce91
7 changed files with 10 additions and 10 deletions

View File

@ -1,4 +1,4 @@
use syntax::{register_diagnostic, register_diagnostics}; use syntax::register_diagnostics;
register_diagnostics! { register_diagnostics! {
E0721, // `await` keyword E0721, // `await` keyword

View File

@ -1,6 +1,6 @@
#![allow(non_snake_case)] #![allow(non_snake_case)]
use syntax::{register_diagnostic, register_diagnostics, register_long_diagnostics}; use syntax::{register_diagnostics, register_long_diagnostics};
register_long_diagnostics! { register_long_diagnostics! {
E0454: r##" E0454: r##"

View File

@ -1,6 +1,6 @@
#![allow(non_snake_case)] #![allow(non_snake_case)]
use syntax::{register_diagnostic, register_diagnostics, register_long_diagnostics}; use syntax::{register_diagnostics, register_long_diagnostics};
register_long_diagnostics! { register_long_diagnostics! {
/* /*

View File

@ -1,6 +1,6 @@
#![allow(non_snake_case)] #![allow(non_snake_case)]
use syntax::{register_diagnostic, register_diagnostics, register_long_diagnostics}; use syntax::{register_diagnostics, register_long_diagnostics};
register_long_diagnostics! { register_long_diagnostics! {

View File

@ -1,6 +1,6 @@
#![allow(non_snake_case)] #![allow(non_snake_case)]
use syntax::{register_diagnostic, register_diagnostics, register_long_diagnostics}; use syntax::{register_diagnostics, register_long_diagnostics};
// Error messages for EXXXX errors. Each message should start and end with a // Error messages for EXXXX errors. Each message should start and end with a
// new line, and be wrapped to 80 characters. In vim you can `:set tw=80` and // new line, and be wrapped to 80 characters. In vim you can `:set tw=80` and

View File

@ -170,19 +170,19 @@ macro_rules! help {
#[macro_export] #[macro_export]
macro_rules! register_diagnostics { macro_rules! register_diagnostics {
($($code:tt),*) => ( ($($code:tt),*) => (
$(register_diagnostic! { $code })* $($crate::register_diagnostic! { $code })*
); );
($($code:tt),*,) => ( ($($code:tt),*,) => (
$(register_diagnostic! { $code })* $($crate::register_diagnostic! { $code })*
) )
} }
#[macro_export] #[macro_export]
macro_rules! register_long_diagnostics { macro_rules! register_long_diagnostics {
($($code:tt: $description:tt),*) => ( ($($code:tt: $description:tt),*) => (
$(register_diagnostic! { $code, $description })* $($crate::register_diagnostic! { $code, $description })*
); );
($($code:tt: $description:tt),*,) => ( ($($code:tt: $description:tt),*,) => (
$(register_diagnostic! { $code, $description })* $($crate::register_diagnostic! { $code, $description })*
) )
} }

View File

@ -1,6 +1,6 @@
#![allow(non_snake_case)] #![allow(non_snake_case)]
use syntax::{register_diagnostic, register_long_diagnostics}; use syntax::register_long_diagnostics;
// Error messages for EXXXX errors. // Error messages for EXXXX errors.
// Each message should start and end with a new line, and be wrapped to 80 characters. // Each message should start and end with a new line, and be wrapped to 80 characters.