feat(lang): complete extends to modifies keyword migration

This commit completes the migration started in the previous commit,
updating all remaining files:

- Lexer: Changed token from Extends to Modifies
- Parser: Updated lalrpop grammar rules and AST field names
- AST: Renamed Schedule.extends field to modifies
- Grammar: Updated tree-sitter grammar.js
- Tree-sitter: Regenerated parser.c and node-types.json
- Examples: Updated baker-family work schedules
- Tests: Updated schedule composition tests and corpus
- Docs: Updated all reference documentation and tutorials
- Validation: Updated error messages and validation logic
- Package: Bumped version to 0.3.1 in all package manifests

All 554 tests pass.
This commit is contained in:
2026-02-16 22:55:04 +00:00
parent 2c898347ee
commit 47fafdc2bf
109 changed files with 5045 additions and 41939 deletions

View File

@@ -52,7 +52,7 @@ Martha and Jane are a married couple who co-run the bakery. Emma is their daught
- **Character inheritance**: Characters automatically inherit behaviors and schedules from templates
### Schedule Composition
- **Schedule inheritance**: `BakerSchedule extends WorkWeek`
- **Schedule inheritance**: `BakerSchedule modifies WorkWeek`
- **Override blocks**: Modify inherited time blocks with `override work { ... }`
- **Named blocks**: All blocks have names for the override system
- **Action references**: Schedule blocks reference behavior trees via `action: BehaviorName`
@@ -132,7 +132,7 @@ WorkWeek
├─ work (09:00-17:00)
└─ evening_rest (18:00-22:00)
BakerSchedule extends WorkWeek
BakerSchedule modifies WorkWeek
├─ pre_dawn_prep (04:00-05:00) [NEW]
├─ work (05:00-13:00) [OVERRIDE] -> action: BakingWork
├─ evening_rest (18:00-22:00) [INHERITED]
@@ -169,7 +169,7 @@ Maps baking skill tiers to quality expectations:
1. **Martha (character)** -> inherits from **Baker (template)** -> inherits from **Human (species)**
- Gets default fields from Human species (age, energy, mood, occupation)
- Gets behaviors: `BakingSkills`, `CustomerService`, `BasicNeeds`, `SocialInteraction`
- Gets schedule: `BakerSchedule` (which extends `WorkWeek`)
- Gets schedule: `BakerSchedule` (which modifies `WorkWeek`)
- Has `skill_tier: Master` for concept comparison mapping
2. **Relationships** -> connect characters with asymmetric perspectives

View File

@@ -1,7 +1,7 @@
//! Work schedules for the Baker family
//!
//! Demonstrates schedule composition features:
//! - extends keyword for schedule inheritance
//! - modifies keyword for schedule inheritance
//! - override blocks to modify inherited schedules
//! - Named blocks for override system
//! - Action references to behavior trees
@@ -14,8 +14,8 @@ schedule WorkWeek {
block evening_rest { 18:00 -> 22:00, action:Resting }
}
// Baker's schedule extends WorkWeek
schedule BakerSchedule extends WorkWeek {
// Baker's schedule modifies WorkWeek
schedule BakerSchedule modifies WorkWeek {
// Bakers start early - override the work block
override work {
05:00 -> 13:00
@@ -40,7 +40,7 @@ schedule BakerSchedule extends WorkWeek {
}
// Assistant baker schedule (helps during busy times)
schedule AssistantSchedule extends BakerSchedule {
schedule AssistantSchedule modifies BakerSchedule {
// Assistant comes in later
override work {
06:00 -> 14:00