lib_ruby_parser/
lib.rs

1#![warn(missing_debug_implementations)]
2#![warn(missing_docs)]
3#![warn(trivial_casts, trivial_numeric_casts)]
4#![warn(unused_qualifications)]
5#![warn(deprecated_in_future)]
6#![warn(unused_lifetimes)]
7#![allow(clippy::boxed_local)]
8#![forbid(unsafe_code)]
9#![doc = include_str!("../README.md")]
10
11/*!
12A Ruby parser written in Rust.
13
14Uses bison under the hood.
15*/
16
17// Re-exporting lib_ruby_parser_ast
18/// Module with all known node types
19pub use lib_ruby_parser_ast::nodes;
20pub use lib_ruby_parser_ast::Bytes;
21pub use lib_ruby_parser_ast::DiagnosticMessage;
22pub use lib_ruby_parser_ast::Loc;
23pub use lib_ruby_parser_ast::Node;
24
25mod loc_ext;
26pub use loc_ext::LocExt;
27
28/// Module with everything related to output of the Parser, but not related to AST,
29/// like `Comment`, `Input`, `Decoder`
30pub mod source;
31
32#[allow(clippy::collapsible_if)]
33#[allow(clippy::collapsible_else_if)]
34mod lexer;
35
36pub use lexer::Lexer;
37
38mod static_environment;
39pub use static_environment::StaticEnvironment;
40
41pub(crate) mod parse_value;
42
43mod parser_options;
44pub use parser_options::ParserOptions;
45
46mod parser_result;
47pub use parser_result::ParserResult;
48
49mod parser;
50pub use parser::Parser;
51
52mod builder;
53pub(crate) use builder::Builder;
54
55mod current_arg_stack;
56pub(crate) use current_arg_stack::CurrentArgStack;
57
58mod max_numparam_stack;
59pub(crate) use max_numparam_stack::MaxNumparamStack;
60
61mod variables_stack;
62pub(crate) use variables_stack::VariablesStack;
63
64mod error;
65pub use error::{Diagnostic, ErrorLevel};
66
67pub(crate) mod maybe_byte;
68
69mod lex_state;
70pub use lex_state::lex_states;
71pub use lex_state::LexState;
72
73mod token_buf;
74pub(crate) use token_buf::TokenBuf;
75
76mod reserved_words;
77pub use reserved_words::{reserved_word, ReservedWord};
78
79mod stack_state;
80pub(crate) use stack_state::StackState;
81
82pub(crate) mod str_term;
83
84mod context;
85pub(crate) use context::SharedContext;
86
87/// Module to perform recursive traversing
88pub use lib_ruby_parser_ast::traverse;
89
90mod token;
91pub use token::Token;
92
93#[cfg(test)]
94mod tests;