shared/
lib.rs

1//! # Shared module
2//!
3//! The shared module contains code that is shared between the different parts of the SAP
4//! interpreter. This includes the error data structures, the span module, and the output
5//! module.
6
7pub mod error;
8pub mod span;
9
10// The output module contains functions for printing the output of the interpreter.
11// It is platform-specific, so it has different implementations for the different
12// platforms that the interpreter supports.
13
14// "wasm" is a target family that is used to identify WebAssembly (web browser) targets.
15// So, if the code is being compiled for WebAssembly, use the `output_wasm.rs` file.
16#[cfg(target_family = "wasm")]
17#[path = "./output_wasm.rs"]
18pub mod output;
19
20// If the code is not being compiled for WebAssembly, use the `output.rs` file.
21#[cfg(not(target_family = "wasm"))]
22pub mod output;