From 537ea620bb2a73a5e79872f414af23cf4bf03179 Mon Sep 17 00:00:00 2001 From: Aleksey Kladov Date: Tue, 28 Aug 2018 19:23:55 +0300 Subject: complete items from module scope --- crates/libsyntax2/src/ast/generated.rs | 4 ++++ crates/libsyntax2/src/grammar.ron | 1 + 2 files changed, 5 insertions(+) (limited to 'crates/libsyntax2/src') diff --git a/crates/libsyntax2/src/ast/generated.rs b/crates/libsyntax2/src/ast/generated.rs index b24fd2aba..2b400b847 100644 --- a/crates/libsyntax2/src/ast/generated.rs +++ b/crates/libsyntax2/src/ast/generated.rs @@ -1441,6 +1441,10 @@ impl<'a> AstNode<'a> for Root<'a> { } impl<'a> Root<'a> { + pub fn items(self) -> impl Iterator> + 'a { + super::children(self) + } + pub fn functions(self) -> impl Iterator> + 'a { super::children(self) } diff --git a/crates/libsyntax2/src/grammar.ron b/crates/libsyntax2/src/grammar.ron index c3a29c10c..8055a4687 100644 --- a/crates/libsyntax2/src/grammar.ron +++ b/crates/libsyntax2/src/grammar.ron @@ -238,6 +238,7 @@ Grammar( ast: { "Root": ( collections: [ + ["items", "ModuleItem"], ["functions", "FnDef"], ["modules", "Module"], ] -- cgit v1.2.3