diff options
Diffstat (limited to 'crates/ra_hir_expand/src/lib.rs')
-rw-r--r-- | crates/ra_hir_expand/src/lib.rs | 12 |
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; | |||
10 | pub mod name; | 10 | pub mod name; |
11 | pub mod hygiene; | 11 | pub mod hygiene; |
12 | pub mod diagnostics; | 12 | pub mod diagnostics; |
13 | pub mod builtin_macro; | ||
14 | pub mod quote; | ||
13 | 15 | ||
14 | use std::hash::{Hash, Hasher}; | 16 | use std::hash::{Hash, Hasher}; |
15 | use std::sync::Arc; | 17 | use std::sync::Arc; |
@@ -21,6 +23,7 @@ use ra_syntax::{ | |||
21 | }; | 23 | }; |
22 | 24 | ||
23 | use crate::ast_id_map::FileAstId; | 25 | use crate::ast_id_map::FileAstId; |
26 | use 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 { | |||
122 | pub struct MacroDefId { | 125 | pub 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)] | ||
132 | pub 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 | } |