wdl_grammar/
lib.rs

1//! Lexing and parsing for Workflow Description Language (WDL) documents.
2//!
3//! This crate implements an infallible WDL parser based
4//! on the `logos` crate for lexing and the `rowan` crate for
5//! concrete syntax tree (CST) representation.
6//!
7//! The parser outputs a list of parser events that can be used
8//! to construct the CST; the parser also keeps a list of [Diagnostic]s emitted
9//! during the parse that relate to spans from the original source.
10//!
11//! See [SyntaxTree::parse] for parsing WDL source;
12//! users may inspect the resulting CST to determine the version of the
13//! document that was parsed.
14//!
15//! # Examples
16//!
17//! An example of parsing WDL source into a CST and printing the tree:
18//!
19//! ```rust
20//! use wdl_grammar::SyntaxTree;
21//!
22//! let (tree, diagnostics) = SyntaxTree::parse("version 1.1");
23//! assert!(diagnostics.is_empty());
24//! println!("{tree:#?}");
25//! ```
26
27#![warn(missing_docs)]
28#![warn(rust_2018_idioms)]
29#![warn(rust_2021_compatibility)]
30#![warn(missing_debug_implementations)]
31#![warn(clippy::missing_docs_in_private_items)]
32#![warn(rustdoc::broken_intra_doc_links)]
33
34mod diagnostic;
35pub mod grammar;
36pub mod lexer;
37pub mod parser;
38mod tree;
39pub mod version;
40
41pub use diagnostic::*;
42pub use tree::*;
43pub use version::SupportedVersion;