Before

…lines 1–21 unchanged (21 lines)
22extern crate walkdir;
23
24use colored::Colorize;
25use rayon::iter::ParallelBridge;
26use rayon::prelude::*;
27use regex::Regex;
28use thread_local::ThreadLocal;
29use std::cell::RefCell;
30use std::sync::mpsc::{Receiver, Sender};
31use std::sync::{mpsc, Arc};
32use std::{collections::HashMap, path::Path};
33use std::{collections::HashSet, fs};
34use std::{io::prelude::*, path::PathBuf};
…lines 35–474 unchanged (440 lines)

After

…lines 1–27 unchanged (27 lines)
28use std::cell::RefCell;
29use std::sync::mpsc::{Receiver, Sender};
30use std::sync::{mpsc, Arc};
31use std::{collections::HashMap, path::Path};
32use std::{collections::HashSet, fs};
33use std::{io::prelude::*, path::PathBuf};
34use thread_local::ThreadLocal;
35use tree_sitter::Tree;
36use walkdir::WalkDir;
37use weggli::RegexMap;
38
39use weggli::parse_search_pattern;
40use weggli::query::QueryTree;
…lines 41–473 unchanged (433 lines)

Before

source_file
block_comment
/* "/*"
*/ "*/"
extern_crate_declaration
extern "extern"
crate "crate"
identifier "clap"
; ";"
attribute_item
# "#"
[ "["
attribute
identifier "macro_use"
] "]"
extern_crate_declaration
extern "extern"
crate "crate"
identifier "log"
; ";"
extern_crate_declaration
extern "extern"
crate "crate"
identifier "rayon"
; ";"
extern_crate_declaration
extern "extern"
crate "crate"
identifier "simplelog"
; ";"
extern_crate_declaration
extern "extern"
crate "crate"
identifier "walkdir"
; ";"
use_declaration
use "use"
scoped_identifier
identifier "colored"
:: "::"
identifier "Colorize"
; ";"
use_declaration
use "use"
scoped_identifier
scoped_identifier
identifier "rayon"
:: "::"
identifier "iter"
:: "::"
identifier "ParallelBridge"
; ";"
use_declaration
use "use"
use_wildcard
scoped_identifier
identifier "rayon"
:: "::"
identifier "prelude"
:: "::"
* "*"
; ";"
use_declaration
use "use"
scoped_identifier
identifier "regex"
:: "::"
identifier "Regex"
; ";"
use_declaration
use "use"
scoped_identifier
identifier "thread_local"
:: "::"
identifier "ThreadLocal"
; ";"
use_declaration
use "use"
scoped_identifier
scoped_identifier
identifier "std"
:: "::"
identifier "cell"
:: "::"
identifier "RefCell"
; ";"
use_declaration
use "use"
scoped_use_list
scoped_identifier
scoped_identifier
identifier "std"
:: "::"
identifier "sync"
:: "::"
identifier "mpsc"
:: "::"
use_list
{ "{"
identifier "Receiver"
, ","
identifier "Sender"
} "}"
; ";"
use_declaration
use "use"
scoped_use_list
scoped_identifier
identifier "std"
:: "::"
identifier "sync"
:: "::"
use_list
{ "{"
identifier "mpsc"
, ","
identifier "Arc"
} "}"
; ";"
use_declaration
use "use"
scoped_use_list
identifier "std"
:: "::"
use_list
{ "{"
scoped_identifier
identifier "collections"
:: "::"
identifier "HashMap"
, ","
scoped_identifier
identifier "path"
:: "::"
identifier "Path"
} "}"
; ";"
use_declaration
use "use"
scoped_use_list
identifier "std"
:: "::"
use_list
{ "{"
scoped_identifier
identifier "collections"
:: "::"
identifier "HashSet"
, ","
identifier "fs"
} "}"
; ";"
use_declaration (+21 nodes collapsed)
use_declaration
use "use"
scoped_identifier
identifier "tree_sitter"
:: "::"
identifier "Tree"
; ";"
use_declaration
use "use"
scoped_identifier
identifier "walkdir"
:: "::"
identifier "WalkDir"
; ";"
use_declaration
use "use"
scoped_identifier
identifier "weggli"
:: "::"
identifier "RegexMap"
; ";"
use_declaration
use "use"
scoped_identifier
identifier "weggli"
:: "::"
identifier "parse_search_pattern"
; ";"
use_declaration
use "use"
scoped_identifier
scoped_identifier
identifier "weggli"
:: "::"
identifier "query"
:: "::"
identifier "QueryTree"
; ";"
use_declaration
use "use"
scoped_identifier
scoped_identifier
identifier "weggli"
:: "::"
identifier "result"
:: "::"
identifier "QueryResult"
; ";"
mod_item
mod "mod"
identifier "cli"
; ";"
function_item (+1292 nodes collapsed)
enum_item (+23 nodes collapsed)
impl_item (+43 nodes collapsed)
line_comment
// "//"
outer_doc_comment_marker
/ "/"
doc_comment " Validate all passed regexes and compile them.\n"
line_comment
// "//"
outer_doc_comment_marker
/ "/"
doc_comment " Returns an error if an invalid regex is supplied otherwise "...
function_item (+279 nodes collapsed)
line_comment
// "//"
outer_doc_comment_marker
/ "/"
doc_comment " Recursively iterate through all files under `path` that mat"...
function_item (+307 nodes collapsed)
struct_item (+21 nodes collapsed)
line_comment
// "//"
outer_doc_comment_marker
/ "/"
doc_comment " Iterate over all paths in `files`, parse files that might c"...
line_comment
// "//"
outer_doc_comment_marker
/ "/"
doc_comment " in `work` and send them to the next worker using `sender`.\n"
function_item (+431 nodes collapsed)
struct_item (+43 nodes collapsed)
line_comment
// "//"
outer_doc_comment_marker
/ "/"
doc_comment " Fetches parsed ASTs from `receiver`, runs all queries in `w"...
line_comment
// "//"
outer_doc_comment_marker
/ "/"
doc_comment " filters the results based on the provided regex `constraint"...
line_comment
// "//"
outer_doc_comment_marker
/ "/"
doc_comment " For single query runs, the remaining results are directly p"...
line_comment
// "//"
outer_doc_comment_marker
/ "/"
doc_comment " to `multi_query_worker` through the `results_tx` channel.\n"
function_item (+595 nodes collapsed)
line_comment
// "//"
outer_doc_comment_marker
/ "/"
doc_comment " For multi query runs, we collect all independent results fi"...
line_comment
// "//"
outer_doc_comment_marker
/ "/"
doc_comment " them to make sure that variable assignments are valid for a"...
function_item (+447 nodes collapsed)
line_comment
// "//"
line_comment
// "//"
function_item (+96 nodes collapsed)

