1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
//! Pure Rust template engine core for **Runjucks**, a [Nunjucks](https://mozilla.github.io/nunjucks/)-oriented engine.
//!
//! This crate is the **lex → parse → render** pipeline with no Node or NAPI dependencies. The published
//! [`runjucks` npm package](https://www.npmjs.com/package/runjucks) wraps it in a thin native addon; most
//! JavaScript callers use that API instead of linking this crate directly.
//!
//! Pipeline:
//! 1. [`lexer::tokenize`] splits template source into [`lexer::Token`]s.
//! 2. For each [`lexer::Token::Tag`], [`tag_lex::tokenize_tag_body`] can split the inner string into keywords and identifiers.
//! 3. [`parser::parse`] builds an [`ast::Node`] tree; [`parser::parse_expr`] parses `{{ }}` bodies with Nunjucks-style precedence (see [`parser::expr`]).
//! 4. [`renderer::render`] walks the AST with an [`Environment`], optional [`loader::TemplateLoader`], and a [`renderer::CtxStack`] built from the JSON context (`{% include %}`, `{% extends %}` / `{% block %}`, `for`/`set` frames, macros).
//!
//! # Example
//!
//! ```
//! use runjucks_core::Environment;
//! use serde_json::json;
//!
//! let env = Environment::default();
//! let out = env
//! .render_string("Hello, {{ name }}".into(), json!({ "name": "Ada" }))
//! .unwrap();
//! assert_eq!(out, "Hello, Ada");
//! ```
pub use ;
pub use RunjucksError;
pub use ;
pub use ;
pub use ;