diff --git a/Cargo.lock b/Cargo.lock index 64c233ab..a9f56a13 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1307,7 +1307,7 @@ dependencies = [ "tree-sitter-tests-proc-macro", "unindent", "walkdir", - "wasmparser 0.121.0", + "wasmparser 0.200.0", "webbrowser", "which 6.0.0", ] @@ -1519,9 +1519,9 @@ dependencies = [ [[package]] name = "wasmparser" -version = "0.121.0" +version = "0.200.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "953cf6a7606ab31382cb1caa5ae403e77ba70c7f8e12eeda167e7040d42bfda8" +checksum = "a03f65ac876612140c57ff6c3b8fe4990067cce97c2cfdb07368a3cc3354b062" dependencies = [ "bitflags 2.4.2", "indexmap", diff --git a/Cargo.toml b/Cargo.toml index 10c70c06..9c9ca5eb 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -71,6 +71,6 @@ tiny_http = "0.12.0" toml = "0.8.10" unindent = "0.2.3" walkdir = "2.4.0" -wasmparser = "0.121.0" +wasmparser = "0.200.0" webbrowser = "0.8.12" which = "6.0.0" diff --git a/cli/loader/src/lib.rs b/cli/loader/src/lib.rs index c9960648..e8d6ea9e 100644 --- a/cli/loader/src/lib.rs +++ b/cli/loader/src/lib.rs @@ -405,7 +405,7 @@ impl Loader { let mut paths_to_check = vec![parser_path.clone()]; if let Some(scanner_path) = scanner_path.as_ref() { - paths_to_check.push(scanner_path.to_path_buf()); + paths_to_check.push(scanner_path.clone()); } paths_to_check.extend( diff --git a/cli/src/highlight.rs b/cli/src/highlight.rs index 28aad3b6..fb8287e8 100644 --- a/cli/src/highlight.rs +++ b/cli/src/highlight.rs @@ -144,9 +144,7 @@ impl Serialize for Theme { impl Default for Theme { fn default() -> Self { - serde_json::from_str( - r#" - { + serde_json::from_value(json!({ "attribute": {"color": 124, "italic": true}, "comment": {"color": 245, "italic": true}, "constant.builtin": {"color": 94, "bold": true}, @@ -169,9 +167,7 @@ impl Default for Theme { "type.builtin": {"color": 23, "bold": true}, "variable.builtin": {"bold": true}, "variable.parameter": {"underline": true} - } - "#, - ) + })) .unwrap() } } diff --git a/cli/src/parse.rs b/cli/src/parse.rs index 5ce40e71..ee395205 100644 --- a/cli/src/parse.rs +++ b/cli/src/parse.rs @@ -308,7 +308,8 @@ pub fn parse_file_at_path(parser: &mut Parser, opts: &ParseFileOptions) -> Resul if node.is_error() || node.is_missing() { first_error = Some(node); break; - } else if !cursor.goto_first_child() { + } + if !cursor.goto_first_child() { break; } } else if !cursor.goto_next_sibling() { @@ -355,7 +356,9 @@ pub fn parse_file_at_path(parser: &mut Parser, opts: &ParseFileOptions) -> Resul bytes: source_code.len(), duration: Some(duration), }); - } else if opts.print_time { + } + + if opts.print_time { let duration = time.elapsed(); let duration_ms = duration.as_micros() as f64 / 1e3; writeln!( diff --git a/cli/src/tests/helpers/fixtures.rs b/cli/src/tests/helpers/fixtures.rs index f274801d..98daf80f 100644 --- a/cli/src/tests/helpers/fixtures.rs +++ b/cli/src/tests/helpers/fixtures.rs @@ -117,9 +117,9 @@ pub fn get_test_language(name: &str, parser_code: &str, path: Option<&Path>) -> .unwrap(); let paths_to_check = if let Some(scanner_path) = &scanner_path { - vec![parser_path.clone(), scanner_path.to_path_buf()] + vec![parser_path, scanner_path.clone()] } else { - vec![parser_path.clone()] + vec![parser_path] }; TEST_LOADER diff --git a/lib/src/query.c b/lib/src/query.c index fde77917..efdccce6 100644 --- a/lib/src/query.c +++ b/lib/src/query.c @@ -42,7 +42,7 @@ typedef struct { * - `depth` - The depth where this node occurs in the pattern. The root node * of the pattern has depth zero. * - `negated_field_list_id` - An id representing a set of fields that must - * that must not be present on a node matching this step. + * not be present on a node matching this step. * * Steps have some additional fields in order to handle the `.` (or "anchor") operator, * which forbids additional child nodes: