conch_parser/lib.rs
1//! A library for parsing programs written in the shell programming language.
2//!
3//! The `Parser` implementation will pass all of its intermediate parse results
4//! to a `Builder` implementation, allowing the `Builder` to transform the
5//! results to a desired format. This allows for customizing what AST is
6//! produced without having to walk and transform an entire AST produced by
7//! the parser.
8//!
9//! See the `Parser` documentation for more information on getting started.
10//!
11//! # Supported Grammar
12//!
13//! * Conditional lists (`foo && bar || baz`)
14//! * Pipelines (`! foo | bar`)
15//! * Compound commands
16//! * Brace blocks (`{ foo; }`)
17//! * Subshells (`$(foo)`)
18//! * `for` / `case` / `if` / `while` / `until`
19//! * Function declarations
20//! * Redirections
21//! * Heredocs
22//! * Comments
23//! * Parameters (`$foo`, `$@`, etc.)
24//! * Parameter substitutions (`${foo:-bar}`)
25//! * Quoting (single, double, backticks, escaping)
26//! * Arithmetic substitutions
27//! * Common arithmetic operations required by the POSIX standard
28//! * Variable expansion
29//! * **Not yet implemented**: Other inner abitrary parameter/substitution expansion
30//!
31//! # Supported Cargo Features
32//!
33//! * `nightly`: enable unstable features/optimizations which require a nightly compiler
34
35#![doc(html_root_url = "https://docs.rs/conch-parser/0.1")]
36
37#![cfg_attr(all(not(test), feature = "cargo-clippy"), deny(print_stdout))]
38#![cfg_attr(feature = "cargo-clippy", deny(wrong_self_convention))]
39
40#![deny(missing_copy_implementations)]
41#![deny(missing_debug_implementations)]
42#![deny(missing_docs)]
43#![deny(trivial_casts)]
44#![deny(trivial_numeric_casts)]
45#![deny(unused_import_braces)]
46#![deny(unused_qualifications)]
47
48#![forbid(unsafe_code)]
49
50// Nightly optimizations that don't need their own feature
51#![cfg_attr(feature = "nightly", feature(fused))]
52
53macro_rules! if_nightly {
54 ($($i:item)*) => ($(
55 #[cfg(feature = "nightly")]
56 $i
57 )*)
58}
59
60extern crate void;
61
62pub mod ast;
63pub mod lexer;
64pub mod parse;
65pub mod token;