diff --git a/nemo/src/parser/ast.rs b/nemo/src/parser/ast.rs index 5f332cd1..18273b1e 100644 --- a/nemo/src/parser/ast.rs +++ b/nemo/src/parser/ast.rs @@ -21,7 +21,7 @@ use colored::Colorize; /// Trait implemented by nodes in the abstract syntax tree pub trait ProgramAST<'a>: Debug + Sync { /// Return all children of this node. - fn children(&'a self) -> Vec<&'a dyn ProgramAST<'a>>; + fn children(&self) -> Vec<&dyn ProgramAST<'a>>; /// Return the region of text this node originates from. fn span(&self) -> Span<'a>; diff --git a/nemo/src/parser/ast/attribute.rs b/nemo/src/parser/ast/attribute.rs index a82e23d0..a18579e9 100644 --- a/nemo/src/parser/ast/attribute.rs +++ b/nemo/src/parser/ast/attribute.rs @@ -31,7 +31,7 @@ impl<'a> Attribute<'a> { const CONTEXT: ParserContext = ParserContext::Attribute; impl<'a> ProgramAST<'a> for Attribute<'a> { - fn children(&self) -> Vec<&dyn ProgramAST> { + fn children(&self) -> Vec<&dyn ProgramAST<'a>> { vec![self.content()] } diff --git a/nemo/src/parser/ast/comment/closed.rs b/nemo/src/parser/ast/comment/closed.rs index 339934cf..05ab0960 100644 --- a/nemo/src/parser/ast/comment/closed.rs +++ b/nemo/src/parser/ast/comment/closed.rs @@ -35,7 +35,7 @@ impl ClosedComment<'_> { } impl<'a> ProgramAST<'a> for ClosedComment<'a> { - fn children(&self) -> Vec<&dyn ProgramAST> { + fn children(&self) -> Vec<&dyn ProgramAST<'a>> { Vec::default() } diff --git a/nemo/src/parser/ast/comment/doc.rs b/nemo/src/parser/ast/comment/doc.rs index cbe6fd91..afeaba81 100644 --- a/nemo/src/parser/ast/comment/doc.rs +++ b/nemo/src/parser/ast/comment/doc.rs @@ -38,7 +38,7 @@ impl DocComment<'_> { const CONTEXT: ParserContext = ParserContext::DocComment; impl<'a> ProgramAST<'a> for DocComment<'a> { - fn children(&self) -> Vec<&dyn ProgramAST> { + fn children(&self) -> Vec<&dyn ProgramAST<'a>> { Vec::default() } diff --git a/nemo/src/parser/ast/comment/line.rs b/nemo/src/parser/ast/comment/line.rs index 7fd3d53f..217c924a 100644 --- a/nemo/src/parser/ast/comment/line.rs +++ b/nemo/src/parser/ast/comment/line.rs @@ -35,7 +35,7 @@ impl LineComment<'_> { } impl<'a> ProgramAST<'a> for LineComment<'a> { - fn children(&self) -> Vec<&dyn ProgramAST> { + fn children(&self) -> Vec<&dyn ProgramAST<'a>> { Vec::default() } diff --git a/nemo/src/parser/ast/comment/toplevel.rs b/nemo/src/parser/ast/comment/toplevel.rs index 887903f3..a56e0180 100644 --- a/nemo/src/parser/ast/comment/toplevel.rs +++ b/nemo/src/parser/ast/comment/toplevel.rs @@ -39,7 +39,7 @@ impl TopLevelComment<'_> { } impl<'a> ProgramAST<'a> for TopLevelComment<'a> { - fn children(&self) -> Vec<&dyn ProgramAST> { + fn children(&self) -> Vec<&dyn ProgramAST<'a>> { Vec::default() } diff --git a/nemo/src/parser/ast/directive.rs b/nemo/src/parser/ast/directive.rs index d0b6819f..34a3b8d4 100644 --- a/nemo/src/parser/ast/directive.rs +++ b/nemo/src/parser/ast/directive.rs @@ -100,7 +100,7 @@ impl Directive<'_> { const CONTEXT: ParserContext = ParserContext::Directive; impl<'a> ProgramAST<'a> for Directive<'a> { - fn children(&self) -> Vec<&dyn ProgramAST> { + fn children(&self) -> Vec<&dyn ProgramAST<'a>> { vec![match self { Directive::Base(directive) => directive, Directive::Declare(directive) => directive, diff --git a/nemo/src/parser/ast/directive/base.rs b/nemo/src/parser/ast/directive/base.rs index fba9e856..1891f249 100644 --- a/nemo/src/parser/ast/directive/base.rs +++ b/nemo/src/parser/ast/directive/base.rs @@ -34,7 +34,7 @@ impl<'a> Base<'a> { const CONTEXT: ParserContext = ParserContext::Base; impl<'a> ProgramAST<'a> for Base<'a> { - fn children(&self) -> Vec<&dyn ProgramAST> { + fn children(&self) -> Vec<&dyn ProgramAST<'a>> { vec![&self.iri] } diff --git a/nemo/src/parser/ast/directive/declare.rs b/nemo/src/parser/ast/directive/declare.rs index b70522ad..4967a5ec 100644 --- a/nemo/src/parser/ast/directive/declare.rs +++ b/nemo/src/parser/ast/directive/declare.rs @@ -60,7 +60,7 @@ impl<'a> Declare<'a> { const CONTEXT: ParserContext = ParserContext::Declare; impl<'a> ProgramAST<'a> for Declare<'a> { - fn children(&self) -> Vec<&dyn ProgramAST> { + fn children(&self) -> Vec<&dyn ProgramAST<'a>> { let mut result = Vec::<&dyn ProgramAST>::new(); result.push(&self.predicate); diff --git a/nemo/src/parser/ast/directive/export.rs b/nemo/src/parser/ast/directive/export.rs index 37fb1c84..bd6d9348 100644 --- a/nemo/src/parser/ast/directive/export.rs +++ b/nemo/src/parser/ast/directive/export.rs @@ -71,7 +71,7 @@ impl<'a> Export<'a> { const CONTEXT: ParserContext = ParserContext::Export; impl<'a> ProgramAST<'a> for Export<'a> { - fn children(&self) -> Vec<&dyn ProgramAST> { + fn children(&self) -> Vec<&dyn ProgramAST<'a>> { vec![&self.predicate, &self.instructions] } diff --git a/nemo/src/parser/ast/directive/import.rs b/nemo/src/parser/ast/directive/import.rs index 820ad09f..eb54207e 100644 --- a/nemo/src/parser/ast/directive/import.rs +++ b/nemo/src/parser/ast/directive/import.rs @@ -72,7 +72,7 @@ impl<'a> Import<'a> { const CONTEXT: ParserContext = ParserContext::Import; impl<'a> ProgramAST<'a> for Import<'a> { - fn children(&self) -> Vec<&dyn ProgramAST> { + fn children(&self) -> Vec<&dyn ProgramAST<'a>> { vec![&self.predicate, &self.instructions] } diff --git a/nemo/src/parser/ast/directive/output.rs b/nemo/src/parser/ast/directive/output.rs index 93331b11..2ab95de1 100644 --- a/nemo/src/parser/ast/directive/output.rs +++ b/nemo/src/parser/ast/directive/output.rs @@ -40,7 +40,7 @@ impl<'a> Output<'a> { const CONTEXT: ParserContext = ParserContext::Output; impl<'a> ProgramAST<'a> for Output<'a> { - fn children(&self) -> Vec<&dyn ProgramAST> { + fn children(&self) -> Vec<&dyn ProgramAST<'a>> { vec![&self.predicate] } diff --git a/nemo/src/parser/ast/directive/prefix.rs b/nemo/src/parser/ast/directive/prefix.rs index 9accc70a..6e40d0fa 100644 --- a/nemo/src/parser/ast/directive/prefix.rs +++ b/nemo/src/parser/ast/directive/prefix.rs @@ -57,7 +57,7 @@ impl<'a> Prefix<'a> { const CONTEXT: ParserContext = ParserContext::Prefix; impl<'a> ProgramAST<'a> for Prefix<'a> { - fn children(&self) -> Vec<&dyn ProgramAST> { + fn children(&self) -> Vec<&dyn ProgramAST<'a>> { vec![&self.iri] } diff --git a/nemo/src/parser/ast/directive/unknown.rs b/nemo/src/parser/ast/directive/unknown.rs index 9f1eac7a..7d3201e1 100644 --- a/nemo/src/parser/ast/directive/unknown.rs +++ b/nemo/src/parser/ast/directive/unknown.rs @@ -79,7 +79,7 @@ impl<'a> UnknownDirective<'a> { const CONTEXT: ParserContext = ParserContext::UnknownDirective; impl<'a> ProgramAST<'a> for UnknownDirective<'a> { - fn children(&self) -> Vec<&dyn ProgramAST> { + fn children(&self) -> Vec<&dyn ProgramAST<'a>> { Vec::default() } diff --git a/nemo/src/parser/ast/expression.rs b/nemo/src/parser/ast/expression.rs index b8c58825..510c2db3 100644 --- a/nemo/src/parser/ast/expression.rs +++ b/nemo/src/parser/ast/expression.rs @@ -112,7 +112,7 @@ impl<'a> Expression<'a> { const CONTEXT: ParserContext = ParserContext::Expression; impl<'a> ProgramAST<'a> for Expression<'a> { - fn children(&self) -> Vec<&dyn ProgramAST> { + fn children(&self) -> Vec<&dyn ProgramAST<'a>> { vec![match self { Expression::Aggregation(expression) => expression, Expression::Arithmetic(expression) => expression, diff --git a/nemo/src/parser/ast/expression/basic/blank.rs b/nemo/src/parser/ast/expression/basic/blank.rs index d01b4e6e..aa132ab0 100644 --- a/nemo/src/parser/ast/expression/basic/blank.rs +++ b/nemo/src/parser/ast/expression/basic/blank.rs @@ -35,7 +35,7 @@ impl<'a> Blank<'a> { const CONTEXT: ParserContext = ParserContext::Blank; impl<'a> ProgramAST<'a> for Blank<'a> { - fn children(&self) -> Vec<&dyn ProgramAST> { + fn children(&self) -> Vec<&dyn ProgramAST<'a>> { Vec::default() } diff --git a/nemo/src/parser/ast/expression/basic/boolean.rs b/nemo/src/parser/ast/expression/basic/boolean.rs index 95c59531..39b74384 100644 --- a/nemo/src/parser/ast/expression/basic/boolean.rs +++ b/nemo/src/parser/ast/expression/basic/boolean.rs @@ -58,7 +58,7 @@ impl<'a> Boolean<'a> { const CONTEXT: ParserContext = ParserContext::Boolean; impl<'a> ProgramAST<'a> for Boolean<'a> { - fn children(&self) -> Vec<&dyn ProgramAST> { + fn children(&self) -> Vec<&dyn ProgramAST<'a>> { Vec::default() } diff --git a/nemo/src/parser/ast/expression/basic/constant.rs b/nemo/src/parser/ast/expression/basic/constant.rs index d38f3a41..efd51e9d 100644 --- a/nemo/src/parser/ast/expression/basic/constant.rs +++ b/nemo/src/parser/ast/expression/basic/constant.rs @@ -28,7 +28,7 @@ impl<'a> Constant<'a> { const CONTEXT: ParserContext = ParserContext::Constant; impl<'a> ProgramAST<'a> for Constant<'a> { - fn children(&self) -> Vec<&dyn ProgramAST> { + fn children(&self) -> Vec<&dyn ProgramAST<'a>> { Vec::default() } diff --git a/nemo/src/parser/ast/expression/basic/iri.rs b/nemo/src/parser/ast/expression/basic/iri.rs index 8fd0229e..193ceb6b 100644 --- a/nemo/src/parser/ast/expression/basic/iri.rs +++ b/nemo/src/parser/ast/expression/basic/iri.rs @@ -31,7 +31,7 @@ impl Iri<'_> { const CONTEXT: ParserContext = ParserContext::Iri; impl<'a> ProgramAST<'a> for Iri<'a> { - fn children(&self) -> Vec<&dyn ProgramAST> { + fn children(&self) -> Vec<&dyn ProgramAST<'a>> { Vec::default() } diff --git a/nemo/src/parser/ast/expression/basic/number.rs b/nemo/src/parser/ast/expression/basic/number.rs index 35937283..07fd1153 100644 --- a/nemo/src/parser/ast/expression/basic/number.rs +++ b/nemo/src/parser/ast/expression/basic/number.rs @@ -184,7 +184,7 @@ impl<'a> Number<'a> { const CONTEXT: ParserContext = ParserContext::Number; impl<'a> ProgramAST<'a> for Number<'a> { - fn children(&self) -> Vec<&dyn ProgramAST> { + fn children(&self) -> Vec<&dyn ProgramAST<'a>> { Vec::default() } diff --git a/nemo/src/parser/ast/expression/basic/rdf_literal.rs b/nemo/src/parser/ast/expression/basic/rdf_literal.rs index 7350636c..ede6911e 100644 --- a/nemo/src/parser/ast/expression/basic/rdf_literal.rs +++ b/nemo/src/parser/ast/expression/basic/rdf_literal.rs @@ -44,7 +44,7 @@ impl<'a> RdfLiteral<'a> { const CONTEXT: ParserContext = ParserContext::RdfLiteral; impl<'a> ProgramAST<'a> for RdfLiteral<'a> { - fn children(&self) -> Vec<&dyn ProgramAST> { + fn children(&self) -> Vec<&dyn ProgramAST<'a>> { Vec::default() } diff --git a/nemo/src/parser/ast/expression/basic/string.rs b/nemo/src/parser/ast/expression/basic/string.rs index 2e4dc889..7d77b086 100644 --- a/nemo/src/parser/ast/expression/basic/string.rs +++ b/nemo/src/parser/ast/expression/basic/string.rs @@ -63,7 +63,7 @@ impl<'a> StringLiteral<'a> { const CONTEXT: ParserContext = ParserContext::String; impl<'a> ProgramAST<'a> for StringLiteral<'a> { - fn children(&self) -> Vec<&dyn ProgramAST> { + fn children(&self) -> Vec<&dyn ProgramAST<'a>> { Vec::default() } diff --git a/nemo/src/parser/ast/expression/basic/variable.rs b/nemo/src/parser/ast/expression/basic/variable.rs index 7afc77c8..c513e0f5 100644 --- a/nemo/src/parser/ast/expression/basic/variable.rs +++ b/nemo/src/parser/ast/expression/basic/variable.rs @@ -78,7 +78,7 @@ impl<'a> Variable<'a> { const CONTEXT: ParserContext = ParserContext::Variable; impl<'a> ProgramAST<'a> for Variable<'a> { - fn children(&self) -> Vec<&dyn ProgramAST> { + fn children(&self) -> Vec<&dyn ProgramAST<'a>> { Vec::default() } diff --git a/nemo/src/parser/ast/expression/complex/aggregation.rs b/nemo/src/parser/ast/expression/complex/aggregation.rs index f1d153ed..15e9fc7b 100644 --- a/nemo/src/parser/ast/expression/complex/aggregation.rs +++ b/nemo/src/parser/ast/expression/complex/aggregation.rs @@ -59,7 +59,7 @@ impl<'a> Aggregation<'a> { const CONTEXT: ParserContext = ParserContext::Aggregation; impl<'a> ProgramAST<'a> for Aggregation<'a> { - fn children(&self) -> Vec<&dyn ProgramAST> { + fn children(&self) -> Vec<&dyn ProgramAST<'a>> { let mut result: Vec<&dyn ProgramAST> = vec![]; result.push(&self.tag); result.push(&*self.aggregate); diff --git a/nemo/src/parser/ast/expression/complex/arithmetic.rs b/nemo/src/parser/ast/expression/complex/arithmetic.rs index 9284eb55..f5071e42 100644 --- a/nemo/src/parser/ast/expression/complex/arithmetic.rs +++ b/nemo/src/parser/ast/expression/complex/arithmetic.rs @@ -248,7 +248,7 @@ impl<'a> Arithmetic<'a> { const CONTEXT: ParserContext = ParserContext::Arithmetic; impl<'a> ProgramAST<'a> for Arithmetic<'a> { - fn children(&self) -> Vec<&dyn ProgramAST> { + fn children(&self) -> Vec<&dyn ProgramAST<'a>> { vec![&*self.left, &*self.right] } diff --git a/nemo/src/parser/ast/expression/complex/atom.rs b/nemo/src/parser/ast/expression/complex/atom.rs index 08610e2a..08d8eb95 100644 --- a/nemo/src/parser/ast/expression/complex/atom.rs +++ b/nemo/src/parser/ast/expression/complex/atom.rs @@ -40,7 +40,7 @@ impl<'a> Atom<'a> { const CONTEXT: ParserContext = ParserContext::Atom; impl<'a> ProgramAST<'a> for Atom<'a> { - fn children(&self) -> Vec<&dyn ProgramAST> { + fn children(&self) -> Vec<&dyn ProgramAST<'a>> { let mut result = Vec::<&dyn ProgramAST>::new(); result.push(&self.tag); diff --git a/nemo/src/parser/ast/expression/complex/fstring.rs b/nemo/src/parser/ast/expression/complex/fstring.rs index 625ea2a9..59eb24d1 100644 --- a/nemo/src/parser/ast/expression/complex/fstring.rs +++ b/nemo/src/parser/ast/expression/complex/fstring.rs @@ -66,7 +66,7 @@ impl<'a> FormatString<'a> { const CONTEXT: ParserContext = ParserContext::FormatString; impl<'a> ProgramAST<'a> for FormatString<'a> { - fn children(&self) -> Vec<&dyn ProgramAST> { + fn children(&self) -> Vec<&dyn ProgramAST<'a>> { let mut result = Vec::<&dyn ProgramAST>::new(); for element in &self.elements { diff --git a/nemo/src/parser/ast/expression/complex/infix.rs b/nemo/src/parser/ast/expression/complex/infix.rs index 15f3b90c..603ba985 100644 --- a/nemo/src/parser/ast/expression/complex/infix.rs +++ b/nemo/src/parser/ast/expression/complex/infix.rs @@ -92,7 +92,7 @@ impl<'a> InfixExpression<'a> { const CONTEXT: ParserContext = ParserContext::Infix; impl<'a> ProgramAST<'a> for InfixExpression<'a> { - fn children(&self) -> Vec<&dyn ProgramAST> { + fn children(&self) -> Vec<&dyn ProgramAST<'a>> { vec![&*self.left, &*self.right] } diff --git a/nemo/src/parser/ast/expression/complex/map.rs b/nemo/src/parser/ast/expression/complex/map.rs index 76880021..03d8aeb8 100644 --- a/nemo/src/parser/ast/expression/complex/map.rs +++ b/nemo/src/parser/ast/expression/complex/map.rs @@ -47,7 +47,7 @@ impl<'a> Map<'a> { const CONTEXT: ParserContext = ParserContext::Map; impl<'a> ProgramAST<'a> for Map<'a> { - fn children(&self) -> Vec<&dyn ProgramAST> { + fn children(&self) -> Vec<&dyn ProgramAST<'a>> { let mut result: Vec<&dyn ProgramAST> = vec![]; if let Some(tag) = &self.tag { diff --git a/nemo/src/parser/ast/expression/complex/negation.rs b/nemo/src/parser/ast/expression/complex/negation.rs index 34d35a21..4da42aa4 100644 --- a/nemo/src/parser/ast/expression/complex/negation.rs +++ b/nemo/src/parser/ast/expression/complex/negation.rs @@ -30,7 +30,7 @@ impl<'a> Negation<'a> { const CONTEXT: ParserContext = ParserContext::Negation; impl<'a> ProgramAST<'a> for Negation<'a> { - fn children(&self) -> Vec<&dyn ProgramAST> { + fn children(&self) -> Vec<&dyn ProgramAST<'a>> { vec![&*self.expression] } diff --git a/nemo/src/parser/ast/expression/complex/operation.rs b/nemo/src/parser/ast/expression/complex/operation.rs index 9352c6a0..0c2619d3 100644 --- a/nemo/src/parser/ast/expression/complex/operation.rs +++ b/nemo/src/parser/ast/expression/complex/operation.rs @@ -45,7 +45,7 @@ impl<'a> Operation<'a> { const CONTEXT: ParserContext = ParserContext::Operation; impl<'a> ProgramAST<'a> for Operation<'a> { - fn children(&self) -> Vec<&dyn ProgramAST> { + fn children(&self) -> Vec<&dyn ProgramAST<'a>> { let mut result = Vec::<&dyn ProgramAST>::new(); result.push(&self.tag); diff --git a/nemo/src/parser/ast/expression/complex/parenthesized.rs b/nemo/src/parser/ast/expression/complex/parenthesized.rs index 1b8c94de..ed0b3cb3 100644 --- a/nemo/src/parser/ast/expression/complex/parenthesized.rs +++ b/nemo/src/parser/ast/expression/complex/parenthesized.rs @@ -37,7 +37,7 @@ impl<'a> ParenthesizedExpression<'a> { const CONTEXT: ParserContext = ParserContext::ParenthesizedExpression; impl<'a> ProgramAST<'a> for ParenthesizedExpression<'a> { - fn children(&'a self) -> Vec<&'a dyn ProgramAST<'a>> { + fn children(&self) -> Vec<&dyn ProgramAST<'a>> { vec![&*self.expression] } diff --git a/nemo/src/parser/ast/expression/complex/tuple.rs b/nemo/src/parser/ast/expression/complex/tuple.rs index fb0d5eed..508159d0 100644 --- a/nemo/src/parser/ast/expression/complex/tuple.rs +++ b/nemo/src/parser/ast/expression/complex/tuple.rs @@ -32,7 +32,7 @@ impl<'a> Tuple<'a> { const CONTEXT: ParserContext = ParserContext::Tuple; impl<'a> ProgramAST<'a> for Tuple<'a> { - fn children(&self) -> Vec<&dyn ProgramAST> { + fn children(&self) -> Vec<&dyn ProgramAST<'a>> { let mut result = Vec::<&dyn ProgramAST>::new(); for expression in &self.expressions { diff --git a/nemo/src/parser/ast/guard.rs b/nemo/src/parser/ast/guard.rs index d30304c2..ba37ef5a 100644 --- a/nemo/src/parser/ast/guard.rs +++ b/nemo/src/parser/ast/guard.rs @@ -31,7 +31,7 @@ impl Guard<'_> { const CONTEXT: ParserContext = ParserContext::Guard; impl<'a> ProgramAST<'a> for Guard<'a> { - fn children(&'a self) -> Vec<&'a dyn ProgramAST<'a>> { + fn children(&self) -> Vec<&dyn ProgramAST<'a>> { match self { Guard::Expression(expression) => expression.children(), Guard::Infix(infix) => infix.children(), diff --git a/nemo/src/parser/ast/program.rs b/nemo/src/parser/ast/program.rs index 0877793c..458e79b4 100644 --- a/nemo/src/parser/ast/program.rs +++ b/nemo/src/parser/ast/program.rs @@ -58,7 +58,7 @@ impl<'a> Program<'a> { const CONTEXT: ParserContext = ParserContext::Program; impl<'a> ProgramAST<'a> for Program<'a> { - fn children(&self) -> Vec<&dyn ProgramAST> { + fn children(&self) -> Vec<&dyn ProgramAST<'a>> { let mut result = Vec::<&dyn ProgramAST>::new(); if let Some(comment) = self.comment() { diff --git a/nemo/src/parser/ast/rule.rs b/nemo/src/parser/ast/rule.rs index 31e617df..8bb7b4e1 100644 --- a/nemo/src/parser/ast/rule.rs +++ b/nemo/src/parser/ast/rule.rs @@ -52,7 +52,7 @@ impl<'a> Rule<'a> { const CONTEXT: ParserContext = ParserContext::Rule; impl<'a> ProgramAST<'a> for Rule<'a> { - fn children(&self) -> Vec<&dyn ProgramAST> { + fn children(&self) -> Vec<&dyn ProgramAST<'a>> { let mut result = Vec::<&dyn ProgramAST>::new(); for expression in self.head().chain(self.body()) { diff --git a/nemo/src/parser/ast/sequence.rs b/nemo/src/parser/ast/sequence.rs index 2c0d1258..5e38821c 100644 --- a/nemo/src/parser/ast/sequence.rs +++ b/nemo/src/parser/ast/sequence.rs @@ -98,7 +98,7 @@ impl<'a, T: ProgramAST<'a> + 'a> Sequence<'a, T> { } impl<'a, T: std::fmt::Debug + Sync + ProgramAST<'a>> ProgramAST<'a> for Sequence<'a, T> { - fn children(&'a self) -> Vec<&'a dyn ProgramAST<'a>> { + fn children(&self) -> Vec<&dyn ProgramAST<'a>> { let mut vec: Vec<&dyn ProgramAST> = Vec::new(); for elem in &self.elements { vec.push(elem); diff --git a/nemo/src/parser/ast/sequence/declare.rs b/nemo/src/parser/ast/sequence/declare.rs index 6012e4c4..c9ef82e0 100644 --- a/nemo/src/parser/ast/sequence/declare.rs +++ b/nemo/src/parser/ast/sequence/declare.rs @@ -29,7 +29,7 @@ pub struct NameTypePair<'a> { } impl<'a> ProgramAST<'a> for NameTypePair<'a> { - fn children(&'a self) -> Vec<&'a dyn ProgramAST<'a>> { + fn children(&self) -> Vec<&dyn ProgramAST<'a>> { if let Some(datatype) = &self.datatype { vec![&self.name, datatype] } else { diff --git a/nemo/src/parser/ast/sequence/key_value.rs b/nemo/src/parser/ast/sequence/key_value.rs index 95d63c77..5ca3500b 100644 --- a/nemo/src/parser/ast/sequence/key_value.rs +++ b/nemo/src/parser/ast/sequence/key_value.rs @@ -29,7 +29,7 @@ impl<'a> KeyValuePair<'a> { } impl<'a> ProgramAST<'a> for KeyValuePair<'a> { - fn children(&'a self) -> Vec<&'a dyn ProgramAST<'a>> { + fn children(&self) -> Vec<&dyn ProgramAST<'a>> { vec![&self.key, &self.value] } diff --git a/nemo/src/parser/ast/statement.rs b/nemo/src/parser/ast/statement.rs index 6647f1e0..e33d1083 100644 --- a/nemo/src/parser/ast/statement.rs +++ b/nemo/src/parser/ast/statement.rs @@ -88,7 +88,7 @@ impl<'a> Statement<'a> { const CONTEXT: ParserContext = ParserContext::Statement; impl<'a> ProgramAST<'a> for Statement<'a> { - fn children(&self) -> Vec<&dyn ProgramAST> { + fn children(&self) -> Vec<&dyn ProgramAST<'a>> { match &self.kind { StatementKind::Fact(statement) => vec![statement], StatementKind::Rule(statement) => vec![statement], diff --git a/nemo/src/parser/ast/tag/aggregation.rs b/nemo/src/parser/ast/tag/aggregation.rs index b4fddc2d..76ca1aec 100644 --- a/nemo/src/parser/ast/tag/aggregation.rs +++ b/nemo/src/parser/ast/tag/aggregation.rs @@ -41,7 +41,7 @@ impl AggregationTag<'_> { const CONTEXT: ParserContext = ParserContext::AggregationTag; impl<'a> ProgramAST<'a> for AggregationTag<'a> { - fn children(&self) -> Vec<&dyn ProgramAST> { + fn children(&self) -> Vec<&dyn ProgramAST<'a>> { Vec::default() } diff --git a/nemo/src/parser/ast/tag/datatype.rs b/nemo/src/parser/ast/tag/datatype.rs index 8e3fd837..f7e8ec23 100644 --- a/nemo/src/parser/ast/tag/datatype.rs +++ b/nemo/src/parser/ast/tag/datatype.rs @@ -36,7 +36,7 @@ impl DataTypeTag<'_> { const CONTEXT: ParserContext = ParserContext::DataType; impl<'a> ProgramAST<'a> for DataTypeTag<'a> { - fn children(&self) -> Vec<&dyn ProgramAST> { + fn children(&self) -> Vec<&dyn ProgramAST<'a>> { Vec::default() } diff --git a/nemo/src/parser/ast/tag/operation.rs b/nemo/src/parser/ast/tag/operation.rs index de78f35f..837c3d2c 100644 --- a/nemo/src/parser/ast/tag/operation.rs +++ b/nemo/src/parser/ast/tag/operation.rs @@ -36,7 +36,7 @@ impl OperationTag<'_> { const CONTEXT: ParserContext = ParserContext::OperationTag; impl<'a> ProgramAST<'a> for OperationTag<'a> { - fn children(&self) -> Vec<&dyn ProgramAST> { + fn children(&self) -> Vec<&dyn ProgramAST<'a>> { Vec::default() } diff --git a/nemo/src/parser/ast/tag/parameter.rs b/nemo/src/parser/ast/tag/parameter.rs index 310a5cab..18d5391b 100644 --- a/nemo/src/parser/ast/tag/parameter.rs +++ b/nemo/src/parser/ast/tag/parameter.rs @@ -39,7 +39,7 @@ impl ParameterName<'_> { const CONTEXT: ParserContext = ParserContext::DataType; impl<'a> ProgramAST<'a> for ParameterName<'a> { - fn children(&self) -> Vec<&dyn ProgramAST> { + fn children(&self) -> Vec<&dyn ProgramAST<'a>> { Vec::default() } diff --git a/nemo/src/parser/ast/tag/structure.rs b/nemo/src/parser/ast/tag/structure.rs index d20d3706..0ff7b741 100644 --- a/nemo/src/parser/ast/tag/structure.rs +++ b/nemo/src/parser/ast/tag/structure.rs @@ -60,7 +60,7 @@ impl Display for StructureTag<'_> { const CONTEXT: ParserContext = ParserContext::StructureTag; impl<'a> ProgramAST<'a> for StructureTag<'a> { - fn children(&self) -> Vec<&dyn ProgramAST> { + fn children(&self) -> Vec<&dyn ProgramAST<'a>> { match self.kind() { StructureTagKind::Plain(_token) => vec![], StructureTagKind::Prefixed { prefix: _, tag: _ } => vec![],