Skip to main content

Module expression

Module expression 

Source
Expand description

Cucumber-expression matching — the owned layer over the cucumber-expressions crate’s grammar parser. Replaces io.cucumber.cucumberexpressions. We take the crate’s AST parser (the escape-rule-dense part) and own the small, corpus-pinned rest: regex generation with one named group per parameter, built-in + custom parameter types, argument extraction, and parameter_type_names.

Deviation from the cucumber-expressions 20.0.0 line every other port pins (recorded in ADR 0006, doc/adr/0006-rust-port.md): there is no official Rust port, so this crate hand-writes the regex generation, and only the {int}, {word}, and {string} built-ins exist. All other 20.0.0 built-ins — {float}, {double}, {byte}, {short}, {long}, {biginteger}, {bigdecimal}, and the anonymous {} — are omitted: the numeric ones need lookahead the regex crate lacks, and none is used by the conformance corpus. Using one fails loudly at registration (“Undefined parameter type {double}”), never silently misparses.

Structs§

Argument
One captured argument of a whole-string match.
CompiledExpression
A compiled cucumber expression.
ExpressionError
An expression failed to compile.
ParameterTypeRegistry
Registry of parameter types (built-ins + author-defined custom types).

Functions§

parameter_type_names
Parameter-type names in source order, read from the parsed AST (escaped braces \{...\} are literal text, not parameters).

Type Aliases§

ParseFn
A parameter-type transform. Receives the type’s regexp capture groups in order (a group that did not participate arrives as "" — the closest &[&str] can come to Java’s null/Python’s None); a regexp with no groups of its own receives the whole matched text as the single element. Mirrors Java’s CaptureGroupTransformer / Python’s parse(*groups).