aboutsummaryrefslogtreecommitdiff
path: root/crates/ra_hir_expand/src/lib.rs
diff options
context:
space:
mode:
Diffstat (limited to 'crates/ra_hir_expand/src/lib.rs')
-rw-r--r--crates/ra_hir_expand/src/lib.rs12
1 files changed, 11 insertions, 1 deletions
diff --git a/crates/ra_hir_expand/src/lib.rs b/crates/ra_hir_expand/src/lib.rs
index 151d1d785..c6ffa2c6f 100644
--- a/crates/ra_hir_expand/src/lib.rs
+++ b/crates/ra_hir_expand/src/lib.rs
@@ -10,6 +10,8 @@ pub mod either;
10pub mod name; 10pub mod name;
11pub mod hygiene; 11pub mod hygiene;
12pub mod diagnostics; 12pub mod diagnostics;
13pub mod builtin_macro;
14pub mod quote;
13 15
14use std::hash::{Hash, Hasher}; 16use std::hash::{Hash, Hasher};
15use std::sync::Arc; 17use std::sync::Arc;
@@ -21,6 +23,7 @@ use ra_syntax::{
21}; 23};
22 24
23use crate::ast_id_map::FileAstId; 25use crate::ast_id_map::FileAstId;
26use crate::builtin_macro::BuiltinExpander;
24 27
25/// Input to the analyzer is a set of files, where each file is identified by 28/// Input to the analyzer is a set of files, where each file is identified by
26/// `FileId` and contains source code. However, another source of source code in 29/// `FileId` and contains source code. However, another source of source code in
@@ -122,6 +125,13 @@ impl salsa::InternKey for MacroCallId {
122pub struct MacroDefId { 125pub struct MacroDefId {
123 pub krate: CrateId, 126 pub krate: CrateId,
124 pub ast_id: AstId<ast::MacroCall>, 127 pub ast_id: AstId<ast::MacroCall>,
128 pub kind: MacroDefKind,
129}
130
131#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash)]
132pub enum MacroDefKind {
133 Declarative,
134 BuiltIn(BuiltinExpander),
125} 135}
126 136
127#[derive(Debug, Clone, PartialEq, Eq, Hash)] 137#[derive(Debug, Clone, PartialEq, Eq, Hash)]
@@ -144,7 +154,7 @@ pub struct ExpansionInfo {
144 pub(crate) def_start: (HirFileId, TextUnit), 154 pub(crate) def_start: (HirFileId, TextUnit),
145 pub(crate) shift: u32, 155 pub(crate) shift: u32,
146 156
147 pub(crate) macro_def: Arc<(mbe::MacroRules, mbe::TokenMap)>, 157 pub(crate) macro_def: Arc<(db::TokenExpander, mbe::TokenMap)>,
148 pub(crate) macro_arg: Arc<(tt::Subtree, mbe::TokenMap)>, 158 pub(crate) macro_arg: Arc<(tt::Subtree, mbe::TokenMap)>,
149 pub(crate) exp_map: Arc<mbe::RevTokenMap>, 159 pub(crate) exp_map: Arc<mbe::RevTokenMap>,
150} 160}