wp-lang
Overview
wp-lang is the standalone WPL language crate from the Warp Parse stack. It contains the WPL AST, parser, runtime evaluator, built-in value parsers, preprocessing hooks, and generation utilities needed to parse and execute WPL rules.
The crate sits above wp-primitives: wp-primitives handles syntax-agnostic parsing helpers, while wp-lang owns language semantics, WPL-specific AST types, builtins, and runtime behavior.
What It Provides
- WPL AST types such as
WplRule,WplExpress,WplField, andWplPackage - Source parsers for rules, packages, annotations, fields, separators, and functions
- Runtime evaluation through
WplEvaluator - Built-in parsing and transformation pipeline units
- Value parsers for common formats such as JSON, KV, arrays, time, IP, and protocol text
- Precompile helpers for turning parsed rules into executable units
Quick Start
[]
= "0.1"
use Parser;
use wpl_express;
let mut code = "(digit:id, chars:name)";
let expr = wpl_express.parse_next.unwrap;
assert!;
Public API Notes
- The package name is
wp-lang - The Rust library name stays
wpl
This keeps downstream imports concise while exposing a publishable package name.
Design Boundary
wp-primitives: syntax-agnostic parsing primitiveswp-lang: WPL syntax, AST, builtins, runtime evaluation, and generation- Typed data semantics continue to rely on the published
wp-model-core,wp-parse-api, and related crates
Development
Run:
cargo checkcargo testcargo fmt --allcargo clippy --all-targets --all-features -- -D warnings
Benchmarks live under benches/ and use Criterion.
License
Distributed under the Apache License 2.0. See LICENSE.