2018-08-30 07:18:55 -05:00
|
|
|
// run-pass
|
2018-09-25 16:51:35 -05:00
|
|
|
#![allow(unused_macros)]
|
2016-01-23 12:37:54 -06:00
|
|
|
// Check the macro follow sets (see corresponding cfail test).
|
|
|
|
|
|
|
|
// FOLLOW(pat) = {FatArrow, Comma, Eq, Or, Ident(if), Ident(in)}
|
|
|
|
macro_rules! follow_pat {
|
|
|
|
($p:pat =>) => {};
|
|
|
|
($p:pat ,) => {};
|
|
|
|
($p:pat =) => {};
|
|
|
|
($p:pat |) => {};
|
|
|
|
($p:pat if) => {};
|
|
|
|
($p:pat in) => {};
|
|
|
|
}
|
|
|
|
// FOLLOW(expr) = {FatArrow, Comma, Semicolon}
|
|
|
|
macro_rules! follow_expr {
|
|
|
|
($e:expr =>) => {};
|
|
|
|
($e:expr ,) => {};
|
|
|
|
($e:expr ;) => {};
|
|
|
|
}
|
|
|
|
// FOLLOW(ty) = {OpenDelim(Brace), Comma, FatArrow, Colon, Eq, Gt, Semi, Or,
|
2016-02-08 20:47:57 -06:00
|
|
|
// Ident(as), Ident(where), OpenDelim(Bracket), Nonterminal(Block)}
|
2016-01-23 12:37:54 -06:00
|
|
|
macro_rules! follow_ty {
|
|
|
|
($t:ty {}) => {};
|
|
|
|
($t:ty ,) => {};
|
|
|
|
($t:ty =>) => {};
|
|
|
|
($t:ty :) => {};
|
|
|
|
($t:ty =) => {};
|
|
|
|
($t:ty >) => {};
|
|
|
|
($t:ty ;) => {};
|
|
|
|
($t:ty |) => {};
|
|
|
|
($t:ty as) => {};
|
|
|
|
($t:ty where) => {};
|
|
|
|
($t:ty []) => {};
|
2016-02-08 20:47:57 -06:00
|
|
|
($t:ty $b:block) => {};
|
2016-01-23 12:37:54 -06:00
|
|
|
}
|
|
|
|
// FOLLOW(stmt) = FOLLOW(expr)
|
|
|
|
macro_rules! follow_stmt {
|
|
|
|
($s:stmt =>) => {};
|
|
|
|
($s:stmt ,) => {};
|
|
|
|
($s:stmt ;) => {};
|
|
|
|
}
|
|
|
|
// FOLLOW(path) = FOLLOW(ty)
|
|
|
|
macro_rules! follow_path {
|
|
|
|
($p:path {}) => {};
|
|
|
|
($p:path ,) => {};
|
|
|
|
($p:path =>) => {};
|
|
|
|
($p:path :) => {};
|
|
|
|
($p:path =) => {};
|
|
|
|
($p:path >) => {};
|
|
|
|
($p:path ;) => {};
|
|
|
|
($p:path |) => {};
|
|
|
|
($p:path as) => {};
|
|
|
|
($p:path where) => {};
|
|
|
|
($p:path []) => {};
|
2016-02-08 20:47:57 -06:00
|
|
|
($p:path $b:block) => {};
|
2016-01-23 12:37:54 -06:00
|
|
|
}
|
|
|
|
// FOLLOW(block) = any token
|
|
|
|
macro_rules! follow_block {
|
|
|
|
($b:block ()) => {};
|
|
|
|
($b:block []) => {};
|
|
|
|
($b:block {}) => {};
|
|
|
|
($b:block ,) => {};
|
|
|
|
($b:block =>) => {};
|
|
|
|
($b:block :) => {};
|
|
|
|
($b:block =) => {};
|
|
|
|
($b:block >) => {};
|
|
|
|
($b:block ;) => {};
|
|
|
|
($b:block |) => {};
|
|
|
|
($b:block +) => {};
|
|
|
|
($b:block ident) => {};
|
|
|
|
($b:block $p:pat) => {};
|
|
|
|
($b:block $e:expr) => {};
|
|
|
|
($b:block $t:ty) => {};
|
|
|
|
($b:block $s:stmt) => {};
|
|
|
|
($b:block $p:path) => {};
|
2019-01-15 12:25:41 -06:00
|
|
|
($b:block $c:block) => {};
|
2016-01-23 12:37:54 -06:00
|
|
|
($b:block $i:ident) => {};
|
|
|
|
($b:block $t:tt) => {};
|
|
|
|
($b:block $i:item) => {};
|
|
|
|
($b:block $m:meta) => {};
|
|
|
|
}
|
|
|
|
// FOLLOW(ident) = any token
|
|
|
|
macro_rules! follow_ident {
|
|
|
|
($i:ident ()) => {};
|
|
|
|
($i:ident []) => {};
|
|
|
|
($i:ident {}) => {};
|
|
|
|
($i:ident ,) => {};
|
|
|
|
($i:ident =>) => {};
|
|
|
|
($i:ident :) => {};
|
|
|
|
($i:ident =) => {};
|
|
|
|
($i:ident >) => {};
|
|
|
|
($i:ident ;) => {};
|
|
|
|
($i:ident |) => {};
|
|
|
|
($i:ident +) => {};
|
|
|
|
($i:ident ident) => {};
|
|
|
|
($i:ident $p:pat) => {};
|
|
|
|
($i:ident $e:expr) => {};
|
|
|
|
($i:ident $t:ty) => {};
|
|
|
|
($i:ident $s:stmt) => {};
|
|
|
|
($i:ident $p:path) => {};
|
|
|
|
($i:ident $b:block) => {};
|
2019-01-15 12:25:41 -06:00
|
|
|
($i:ident $j:ident) => {};
|
2016-01-23 12:37:54 -06:00
|
|
|
($i:ident $t:tt) => {};
|
2019-01-15 12:25:41 -06:00
|
|
|
($i:ident $j:item) => {};
|
2016-01-23 12:37:54 -06:00
|
|
|
($i:ident $m:meta) => {};
|
|
|
|
}
|
|
|
|
// FOLLOW(tt) = any token
|
|
|
|
macro_rules! follow_tt {
|
|
|
|
($t:tt ()) => {};
|
|
|
|
($t:tt []) => {};
|
|
|
|
($t:tt {}) => {};
|
|
|
|
($t:tt ,) => {};
|
|
|
|
($t:tt =>) => {};
|
|
|
|
($t:tt :) => {};
|
|
|
|
($t:tt =) => {};
|
|
|
|
($t:tt >) => {};
|
|
|
|
($t:tt ;) => {};
|
|
|
|
($t:tt |) => {};
|
|
|
|
($t:tt +) => {};
|
|
|
|
($t:tt ident) => {};
|
|
|
|
($t:tt $p:pat) => {};
|
|
|
|
($t:tt $e:expr) => {};
|
2019-01-15 12:25:41 -06:00
|
|
|
($t:tt $v:ty) => {};
|
2016-01-23 12:37:54 -06:00
|
|
|
($t:tt $s:stmt) => {};
|
|
|
|
($t:tt $p:path) => {};
|
|
|
|
($t:tt $b:block) => {};
|
|
|
|
($t:tt $i:ident) => {};
|
2019-01-15 12:25:41 -06:00
|
|
|
($t:tt $v:tt) => {};
|
2016-01-23 12:37:54 -06:00
|
|
|
($t:tt $i:item) => {};
|
|
|
|
($t:tt $m:meta) => {};
|
|
|
|
}
|
|
|
|
// FOLLOW(item) = any token
|
|
|
|
macro_rules! follow_item {
|
|
|
|
($i:item ()) => {};
|
|
|
|
($i:item []) => {};
|
|
|
|
($i:item {}) => {};
|
|
|
|
($i:item ,) => {};
|
|
|
|
($i:item =>) => {};
|
|
|
|
($i:item :) => {};
|
|
|
|
($i:item =) => {};
|
|
|
|
($i:item >) => {};
|
|
|
|
($i:item ;) => {};
|
|
|
|
($i:item |) => {};
|
|
|
|
($i:item +) => {};
|
|
|
|
($i:item ident) => {};
|
|
|
|
($i:item $p:pat) => {};
|
|
|
|
($i:item $e:expr) => {};
|
|
|
|
($i:item $t:ty) => {};
|
|
|
|
($i:item $s:stmt) => {};
|
|
|
|
($i:item $p:path) => {};
|
|
|
|
($i:item $b:block) => {};
|
2019-01-15 12:25:41 -06:00
|
|
|
($i:item $j:ident) => {};
|
2016-01-23 12:37:54 -06:00
|
|
|
($i:item $t:tt) => {};
|
2019-01-15 12:25:41 -06:00
|
|
|
($i:item $j:item) => {};
|
2016-01-23 12:37:54 -06:00
|
|
|
($i:item $m:meta) => {};
|
|
|
|
}
|
|
|
|
// FOLLOW(meta) = any token
|
|
|
|
macro_rules! follow_meta {
|
|
|
|
($m:meta ()) => {};
|
|
|
|
($m:meta []) => {};
|
|
|
|
($m:meta {}) => {};
|
|
|
|
($m:meta ,) => {};
|
|
|
|
($m:meta =>) => {};
|
|
|
|
($m:meta :) => {};
|
|
|
|
($m:meta =) => {};
|
|
|
|
($m:meta >) => {};
|
|
|
|
($m:meta ;) => {};
|
|
|
|
($m:meta |) => {};
|
|
|
|
($m:meta +) => {};
|
|
|
|
($m:meta ident) => {};
|
|
|
|
($m:meta $p:pat) => {};
|
|
|
|
($m:meta $e:expr) => {};
|
|
|
|
($m:meta $t:ty) => {};
|
|
|
|
($m:meta $s:stmt) => {};
|
|
|
|
($m:meta $p:path) => {};
|
|
|
|
($m:meta $b:block) => {};
|
|
|
|
($m:meta $i:ident) => {};
|
|
|
|
($m:meta $t:tt) => {};
|
|
|
|
($m:meta $i:item) => {};
|
2019-01-15 12:25:41 -06:00
|
|
|
($m:meta $n:meta) => {};
|
2016-01-23 12:37:54 -06:00
|
|
|
}
|
|
|
|
|
|
|
|
fn main() {}
|