Compare commits
2 Commits
f193be1731
...
d62b1657c3
Author | SHA1 | Date | |
---|---|---|---|
d62b1657c3 | |||
169380d8bc |
24
Cargo.lock
generated
24
Cargo.lock
generated
|
@ -448,12 +448,6 @@ version = "1.0.14"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "7ffc183a10b4478d04cbbbfc96d0873219d962dd5accaff2ffbd4ceb7df837f4"
|
checksum = "7ffc183a10b4478d04cbbbfc96d0873219d962dd5accaff2ffbd4ceb7df837f4"
|
||||||
|
|
||||||
[[package]]
|
|
||||||
name = "ryu"
|
|
||||||
version = "1.0.15"
|
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
||||||
checksum = "1ad4cc8da4ef723ed60bced201181d83791ad433213d8c24efffda1eec85d741"
|
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "serde"
|
name = "serde"
|
||||||
version = "1.0.192"
|
version = "1.0.192"
|
||||||
|
@ -474,17 +468,6 @@ dependencies = [
|
||||||
"syn 2.0.39",
|
"syn 2.0.39",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
|
||||||
name = "serde_json"
|
|
||||||
version = "1.0.108"
|
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
||||||
checksum = "3d1c7e3eac408d115102c4c24ad393e0821bb3a5df4d506a80f85f7a742a526b"
|
|
||||||
dependencies = [
|
|
||||||
"itoa",
|
|
||||||
"ryu",
|
|
||||||
"serde",
|
|
||||||
]
|
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "slog"
|
name = "slog"
|
||||||
version = "2.7.0"
|
version = "2.7.0"
|
||||||
|
@ -724,15 +707,12 @@ dependencies = [
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "tree-sitter"
|
name = "tree-sitter"
|
||||||
version = "0.6.3"
|
version = "0.20.10"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "376e181cb69da67bad2d69806cf2500656fd68123c526a61e5cbbfc65110c5b0"
|
checksum = "e747b1f9b7b931ed39a548c1fae149101497de3c1fc8d9e18c62c1a66c683d3d"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"cc",
|
"cc",
|
||||||
"regex",
|
"regex",
|
||||||
"serde",
|
|
||||||
"serde_derive",
|
|
||||||
"serde_json",
|
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
|
|
|
@ -12,7 +12,7 @@ slog = { version = "2.5.2", features = ["release_max_level_debug"] }
|
||||||
slog-scope = "4.3.0"
|
slog-scope = "4.3.0"
|
||||||
sloggers = "0.3.5"
|
sloggers = "0.3.5"
|
||||||
toml = "0.5.6"
|
toml = "0.5.6"
|
||||||
tree-sitter = "0.6.0"
|
tree-sitter = "0.20.10"
|
||||||
|
|
||||||
# [profile.release]
|
# [profile.release]
|
||||||
# lto = true
|
# lto = true
|
||||||
|
|
11
src/main.rs
11
src/main.rs
|
@ -37,7 +37,16 @@ fn main() {
|
||||||
|
|
||||||
if let Some(filetype) = matches.value_of("do-you-understand") {
|
if let Some(filetype) = matches.value_of("do-you-understand") {
|
||||||
let language = ffi::filetype_to_language(filetype);
|
let language = ffi::filetype_to_language(filetype);
|
||||||
std::process::exit(if language.is_some() { 0 } else { 1 });
|
if let Some(language) = language {
|
||||||
|
eprintln!("Known language. Trying to load");
|
||||||
|
let mut parser = Parser::new();
|
||||||
|
parser.set_language(language).unwrap();
|
||||||
|
eprintln!("Loaded successfully");
|
||||||
|
std::process::exit(0);
|
||||||
|
} else {
|
||||||
|
eprintln!("Unknown language");
|
||||||
|
std::process::exit(1);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
let config = if let Some(config_path) = matches.value_of("config") {
|
let config = if let Some(config_path) = matches.value_of("config") {
|
||||||
|
|
Loading…
Reference in New Issue
Block a user