1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
//! A library for parsing programs written in the shell programming language.
//!
//! The `Parser` implementation will pass all of its intermediate parse results
//! to a `Builder` implementation, allowing the `Builder` to transform the
//! results to a desired format. This allows for customizing what AST is
//! produced without having to walk and transform an entire AST produced by
//! the parser.
//!
//! See the `Parser` documentation for more information on getting started.
//!
//! # Supported Grammar
//!
//! * Conditional lists (`foo && bar || baz`)
//! * Pipelines (`! foo | bar`)
//! * Compound commands
//!  * Brace blocks (`{ foo; }`)
//!  * Subshells (`$(foo)`)
//!  * `for` / `case` / `if` / `while` / `until`
//! * Function declarations
//! * Redirections
//! * Heredocs
//! * Comments
//! * Parameters (`$foo`, `$@`, etc.)
//! * Parameter substitutions (`${foo:-bar}`)
//! * Quoting (single, double, backticks, escaping)
//! * Arithmetic substitutions
//!  * Common arithmetic operations required by the POSIX standard
//!  * Variable expansion
//!  * **Not yet implemented**: Other inner abitrary parameter/substitution expansion
//!
//! # Supported Cargo Features
//!
//! * `clippy`: compile with clippy lints enabled
//! * `nightly`: enable unstable features/optimizations which require a nightly compiler

#![doc(html_root_url = "https://docs.rs/conch-parser/0.1")]

#![cfg_attr(feature = "clippy", feature(plugin))]
#![cfg_attr(feature = "clippy", plugin(clippy))]

#![cfg_attr(all(not(test), feature = "clippy"), deny(print_stdout))]
#![cfg_attr(feature = "clippy", deny(wrong_self_convention))]

#![deny(missing_copy_implementations)]
#![deny(missing_debug_implementations)]
#![deny(missing_docs)]
#![deny(trivial_casts)]
#![deny(trivial_numeric_casts)]
#![deny(unused_import_braces)]
#![deny(unused_qualifications)]

#![forbid(unsafe_code)]

// Nightly optimizations that don't need their own feature
#![cfg_attr(feature = "nightly", feature(fused))]

macro_rules! if_nightly {
    ($($i:item)*) => ($(
        #[cfg(feature = "nightly")]
        $i
    )*)
}

extern crate void;

pub mod ast;
pub mod lexer;
pub mod parse;
pub mod token;