tokit/
lib.rs

1#![doc = include_str!("../README.md")]
2#![cfg_attr(not(feature = "std"), no_std)]
3#![cfg_attr(docsrs, feature(doc_cfg))]
4#![cfg_attr(docsrs, allow(unused_attributes))]
5#![allow(clippy::double_parens)]
6#![deny(missing_docs, warnings)]
7
8#[cfg(all(not(feature = "std"), feature = "alloc"))]
9extern crate alloc as std;
10
11#[cfg(feature = "std")]
12extern crate std;
13
14#[cfg(feature = "logos")]
15#[cfg_attr(docsrs, doc(cfg(feature = "logos")))]
16pub use logos;
17
18pub use check::Check;
19pub use emitter::Emitter;
20pub use lexer::{Cache, Lexed, Lexer, Source, State, Token};
21pub use parser::{Parse, ParseChoice, ParseContext, ParseInput, Parser, Window};
22pub use require::Require;
23
24/// Concrete Syntax Tree (CST) representations and utilities.
25#[cfg(feature = "rowan")]
26#[cfg_attr(docsrs, doc(cfg(feature = "rowan")))]
27pub mod cst;
28
29/// Lexers and token definitions.
30pub mod lexer;
31
32/// Parsers and combinators.
33pub mod parser;
34
35/// Common types for any programming language.
36pub mod types;
37
38/// Syntax definitions and traits.
39pub mod syntax;
40
41/// Common utilities for working with tokens and lexers.
42pub mod utils;
43
44/// Trait for container types.
45pub mod container;
46
47/// The emitter related structures and traits
48pub mod emitter;
49
50/// Common error types for lexers and parsers.
51pub mod error;
52
53/// Common punctuation tokens.
54pub mod punct;
55
56mod check;
57mod keyword;
58mod require;
59
60#[doc(hidden)]
61pub mod __private {
62  pub use super::{check::Check, error, lexer::*, require::Require, syntax, utils};
63  #[cfg(feature = "logos")]
64  pub use logos;
65  pub use paste;
66
67  #[cfg(any(feature = "std", feature = "alloc"))]
68  pub use std::{boxed::Box, string::String, vec::Vec};
69}