Skip to content

Commit

Permalink
remove clap and subcommands, focus on program
Browse files Browse the repository at this point in the history
  • Loading branch information
emanueldima committed Mar 19, 2024
1 parent 56e3cf8 commit ae1d93e
Show file tree
Hide file tree
Showing 28 changed files with 368 additions and 356 deletions.
148 changes: 17 additions & 131 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 4 additions & 6 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,19 +9,17 @@ publish = false
crate-type = ["lib", "cdylib"]

[dependencies]
anyhow = { version = "1", features = ["backtrace"] }
clap = { version = "4.4", features = ["suggestions", "derive"] }
dirs = "5.0"
indexmap = "2.1"
indexmap = "2.2"
linkme = "0.3"
nom = "7.1"
paste = "1.0"
rand = "0.8"
regex = "1.5"
regex = "1.10"
reqwest = { version = "0.11", features = ["blocking", "json"] }
serde = { version = "1.0" }
tree-sitter = "0.20"
url = "2.1"
tree-sitter = "0.22"
url = "2.5"
quick-xml = { version = "0.31", features = ["encoding"] }
yaml-rust = "0.4"

Expand Down
2 changes: 1 addition & 1 deletion doc/issues.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# List of Todos and other Issues

- add split(":") interpretation, read-write
- set value on the command line: '/username = "newuser"'
- add split(":") interpretation, read-write
- '**[filter]' must be work as '**/*[filter]' (filter to be applied only on leaves)
- support rust/ts write: `hial './src/tests/rust.rs^rust/*[:function_item].label = "modified_fn_name"'`
- add interpretation params to Xell::be()
Expand Down
2 changes: 1 addition & 1 deletion examples/print_rust.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
use hiallib::api::*;
use hiallib::pprint::pprint;
use hiallib::pprint;

// examples = "."^file/examples;
// for stack in examples/productiondump.json^json/stacks/*[/system_stack != true]:
Expand Down
10 changes: 10 additions & 0 deletions src/api/value.rs
Original file line number Diff line number Diff line change
Expand Up @@ -384,6 +384,16 @@ impl From<u64> for Value<'_> {
Value::Int(Int::U64(x))
}
}
impl From<isize> for Value<'_> {
fn from(x: isize) -> Self {
Value::Int(Int::I64(x as i64))
}
}
impl From<usize> for Value<'_> {
fn from(x: usize) -> Self {
Value::Int(Int::U64(x as u64))
}
}
impl From<StrFloat> for Value<'_> {
fn from(f: StrFloat) -> Self {
Value::Float(f)
Expand Down
6 changes: 3 additions & 3 deletions src/api/xell.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ use crate::{
api::{internal::*, interpretation::*, *},
enumerated_dynamic_type, guard_ok, guard_some,
interpretations::*,
search::{searcher::Searcher, Path},
prog::{searcher::Searcher, Path},
warning,
};

Expand Down Expand Up @@ -466,7 +466,7 @@ impl Xell {
if let DynCell::Error(err) = &self.dyn_cell {
return self.clone();
}
let path = guard_ok!(crate::search::Path::parse(path), err =>
let path = guard_ok!(Path::parse(path), err =>
return Xell {
dyn_cell: DynCell::from(err),
domain: Rc::clone(&self.domain),
Expand Down Expand Up @@ -500,7 +500,7 @@ impl Xell {
if let DynCell::Error(err) = &self.dyn_cell {
return Err(err.clone());
}
let path = guard_ok!(crate::search::Path::parse(path), err => {return Err(err)});
let path = guard_ok!(crate::prog::Path::parse(path), err => {return Err(err)});
Ok(Searcher::new(self.clone(), path))
}

Expand Down
2 changes: 1 addition & 1 deletion src/interpretations/treesitter.rs
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ fn sitter_from_source(source: String, language: String) -> Res<Cell> {
// }

let mut parser = Parser::new();
guard_ok!(parser.set_language(sitter_language), err => {
guard_ok!(parser.set_language(&sitter_language), err => {
return Err(caused(HErrKind::Internal, format!("cannot set language {}", language), err));
});

Expand Down
5 changes: 3 additions & 2 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,11 @@ pub mod api;
// pub mod c_api;
mod interpretations;
pub mod perftests;
pub mod pprint;
pub mod search;
pub mod prog;
pub mod utils;

pub use utils::pprint::pprint;

#[cfg(test)]
mod tests;

Expand Down
Loading

0 comments on commit ae1d93e

Please sign in to comment.