Remove stray source files (#408)
This commit is contained in:
parent
85336f09b0
commit
aa81f458d0
30
functions.rs
30
functions.rs
@ -1,30 +0,0 @@
|
||||
use crate::common::*;
|
||||
|
||||
pub struct Functions<'a> {
|
||||
stack: Vec<&'a Expression<'a>>,
|
||||
}
|
||||
|
||||
impl<'a> Iterator for Functions<'a> {
|
||||
type Item = (&'a Token<'a>, usize);
|
||||
|
||||
fn next(&mut self) -> Option<Self::Item> {
|
||||
match self.stack.pop() {
|
||||
None
|
||||
| Some(Expression::String { .. })
|
||||
| Some(Expression::Backtick { .. })
|
||||
| Some(Expression::Variable { .. }) => None,
|
||||
Some(Expression::Call {
|
||||
token, arguments, ..
|
||||
}) => Some((token, arguments.len())),
|
||||
Some(Expression::Concatination { lhs, rhs }) => {
|
||||
self.stack.push(lhs);
|
||||
self.stack.push(rhs);
|
||||
self.next()
|
||||
}
|
||||
Some(Expression::Group { expression }) => {
|
||||
self.stack.push(expression);
|
||||
self.next()
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
28
variables.rs
28
variables.rs
@ -1,28 +0,0 @@
|
||||
use crate::common::*;
|
||||
|
||||
pub struct Variables<'a> {
|
||||
stack: Vec<&'a Expression<'a>>,
|
||||
}
|
||||
|
||||
impl<'a> Iterator for Variables<'a> {
|
||||
type Item = &'a Token<'a>;
|
||||
|
||||
fn next(&mut self) -> Option<&'a Token<'a>> {
|
||||
match self.stack.pop() {
|
||||
None
|
||||
| Some(Expression::String { .. })
|
||||
| Some(Expression::Backtick { .. })
|
||||
| Some(Expression::Call { .. }) => None,
|
||||
Some(Expression::Variable { token, .. }) => Some(token),
|
||||
Some(Expression::Concatination { lhs, rhs }) => {
|
||||
self.stack.push(lhs);
|
||||
self.stack.push(rhs);
|
||||
self.next()
|
||||
}
|
||||
Some(Expression::Group { expression }) => {
|
||||
self.stack.push(expression);
|
||||
self.next()
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue
Block a user