mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-09-28 21:05:02 +00:00
internal: Thread edition through to parsing/tt-to-syntax-tree routines for macros
This commit is contained in:
parent
83370fe5d7
commit
a483d3bc37
39 changed files with 187 additions and 145 deletions
|
@ -6,7 +6,7 @@ mod matcher;
|
|||
mod transcriber;
|
||||
|
||||
use rustc_hash::FxHashMap;
|
||||
use span::Span;
|
||||
use span::{Edition, Span};
|
||||
use syntax::SmolStr;
|
||||
|
||||
use crate::{parser::MetaVarKind, ExpandError, ExpandResult};
|
||||
|
@ -17,10 +17,11 @@ pub(crate) fn expand_rules(
|
|||
marker: impl Fn(&mut Span) + Copy,
|
||||
new_meta_vars: bool,
|
||||
call_site: Span,
|
||||
def_site_edition: Edition,
|
||||
) -> ExpandResult<tt::Subtree<Span>> {
|
||||
let mut match_: Option<(matcher::Match, &crate::Rule)> = None;
|
||||
for rule in rules {
|
||||
let new_match = matcher::match_(&rule.lhs, input);
|
||||
let new_match = matcher::match_(&rule.lhs, input, def_site_edition);
|
||||
|
||||
if new_match.err.is_none() {
|
||||
// If we find a rule that applies without errors, we're done.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue