feat(parser): add action parameters, repeater decorator, and named participants

Add syntax enhancements for more expressive behavior trees and relationships.

Action parameters:
- Support typed/positional parameters: WaitDuration(2.0)
- Support named parameters: SetValue(field: value)
- Enable inline values without field names

Repeater decorator:
- Add * { node } syntax for repeating behavior nodes
- Maps to Decorator("repeat", node)

Named participant blocks:
- Replace self/other blocks with named participant syntax
- Support multi-party relationships
- Example: Alice { role: seeker } instead of self { role: seeker }

Schedule block syntax:
- Require braces for schedule blocks to support narrative fields
- Update tests to use new syntax: 04:00 -> 06:00: Activity { }
This commit is contained in:
2026-02-08 15:45:56 +00:00
parent 4c89c80748
commit a8882eb3ec
12 changed files with 5906 additions and 3659 deletions

View File

@@ -33,6 +33,7 @@ pub enum ResolvedDeclaration {
#[derive(Debug, Clone)]
pub struct ResolvedCharacter {
pub name: String,
pub species: Option<String>,
pub fields: Vec<Field>,
pub span: Span,
/// Qualified path (e.g., characters::Martha)

View File

@@ -419,6 +419,7 @@ mod tests {
states: vec![
ArcState {
name: "start".to_string(),
on_enter: None,
transitions: vec![Transition {
to: "end".to_string(),
condition: Expr::Identifier(vec!["ready".to_string()]),
@@ -428,6 +429,7 @@ mod tests {
},
ArcState {
name: "end".to_string(),
on_enter: None,
transitions: vec![],
span: Span::new(50, 100),
},
@@ -446,6 +448,7 @@ mod tests {
name: "Test".to_string(),
states: vec![ArcState {
name: "start".to_string(),
on_enter: None,
transitions: vec![Transition {
to: "nonexistent".to_string(),
condition: Expr::Identifier(vec!["ready".to_string()]),

View File

@@ -161,6 +161,7 @@ proptest! {
states: vec![
ArcState {
name: state1_name.clone(),
on_enter: None,
transitions: vec![Transition {
to: state2_name.clone(),
condition: Expr::BoolLit(true),
@@ -170,6 +171,7 @@ proptest! {
},
ArcState {
name: state2_name,
on_enter: None,
transitions: vec![],
span: Span::new(50, 100),
},