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:
@@ -52,6 +52,7 @@ pub enum UseKind {
|
||||
#[derive(Debug, Clone, PartialEq)]
|
||||
pub struct Character {
|
||||
pub name: String,
|
||||
pub species: Option<String>, // `: Species` - what the character fundamentally is
|
||||
pub fields: Vec<Field>,
|
||||
pub template: Option<Vec<String>>, // `from Template1, Template2`
|
||||
pub span: Span,
|
||||
@@ -142,6 +143,7 @@ pub struct LifeArc {
|
||||
#[derive(Debug, Clone, PartialEq)]
|
||||
pub struct ArcState {
|
||||
pub name: String,
|
||||
pub on_enter: Option<Vec<Field>>,
|
||||
pub transitions: Vec<Transition>,
|
||||
pub span: Span,
|
||||
}
|
||||
@@ -166,6 +168,7 @@ pub struct ScheduleBlock {
|
||||
pub start: Time,
|
||||
pub end: Time,
|
||||
pub activity: String,
|
||||
pub fields: Vec<Field>,
|
||||
pub span: Span,
|
||||
}
|
||||
|
||||
@@ -225,6 +228,7 @@ pub struct Location {
|
||||
#[derive(Debug, Clone, PartialEq)]
|
||||
pub struct Species {
|
||||
pub name: String,
|
||||
pub includes: Vec<String>,
|
||||
pub fields: Vec<Field>,
|
||||
pub span: Span,
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user