Expand description
Source-string grammar parser — turns the user-facing
source expression (e.g. "1..10", "[a, b, c]",
"fib(8)") into a typed Source value.
Polydat owns the source-string grammar per the audit resolution + this design pass: SRD-18c covers the parser- layer surface conceptually, but the actual parsing lives here so all polydat consumers share one canonical source-grammar implementation.
Recognized forms:
| Source text | Produces |
|---|---|
1..10 | IntRange { lo: 1, hi: 10, step: 1 } |
1..=10 | IntRange { lo: 1, hi: 11, step: 1 } (inclusive end) |
1..10 step 2 | IntRange { lo: 1, hi: 10, step: 2 } |
[a, b, c] | Literal { values: [Str, Str, Str] } |
[1, 2, 3] | Literal { values: [Int, Int, Int] } |
[1.0, 2.5] | Literal { values: [Float, Float] } |
[true, false] | Literal { values: [Bool, Bool] } |
{name} | WorkloadParamList { name: "name", len_hint: None } |
fib(8) (or any ident(...)) | Generator { expr, cardinality_hint: None } |
0.0..1.0 | ContinuousInterval { interval, measure: Uniform } |
Any other text is a Generator expression the runtime
evaluates; SourceParseError::Unrecognized is not produced by
this path.
Enums§
- Source
Parse Error - Errors that can arise during source-string parsing.
Functions§
- parse_
source - Parse a source-expression string into a typed
Source.