Skip to main content

miden_assembly_syntax_cst/
lib.rs

1//! Lossless concrete syntax support for Miden Assembly.
2//!
3//! This crate provides a trivia-preserving lexer, a rowan-based concrete syntax tree, and a small
4//! set of typed AST wrappers over that CST. The primary entry point for production use is
5//! [`parse_source_file`], which accepts an [`Arc<SourceFile>`][miden_debug_types::SourceFile] and
6//! retains source/span information for both diagnostics and downstream lowering.
7#![no_std]
8
9#[cfg(any(test, feature = "std"))]
10#[cfg_attr(test, macro_use)]
11extern crate std;
12
13#[macro_use]
14extern crate alloc;
15
16pub mod ast;
17pub mod lexer;
18pub mod parser;
19pub mod syntax;
20
21pub use miden_utils_diagnostics::{self as diagnostics, Report};
22pub use rowan;
23
24pub use self::{
25    ast::{Item, Operation},
26    lexer::{Lexer, Token, tokenize, tokenize_text},
27    parser::{Parse, parse_inline_masm, parse_source_file, parse_text},
28    syntax::{MasmLanguage, SyntaxElement, SyntaxKind, SyntaxNode, SyntaxToken},
29};