diff --git a/.gitignore b/.gitignore
index 876440e..468ecee 100644
--- a/.gitignore
+++ b/.gitignore
@@ -2,3 +2,6 @@ publish.sh
Cargo.toml
Cargo.lock
target
+dependencies.txt
+bellande_rustinstaller.py
+scripts
diff --git a/executable/bellos b/executable/bellos
new file mode 100755
index 0000000..309f5ee
Binary files /dev/null and b/executable/bellos differ
diff --git a/src/bellos.rs b/src/bellos.rs
index 6d0b1ed..e41f411 100644
--- a/src/bellos.rs
+++ b/src/bellos.rs
@@ -13,11 +13,12 @@
// You should have received a copy of the GNU General Public License
// along with this program. If not, see .
+#[allow(dead_code)]
use glob::glob;
use std::collections::HashMap;
use std::env;
-use std::fs::{self, File};
-use std::io::{self, Read, Write};
+use std::fs::File;
+use std::io::{self, BufRead, Read, Write};
use std::os::unix::io::AsRawFd;
use std::process::{Child, Command, Stdio};
use std::sync::{Arc, Mutex};
@@ -245,14 +246,11 @@ impl Parser {
self.position += 1;
let value = match &self.tokens[self.position] {
Token::Word(w) => w.clone(),
- _ => {
- return Err(format!(
- "Expected word after assignment, found {:?}",
- self.tokens[self.position]
- ))
- }
+ _ => String::new(), // Allow empty assignments
};
- self.position += 1;
+ if self.position < self.tokens.len() {
+ self.position += 1;
+ }
Ok(ASTNode::Assignment { name, value })
} else {
let mut args = Vec::new();
@@ -264,6 +262,7 @@ impl Parser {
| Token::Semicolon
| Token::NewLine
| Token::Ampersand
+ | Token::Assignment
)
{
if let Token::Word(w) = &self.tokens[self.position] {
@@ -273,8 +272,7 @@ impl Parser {
break;
}
}
- let command = ASTNode::Command { name, args };
- self.parse_pipeline_or_redirect(command)
+ Ok(ASTNode::Command { name, args })
}
}
@@ -644,17 +642,14 @@ impl Interpreter {
node: Box,
input: String,
) -> Result