From c32529ddd0d66a219226dd63da2d4b1825375c0e Mon Sep 17 00:00:00 2001 From: Florian Diebold Date: Sun, 15 Mar 2020 11:17:13 +0100 Subject: Get tests working --- crates/ra_mbe/src/mbe_expander.rs | 6 +++--- crates/ra_mbe/src/syntax_bridge.rs | 1 + 2 files changed, 4 insertions(+), 3 deletions(-) (limited to 'crates/ra_mbe/src') diff --git a/crates/ra_mbe/src/mbe_expander.rs b/crates/ra_mbe/src/mbe_expander.rs index b2faa86d2..c2a5702f0 100644 --- a/crates/ra_mbe/src/mbe_expander.rs +++ b/crates/ra_mbe/src/mbe_expander.rs @@ -11,6 +11,7 @@ use rustc_hash::FxHashMap; use crate::{ExpandError, ExpandResult}; pub(crate) fn expand(rules: &crate::MacroRules, input: &tt::Subtree) -> ExpandResult { + eprintln!("expanding input: {:?}", input); let (mut result, mut unmatched_tokens, mut unmatched_patterns, mut err) = ( tt::Subtree::default(), usize::max_value(), @@ -39,9 +40,8 @@ fn expand_rule( rule: &crate::Rule, input: &tt::Subtree, ) -> ExpandResult<(tt::Subtree, usize, usize)> { - dbg!(&rule.lhs); - let (match_result, bindings_err) = dbg!(matcher::match_(&rule.lhs, input)); - let (res, transcribe_err) = dbg!(transcriber::transcribe(&rule.rhs, &match_result.bindings)); + let (match_result, bindings_err) = matcher::match_(&rule.lhs, input); + let (res, transcribe_err) = transcriber::transcribe(&rule.rhs, &match_result.bindings); ( (res, match_result.unmatched_tokens, match_result.unmatched_patterns), bindings_err.or(transcribe_err), diff --git a/crates/ra_mbe/src/syntax_bridge.rs b/crates/ra_mbe/src/syntax_bridge.rs index fcb73fbc7..8aa3b906b 100644 --- a/crates/ra_mbe/src/syntax_bridge.rs +++ b/crates/ra_mbe/src/syntax_bridge.rs @@ -73,6 +73,7 @@ pub fn token_tree_to_syntax_node( tt: &tt::Subtree, fragment_kind: FragmentKind, ) -> Result<(Parse, TokenMap), ExpandError> { + eprintln!("token_tree_to_syntax_node {:?} as {:?}", tt, fragment_kind); let tmp; let tokens = match tt { tt::Subtree { delimiter: None, token_trees } => token_trees.as_slice(), -- cgit v1.2.3