After

source_file
block_comment
/* "/*"
*/ "*/"
extern_crate_declaration
extern "extern"
crate "crate"
identifier "clap"
; ";"
attribute_item
# "#"
[ "["
attribute
identifier "macro_use"
] "]"
extern_crate_declaration
extern "extern"
crate "crate"
identifier "log"
; ";"
extern_crate_declaration
extern "extern"
crate "crate"
identifier "rayon"
; ";"
extern_crate_declaration
extern "extern"
crate "crate"
identifier "simplelog"
; ";"
extern_crate_declaration
extern "extern"
crate "crate"
identifier "walkdir"
; ";"
use_declaration
use "use"
scoped_identifier
identifier "colored"
:: "::"
identifier "Colorize"
; ";"
use_declaration
use "use"
scoped_identifier
scoped_identifier
identifier "rayon"
:: "::"
identifier "iter"
:: "::"
identifier "ParallelBridge"
; ";"
use_declaration
use "use"
use_wildcard
scoped_identifier
identifier "rayon"
:: "::"
identifier "prelude"
:: "::"
* "*"
; ";"
use_declaration
use "use"
scoped_identifier
identifier "regex"
:: "::"
identifier "Regex"
; ";"
use_declaration
use "use"
scoped_identifier
scoped_identifier
identifier "std"
:: "::"
identifier "cell"
:: "::"
identifier "RefCell"
; ";"
use_declaration
use "use"
scoped_use_list
scoped_identifier
scoped_identifier
identifier "std"
:: "::"
identifier "sync"
:: "::"
identifier "mpsc"
:: "::"
use_list
{ "{"
identifier "Receiver"
, ","
identifier "Sender"
} "}"
; ";"
use_declaration
use "use"
scoped_use_list
scoped_identifier
identifier "std"
:: "::"
identifier "sync"
:: "::"
use_list
{ "{"
identifier "mpsc"
, ","
identifier "Arc"
} "}"
; ";"
use_declaration
use "use"
scoped_use_list
identifier "std"
:: "::"
use_list
{ "{"
scoped_identifier
identifier "collections"
:: "::"
identifier "HashMap"
, ","
scoped_identifier
identifier "path"
:: "::"
identifier "Path"
} "}"
; ";"
use_declaration
use "use"
scoped_use_list
identifier "std"
:: "::"
use_list
{ "{"
scoped_identifier
identifier "collections"
:: "::"
identifier "HashSet"
, ","
identifier "fs"
} "}"
; ";"
use_declaration (+21 nodes collapsed)
use_declaration
use "use"
scoped_identifier
identifier "thread_local"
:: "::"
identifier "ThreadLocal"
; ";"
use_declaration
use "use"
scoped_identifier
identifier "tree_sitter"
:: "::"
identifier "Tree"
; ";"
use_declaration
use "use"
scoped_identifier
identifier "walkdir"
:: "::"
identifier "WalkDir"
; ";"
use_declaration
use "use"
scoped_identifier
identifier "weggli"
:: "::"
identifier "RegexMap"
; ";"
use_declaration
use "use"
scoped_identifier
identifier "weggli"
:: "::"
identifier "parse_search_pattern"
; ";"
use_declaration
use "use"
scoped_identifier
scoped_identifier
identifier "weggli"
:: "::"
identifier "query"
:: "::"
identifier "QueryTree"
; ";"
use_declaration
use "use"
scoped_identifier
scoped_identifier
identifier "weggli"
:: "::"
identifier "result"
:: "::"
identifier "QueryResult"
; ";"
mod_item
mod "mod"
identifier "cli"
; ";"
function_item (+1292 nodes collapsed)
enum_item (+23 nodes collapsed)
impl_item (+43 nodes collapsed)
line_comment
// "//"
outer_doc_comment_marker
/ "/"
doc_comment " Validate all passed regexes and compile them.\n"
line_comment
// "//"
outer_doc_comment_marker
/ "/"
doc_comment " Returns an error if an invalid regex is supplied otherwise "...
function_item (+279 nodes collapsed)
line_comment
// "//"
outer_doc_comment_marker
/ "/"
doc_comment " Recursively iterate through all files under `path` that mat"...
function_item (+307 nodes collapsed)
struct_item (+21 nodes collapsed)
line_comment
// "//"
outer_doc_comment_marker
/ "/"
doc_comment " Iterate over all paths in `files`, parse files that might c"...
line_comment
// "//"
outer_doc_comment_marker
/ "/"
doc_comment " in `work` and send them to the next worker using `sender`.\n"
function_item (+431 nodes collapsed)
struct_item (+43 nodes collapsed)
line_comment
// "//"
outer_doc_comment_marker
/ "/"
doc_comment " Fetches parsed ASTs from `receiver`, runs all queries in `w"...
line_comment
// "//"
outer_doc_comment_marker
/ "/"
doc_comment " filters the results based on the provided regex `constraint"...
line_comment
// "//"
outer_doc_comment_marker
/ "/"
doc_comment " For single query runs, the remaining results are directly p"...
line_comment
// "//"
outer_doc_comment_marker
/ "/"
doc_comment " to `multi_query_worker` through the `results_tx` channel.\n"
function_item (+595 nodes collapsed)
line_comment
// "//"
outer_doc_comment_marker
/ "/"
doc_comment " For multi query runs, we collect all independent results fi"...
line_comment
// "//"
outer_doc_comment_marker
/ "/"
doc_comment " them to make sure that variable assignments are valid for a"...
function_item (+447 nodes collapsed)
line_comment
// "//"
line_comment
// "//"
function_item (+96 nodes collapsed)