wright/
lib.rs

1//! The wright programming language crate. This is being re-written from the ground up as of September 2022.
2
3// Compile without the standard library if the user chooses to do so.
4#![cfg_attr(not(any(feature = "std", test)), no_std)]
5// We want to enforce good stuff by default.
6#![deny(missing_copy_implementations, missing_debug_implementations)]
7#![deny(rustdoc::broken_intra_doc_links)]
8#![warn(missing_docs)]
9// Compiler directive to get docs.rs (which uses the nightly version of the rust compiler) to show
10// info about feature required for various modules and functionality.
11//
12// See: https://stackoverflow.com/a/70914430.
13#![cfg_attr(all(doc, CHANNEL_NIGHTLY), feature(doc_auto_cfg))]
14
15// We cannot use memory mapped files on architectures that do not support memmap2.
16#[cfg(all(
17    feature = "file_memmap",
18    any(target_arch = "wasm32", target_arch = "wasm64")
19))]
20compile_error!("Memory mapped files not available on WASM targets");
21
22// If the "none" feature is enabled, make sure the user has no other features enabled.
23//
24// Currently all of the features besides "none" depend on "std" so if both "none" and "std"
25// are present, raise an error at compile time.
26//
27// Make sure to keep this updated as more features are added.
28#[cfg(all(feature = "none", feature = "std"))]
29compile_error!(
30    "feature \"none\" is enabled, which restricts the usage of any other features including \"std\"."
31);
32
33/// Build information about this copy of wright, provided using <https://crates.io/crates/built>.
34pub mod build_info {
35    include!(concat!(env!("OUT_DIR"), "/built.rs"));
36}
37
38#[cfg(feature = "source-tracking")]
39pub mod source_tracking;
40
41#[cfg(feature = "reporting")]
42pub mod reporting;
43
44#[cfg(feature = "lexer")]
45pub mod lexer;
46
47#[cfg(feature = "ast-models")]
48pub mod ast;
49
50#[cfg(feature = "parser")]
51pub mod parser;
52
53pub mod util;
54
55// pub mod repl;