codesort/lib.rs
1//!
2//! codesort sorts code, either as a command line tool, usually integrated
3//! in an IDE or a text editor, or as a library.
4//!
5//! ```rust
6//! use codesort::{LocList, Language};
7//! let input = r#"
8//! pub enum ContentSearchResult {
9//! /// the file wasn't searched because it's binary or too big
10//! NotSuitable,
11//! /// the needle has been found at the given pos
12//! Found {
13//! pos: usize,
14//! },
15//! /// the needle hasn't been found
16//! NotFound, // no match
17//! }
18//! "#;
19//!
20//! let output = r#"
21//! pub enum ContentSearchResult {
22//! /// the needle has been found at the given pos
23//! Found {
24//! pos: usize,
25//! },
26//! /// the needle hasn't been found
27//! NotFound, // no match
28//! /// the file wasn't searched because it's binary or too big
29//! NotSuitable,
30//! }
31//! "#;
32//!
33//! let mut list = LocList::read_str(input, Language::Rust).unwrap();
34//! list.sort_around_line_index(5).unwrap();
35//! assert_eq!(list.to_string(), output);
36//! ```
37
38mod analyzers;
39mod brace_stack;
40mod error;
41mod focused;
42mod gifts;
43mod line_number;
44mod loc;
45mod loc_list;
46mod spacing;
47
48pub use {
49 analyzers::*,
50 brace_stack::*,
51 error::*,
52 focused::*,
53 gifts::*,
54 line_number::*,
55 loc::*,
56 loc_list::*,
57 spacing::*,
58};