1#![forbid(unsafe_code)]
5
6pub mod api;
7#[cfg(feature = "tools")]
8pub mod cdata;
9pub mod compact;
10#[cfg(feature = "tools")]
11pub mod convert;
12#[cfg(feature = "tools")]
13pub mod corpus;
14pub mod extract;
15pub mod langs;
16#[cfg(feature = "tools")]
17pub mod lexconv;
18pub mod lexer;
19pub mod parser;
20pub mod recover;
21pub mod scanner;
22pub mod stack;
23pub mod table;
24pub mod tree;
25
26pub use extract::{Outline, Section, Symbol, SymbolKind, outline};
27
28#[derive(Debug, Clone, Copy)]
30pub struct Limits {
31 pub max_stack_depth: usize,
32 pub max_versions: usize,
33 pub max_nodes: usize,
34 pub max_steps: u64,
36 pub max_millis: u64,
38}
39
40impl Default for Limits {
41 fn default() -> Self {
42 Self {
43 max_stack_depth: 4096,
44 max_versions: 16,
45 max_nodes: 4_000_000,
46 max_steps: 0,
47 max_millis: 0,
48 }
49 }
50}
51
52#[cfg(test)]
53mod tests {
54 #[test]
55 fn limits_default_is_bounded() {
56 assert!(super::Limits::default().max_versions > 0);
57 }
58}