syntax_pos: Introduce a helper for checking whether a span comes from expansion

This commit is contained in:
Vadim Petrochenkov 2019-08-11 01:08:30 +03:00
parent f7af19c279
commit dfcbe75900
12 changed files with 25 additions and 20 deletions

View file

@ -1101,7 +1101,7 @@ impl<'a> Parser<'a> {
crate fn process_potential_macro_variable(&mut self) {
self.token = match self.token.kind {
token::Dollar if self.token.span.ctxt() != SyntaxContext::empty() &&
token::Dollar if self.token.span.from_expansion() &&
self.look_ahead(1, |t| t.is_ident()) => {
self.bump();
let name = match self.token.kind {