From e163c908acff9260eff347541f0f3f57db551622 Mon Sep 17 00:00:00 2001 From: Florian Diebold Date: Sat, 2 Feb 2019 00:33:54 +0100 Subject: Add AST for extern crate Also change it to parse the crate name as a NAME_REF, not a NAME. --- crates/ra_syntax/src/ast/generated.rs | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'crates/ra_syntax/src/ast') diff --git a/crates/ra_syntax/src/ast/generated.rs b/crates/ra_syntax/src/ast/generated.rs index 60480c699..a8d60e882 100644 --- a/crates/ra_syntax/src/ast/generated.rs +++ b/crates/ra_syntax/src/ast/generated.rs @@ -970,7 +970,15 @@ impl ToOwned for ExternCrateItem { } -impl ExternCrateItem {} +impl ExternCrateItem { + pub fn name_ref(&self) -> Option<&NameRef> { + super::child_opt(self) + } + + pub fn alias(&self) -> Option<&Alias> { + super::child_opt(self) + } +} // FalseKw #[derive(Debug, PartialEq, Eq, Hash)] -- cgit v1.2.3