From 6bcee16b12284d5e2b5f7bc99f42bc13b687efe5 Mon Sep 17 00:00:00 2001 From: cp400color Date: Mon, 15 Sep 2025 14:33:01 +0000 Subject: [PATCH 1/9] Remove --check flag from recommend and example oxfile --- .ox/oxfile | 3 --- src/commands/recommend.rs | 2 +- src/main.rs | 11 ++--------- 3 files changed, 3 insertions(+), 13 deletions(-) diff --git a/.ox/oxfile b/.ox/oxfile index 6fa1878..6b9130d 100644 --- a/.ox/oxfile +++ b/.ox/oxfile @@ -19,6 +19,3 @@ dont recommend mypy dont env raw dont git nosubmodules - -# this will disable automatically checking if installed: -# dont check \ No newline at end of file diff --git a/src/commands/recommend.rs b/src/commands/recommend.rs index 85851ab..6cb501a 100644 --- a/src/commands/recommend.rs +++ b/src/commands/recommend.rs @@ -1,3 +1,3 @@ -pub fn recommend(check: bool) { +pub fn recommend() { } \ No newline at end of file diff --git a/src/main.rs b/src/main.rs index 1aa39f0..98bc081 100644 --- a/src/main.rs +++ b/src/main.rs @@ -28,12 +28,7 @@ fn build_cli() -> Command { ) .subcommand( Command::new("recommend") - .about("List recommended software") - .arg( - arg!(--check) - .help("Check if recommendations are installed") - .required(false), - ), + .about("List and check recommended software") ) .subcommand( Command::new("clone") @@ -68,9 +63,7 @@ fn main() { sub_matches.get_one::("SUBSCRIPT"), sub_matches.get_many::("EXTRAS") ), - Some(("recommend", sub_matches)) => commands::recommend::recommend( - sub_matches.get_flag("CHECK"), - ), + Some(("recommend", sub_matches)) => commands::recommend::recommend(), Some(("clone", sub_matches)) => commands::clone::clone( sub_matches.get_one::("REPOSITORY"), sub_matches.get_one::("threads"), From 6805b90ebdfd957855b6d0f47a21f49b55b760ef Mon Sep 17 00:00:00 2001 From: cp400color Date: Mon, 15 Sep 2025 14:33:18 +0000 Subject: [PATCH 2/9] Remove "git" command from example oxfile --- .ox/oxfile | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/.ox/oxfile b/.ox/oxfile index 6b9130d..4984fc1 100644 --- a/.ox/oxfile +++ b/.ox/oxfile @@ -1,3 +1,5 @@ +pm pip +pm pacman recommend pip "python" recommend pytype "good type checking" recommend pytest @@ -7,8 +9,6 @@ recommend black os linux "lf" or macos "lf" env venv # they don't always need reasons -git submodules - # and you can not recommend some: dont os windows @@ -18,4 +18,3 @@ dont recommend mypy dont env raw -dont git nosubmodules From 2e1ee43ece904ecad3e2b2452e4d99e916fe137c Mon Sep 17 00:00:00 2001 From: cp400color Date: Mon, 15 Sep 2025 14:40:37 +0000 Subject: [PATCH 3/9] Replace unused variable with _ --- src/main.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main.rs b/src/main.rs index 98bc081..06a3de5 100644 --- a/src/main.rs +++ b/src/main.rs @@ -63,7 +63,7 @@ fn main() { sub_matches.get_one::("SUBSCRIPT"), sub_matches.get_many::("EXTRAS") ), - Some(("recommend", sub_matches)) => commands::recommend::recommend(), + Some(("recommend", _)) => commands::recommend::recommend(), Some(("clone", sub_matches)) => commands::clone::clone( sub_matches.get_one::("REPOSITORY"), sub_matches.get_one::("threads"), From 10f850c90e531459e6febacec036834d3fa69821 Mon Sep 17 00:00:00 2001 From: cp400color <229968751+cp400color@users.noreply.github.com> Date: Mon, 15 Sep 2025 14:44:45 +0000 Subject: [PATCH 4/9] Read oxfile in recommend.rs --- src/commands/recommend.rs | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/src/commands/recommend.rs b/src/commands/recommend.rs index 6cb501a..72553b8 100644 --- a/src/commands/recommend.rs +++ b/src/commands/recommend.rs @@ -1,3 +1,20 @@ +use std::io::Read; +use std::path::Path; +use std::fs::File; + pub fn recommend() { + let path = Path::new(".ox/oxfile"); + + let mut file = match File::open(&path) { + Err(why) => panic!("couldn't recommend anything {}", why), + Ok(file) => file, + }; + + let mut oxfile = String::new(); + match file.read_to_string(&mut oxfile) { + Err(why) => panic!("couldn't recommend anything {}", why), + Ok(_) => (), + }; + println!("{:?}", oxfile) // do something here } \ No newline at end of file From 07c871847300f7052789a58919c5946b84d40464 Mon Sep 17 00:00:00 2001 From: fgclue Date: Tue, 16 Sep 2025 23:27:06 -0300 Subject: [PATCH 5/9] Example: edit oxfile dont env --- .ox/oxfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.ox/oxfile b/.ox/oxfile index 4984fc1..eae9cbe 100644 --- a/.ox/oxfile +++ b/.ox/oxfile @@ -16,5 +16,5 @@ dont recommend flake8 dont recommend mypy -dont env raw +dont env none From 9534754495dd4097626c780bc362b6255af08710 Mon Sep 17 00:00:00 2001 From: fgclue Date: Tue, 16 Sep 2025 23:39:08 -0300 Subject: [PATCH 6/9] Add AST Enums and parse empty lines --- src/commands/recommend.rs | 34 ++++++++++++++++++++++++++++++++-- 1 file changed, 32 insertions(+), 2 deletions(-) diff --git a/src/commands/recommend.rs b/src/commands/recommend.rs index 72553b8..325c00d 100644 --- a/src/commands/recommend.rs +++ b/src/commands/recommend.rs @@ -1,6 +1,24 @@ use std::io::Read; use std::path::Path; -use std::fs::File; +use std::fs::File; // todo (for @fgclue): HEY you lazy. you have a stashed connit + +#[allow(dead_code)] +#[derive(Debug)] +enum Command { + PackageManager{manager: String, reason: String}, + Recommend{package: String, reason: String}, + Os{os: String, reason: String}, + Env{env: String, reason: String} +} + +#[allow(dead_code)] +#[derive(Debug)] +enum ASTItem { + Empty, + Command(Command), + Negative(Command), + Or(Command, Command) +} pub fn recommend() { let path = Path::new(".ox/oxfile"); @@ -16,5 +34,17 @@ pub fn recommend() { Ok(_) => (), }; - println!("{:?}", oxfile) // do something here + let mut ast: Vec = vec!(); + + for line in oxfile.split("\n") { + if line == "" { + ast.insert(ast.len(), ASTItem::Empty); + continue; + } + + let split: Vec<&str> = line.split(" ").collect(); + // todo: Find something that makes sense to do here. I am not letting 12AM me do this. Goodnight + } + + println!("{:?}", ast); } \ No newline at end of file From d919af704bf04886e1636abaf406c93f0e7ee383 Mon Sep 17 00:00:00 2001 From: fgclue Date: Tue, 16 Sep 2025 23:40:32 -0300 Subject: [PATCH 7/9] Remove Empty ASTItem --- src/commands/recommend.rs | 2 -- 1 file changed, 2 deletions(-) diff --git a/src/commands/recommend.rs b/src/commands/recommend.rs index 325c00d..a5c6453 100644 --- a/src/commands/recommend.rs +++ b/src/commands/recommend.rs @@ -14,7 +14,6 @@ enum Command { #[allow(dead_code)] #[derive(Debug)] enum ASTItem { - Empty, Command(Command), Negative(Command), Or(Command, Command) @@ -38,7 +37,6 @@ pub fn recommend() { for line in oxfile.split("\n") { if line == "" { - ast.insert(ast.len(), ASTItem::Empty); continue; } From 770e2e3c0ff1d2d51a4ba11d5cff3e81060f4a5d Mon Sep 17 00:00:00 2001 From: cp400color <229968751+cp400color@users.noreply.github.com> Date: Wed, 17 Sep 2025 14:48:10 +0000 Subject: [PATCH 8/9] Allow or command to take infinite number of args using a Vec Instead of Or(Command, Command) use Or(Vec) because that allows infinite arguments and are easier to handle --- src/commands/recommend.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/commands/recommend.rs b/src/commands/recommend.rs index a5c6453..d1ef3b2 100644 --- a/src/commands/recommend.rs +++ b/src/commands/recommend.rs @@ -16,7 +16,7 @@ enum Command { enum ASTItem { Command(Command), Negative(Command), - Or(Command, Command) + Or(Vec) } pub fn recommend() { From b98ee5c92124c36ea2154bd0ab73ef501d5239f4 Mon Sep 17 00:00:00 2001 From: fgclue Date: Thu, 18 Sep 2025 22:33:41 -0300 Subject: [PATCH 9/9] attempt to add chumksy --- Cargo.lock | 298 ++++++++++++++++++++++++++++++++++++-- Cargo.toml | 1 + src/commands/recommend.rs | 54 ++++--- 3 files changed, 318 insertions(+), 35 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index cdfb0bc..7839d5c 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -2,6 +2,21 @@ # It is not intended for manual editing. version = 4 +[[package]] +name = "aho-corasick" +version = "1.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8e60d3430d3a69478ad0993f19238d2df97c507009a52b3c10addcd7f6bcb916" +dependencies = [ + "memchr", +] + +[[package]] +name = "allocator-api2" +version = "0.2.21" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "683d7910e743518b0e34f1186f92494becacb047c7b6bf616c96772180fef923" + [[package]] name = "anstream" version = "0.6.20" @@ -38,7 +53,7 @@ version = "1.1.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9e231f6134f61b71076a3eab506c379d4f36122f2af15a9ff04415ea4c3339e2" dependencies = [ - "windows-sys", + "windows-sys 0.60.2", ] [[package]] @@ -49,7 +64,37 @@ checksum = "3e0633414522a32ffaac8ac6cc8f748e090c5717661fddeea04219e2344f5f2a" dependencies = [ "anstyle", "once_cell_polyfill", - "windows-sys", + "windows-sys 0.60.2", +] + +[[package]] +name = "cc" +version = "1.2.37" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "65193589c6404eb80b450d618eaf9a2cafaaafd57ecce47370519ef674a7bd44" +dependencies = [ + "find-msvc-tools", + "shlex", +] + +[[package]] +name = "cfg-if" +version = "1.0.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2fd1289c04a9ea8cb22300a459a72a385d7c73d3259e2ed7dcb2af674838cfa9" + +[[package]] +name = "chumsky" +version = "0.11.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6cd3ef0a728f561e3b4157213d178ae7523cbc405423f862da757447588ae103" +dependencies = [ + "hashbrown", + "regex-automata", + "serde", + "stacker", + "unicode-ident", + "unicode-segmentation", ] [[package]] @@ -85,12 +130,53 @@ version = "1.0.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b05b61dc5112cbb17e4b6cd61790d9845d13888356391624cbe7e41efeac1e75" +[[package]] +name = "equivalent" +version = "1.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "877a4ace8713b0bcf2a4e7eec82529c029f1d0619886d18145fea96c3ffe5c0f" + +[[package]] +name = "find-msvc-tools" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7fd99930f64d146689264c637b5af2f0233a933bef0d8570e2526bf9e083192d" + +[[package]] +name = "foldhash" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d9c4f5dac5e15c24eb999c26181a6ca40b39fe946cbe4c263c7209467bc83af2" + +[[package]] +name = "hashbrown" +version = "0.15.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9229cfe53dfd69f0609a49f65461bd93001ea1ef889cd5529dd176593f5338a1" +dependencies = [ + "allocator-api2", + "equivalent", + "foldhash", +] + [[package]] name = "is_terminal_polyfill" version = "1.70.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7943c866cc5cd64cbc25b2e01621d07fa8eb2a1a23160ee81ce38704e97b8ecf" +[[package]] +name = "libc" +version = "0.2.175" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6a82ae493e598baaea5209805c49bbf2ea7de956d50d7da0da1164f9c6d28543" + +[[package]] +name = "memchr" +version = "2.7.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "32a282da65faaf38286cf3be983213fcf1d2e2a58700e808f83f4ea9a4804bc0" + [[package]] name = "once_cell_polyfill" version = "1.70.1" @@ -102,15 +188,132 @@ name = "ox" version = "0.1.0" dependencies = [ "anstyle", + "chumsky", "clap", ] +[[package]] +name = "proc-macro2" +version = "1.0.101" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "89ae43fd86e4158d6db51ad8e2b80f313af9cc74f5c0e03ccb87de09998732de" +dependencies = [ + "unicode-ident", +] + +[[package]] +name = "psm" +version = "0.1.26" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6e944464ec8536cd1beb0bbfd96987eb5e3b72f2ecdafdc5c769a37f1fa2ae1f" +dependencies = [ + "cc", +] + +[[package]] +name = "quote" +version = "1.0.40" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1885c039570dc00dcb4ff087a89e185fd56bae234ddc7f056a945bf36467248d" +dependencies = [ + "proc-macro2", +] + +[[package]] +name = "regex-automata" +version = "0.3.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "59b23e92ee4318893fa3fe3e6fb365258efbfe6ac6ab30f090cdcbb7aa37efa9" +dependencies = [ + "aho-corasick", + "memchr", + "regex-syntax", +] + +[[package]] +name = "regex-syntax" +version = "0.7.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dbb5fb1acd8a1a18b3dd5be62d25485eb770e05afb408a9627d14d451bae12da" + +[[package]] +name = "serde" +version = "1.0.225" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fd6c24dee235d0da097043389623fb913daddf92c76e9f5a1db88607a0bcbd1d" +dependencies = [ + "serde_core", + "serde_derive", +] + +[[package]] +name = "serde_core" +version = "1.0.225" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "659356f9a0cb1e529b24c01e43ad2bdf520ec4ceaf83047b83ddcc2251f96383" +dependencies = [ + "serde_derive", +] + +[[package]] +name = "serde_derive" +version = "1.0.225" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0ea936adf78b1f766949a4977b91d2f5595825bd6ec079aa9543ad2685fc4516" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "shlex" +version = "1.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0fda2ff0d084019ba4d7c6f371c95d8fd75ce3524c3cb8fb653a3023f6323e64" + +[[package]] +name = "stacker" +version = "0.1.21" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cddb07e32ddb770749da91081d8d0ac3a16f1a569a18b20348cd371f5dead06b" +dependencies = [ + "cc", + "cfg-if", + "libc", + "psm", + "windows-sys 0.59.0", +] + [[package]] name = "strsim" version = "0.11.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7da8b5736845d9f2fcb837ea5d9e2628564b3b043a70948a3f0b778838c5fb4f" +[[package]] +name = "syn" +version = "2.0.106" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ede7c438028d4436d71104916910f5bb611972c5cfd7f89b8300a8186e6fada6" +dependencies = [ + "proc-macro2", + "quote", + "unicode-ident", +] + +[[package]] +name = "unicode-ident" +version = "1.0.19" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f63a545481291138910575129486daeaf8ac54aee4387fe7906919f7830c7d9d" + +[[package]] +name = "unicode-segmentation" +version = "1.12.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f6ccf251212114b54433ec949fd6a7841275f9ada20dddd2f29e9ceea4501493" + [[package]] name = "utf8parse" version = "0.2.2" @@ -123,13 +326,38 @@ version = "0.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5e6ad25900d524eaabdbbb96d20b4311e1e7ae1699af4fb28c17ae66c80d798a" +[[package]] +name = "windows-sys" +version = "0.59.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1e38bc4d79ed67fd075bcc251a1c39b32a1776bbe92e5bef1f0bf1f8c531853b" +dependencies = [ + "windows-targets 0.52.6", +] + [[package]] name = "windows-sys" version = "0.60.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f2f500e4d28234f72040990ec9d39e3a6b950f9f22d3dba18416c35882612bcb" dependencies = [ - "windows-targets", + "windows-targets 0.53.3", +] + +[[package]] +name = "windows-targets" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9b724f72796e036ab90c1021d4780d4d3d648aca59e491e6b98e725b84e99973" +dependencies = [ + "windows_aarch64_gnullvm 0.52.6", + "windows_aarch64_msvc 0.52.6", + "windows_i686_gnu 0.52.6", + "windows_i686_gnullvm 0.52.6", + "windows_i686_msvc 0.52.6", + "windows_x86_64_gnu 0.52.6", + "windows_x86_64_gnullvm 0.52.6", + "windows_x86_64_msvc 0.52.6", ] [[package]] @@ -139,58 +367,106 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d5fe6031c4041849d7c496a8ded650796e7b6ecc19df1a431c1a363342e5dc91" dependencies = [ "windows-link", - "windows_aarch64_gnullvm", - "windows_aarch64_msvc", - "windows_i686_gnu", - "windows_i686_gnullvm", - "windows_i686_msvc", - "windows_x86_64_gnu", - "windows_x86_64_gnullvm", - "windows_x86_64_msvc", + "windows_aarch64_gnullvm 0.53.0", + "windows_aarch64_msvc 0.53.0", + "windows_i686_gnu 0.53.0", + "windows_i686_gnullvm 0.53.0", + "windows_i686_msvc 0.53.0", + "windows_x86_64_gnu 0.53.0", + "windows_x86_64_gnullvm 0.53.0", + "windows_x86_64_msvc 0.53.0", ] +[[package]] +name = "windows_aarch64_gnullvm" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "32a4622180e7a0ec044bb555404c800bc9fd9ec262ec147edd5989ccd0c02cd3" + [[package]] name = "windows_aarch64_gnullvm" version = "0.53.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "86b8d5f90ddd19cb4a147a5fa63ca848db3df085e25fee3cc10b39b6eebae764" +[[package]] +name = "windows_aarch64_msvc" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "09ec2a7bb152e2252b53fa7803150007879548bc709c039df7627cabbd05d469" + [[package]] name = "windows_aarch64_msvc" version = "0.53.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c7651a1f62a11b8cbd5e0d42526e55f2c99886c77e007179efff86c2b137e66c" +[[package]] +name = "windows_i686_gnu" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8e9b5ad5ab802e97eb8e295ac6720e509ee4c243f69d781394014ebfe8bbfa0b" + [[package]] name = "windows_i686_gnu" version = "0.53.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c1dc67659d35f387f5f6c479dc4e28f1d4bb90ddd1a5d3da2e5d97b42d6272c3" +[[package]] +name = "windows_i686_gnullvm" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0eee52d38c090b3caa76c563b86c3a4bd71ef1a819287c19d586d7334ae8ed66" + [[package]] name = "windows_i686_gnullvm" version = "0.53.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9ce6ccbdedbf6d6354471319e781c0dfef054c81fbc7cf83f338a4296c0cae11" +[[package]] +name = "windows_i686_msvc" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "240948bc05c5e7c6dabba28bf89d89ffce3e303022809e73deaefe4f6ec56c66" + [[package]] name = "windows_i686_msvc" version = "0.53.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "581fee95406bb13382d2f65cd4a908ca7b1e4c2f1917f143ba16efe98a589b5d" +[[package]] +name = "windows_x86_64_gnu" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "147a5c80aabfbf0c7d901cb5895d1de30ef2907eb21fbbab29ca94c5b08b1a78" + [[package]] name = "windows_x86_64_gnu" version = "0.53.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2e55b5ac9ea33f2fc1716d1742db15574fd6fc8dadc51caab1c16a3d3b4190ba" +[[package]] +name = "windows_x86_64_gnullvm" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "24d5b23dc417412679681396f2b49f3de8c1473deb516bd34410872eff51ed0d" + [[package]] name = "windows_x86_64_gnullvm" version = "0.53.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0a6e035dd0599267ce1ee132e51c27dd29437f63325753051e71dd9e42406c57" +[[package]] +name = "windows_x86_64_msvc" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "589f6da84c646204747d1270a2a5661ea66ed1cced2631d546fdfb155959f9ec" + [[package]] name = "windows_x86_64_msvc" version = "0.53.0" diff --git a/Cargo.toml b/Cargo.toml index f5ebd71..a55e615 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -5,4 +5,5 @@ edition = "2024" [dependencies] anstyle = "=1.0.11" +chumsky = "0.11.1" clap = { version = "4.5.47", features = ["cargo", "color", "suggestions"] } diff --git a/src/commands/recommend.rs b/src/commands/recommend.rs index d1ef3b2..7e9de65 100644 --- a/src/commands/recommend.rs +++ b/src/commands/recommend.rs @@ -1,22 +1,29 @@ use std::io::Read; use std::path::Path; use std::fs::File; // todo (for @fgclue): HEY you lazy. you have a stashed connit +use chumsky::prelude::*; // todo: replace this with pest, nom, peg, (preferably pest) + // todo: or maybe use chumksy anyways -#[allow(dead_code)] -#[derive(Debug)] -enum Command { - PackageManager{manager: String, reason: String}, - Recommend{package: String, reason: String}, - Os{os: String, reason: String}, - Env{env: String, reason: String} -} +// TODO: remove +// #[allow(dead_code)] +// #[derive(Debug)] +// enum Command { +// PackageManager{manager: String, reason: String}, +// Recommend{package: String, reason: String}, +// Os{os: String, reason: String}, +// Env{env: String, reason: String} +// } + +// #[allow(dead_code)] +// #[derive(Debug)] +// enum ASTItem { +// Command(Command), +// Negative(Command), +// Or(Vec) +// } + +fn oxfile() { -#[allow(dead_code)] -#[derive(Debug)] -enum ASTItem { - Command(Command), - Negative(Command), - Or(Vec) } pub fn recommend() { @@ -33,16 +40,15 @@ pub fn recommend() { Ok(_) => (), }; - let mut ast: Vec = vec!(); + // todo: remove + // let mut ast: Vec = vec!(); - for line in oxfile.split("\n") { - if line == "" { - continue; - } + // for line in oxfile.split("\n") { + // if line == "" { + // continue; + // } - let split: Vec<&str> = line.split(" ").collect(); - // todo: Find something that makes sense to do here. I am not letting 12AM me do this. Goodnight - } - - println!("{:?}", ast); + // let split: Vec<&str> = line.split(" ").collect(); + // // todo: Find something that makes sense to do here. I am not letting 12AM me do this. Goodnight + // } } \ No newline at end of file