BREAKING CHANGES: - Relationship syntax now requires blocks for all participants - Removed self/other perspective blocks from relationships - Replaced 'guard' keyword with 'if' for behavior tree decorators Language Features: - Add tree-sitter grammar with improved if/condition disambiguation - Add comprehensive tutorial and reference documentation - Add SBIR v0.2.0 binary format specification - Add resource linking system for behaviors and schedules - Add year-long schedule patterns (day, season, recurrence) - Add behavior tree enhancements (named nodes, decorators) Documentation: - Complete tutorial series (9 chapters) with baker family examples - Complete reference documentation for all language features - SBIR v0.2.0 specification with binary format details - Added locations and institutions documentation Examples: - Convert all examples to baker family scenario - Add comprehensive working examples Tooling: - Zed extension with LSP integration - Tree-sitter grammar for syntax highlighting - Build scripts and development tools Version Updates: - Main package: 0.1.0 → 0.2.0 - Tree-sitter grammar: 0.1.0 → 0.2.0 - Zed extension: 0.1.0 → 0.2.0 - Storybook editor: 0.1.0 → 0.2.0
2.1 KiB
2.1 KiB
Tree-sitter Grammar Commands
Location
Tree-sitter grammar is at: /Users/sienna/Development/storybook/tree-sitter-storybook/
Running Tests
Use Serena's execute_shell_command when Bash tool fails:
cd /Users/sienna/Development/storybook/tree-sitter-storybook && npm run test
This runs the tree-sitter test suite against all corpus files in test/corpus/.
Test Corpus Structure
Test files are in test/corpus/*.txt format:
==================
Test Name
==================
[input code]
---
[expected parse tree]
Key Parse Tree Patterns for Behaviors:
- All declarations wrap in
(declaration ...) - Behavior nodes wrap children in
(behavior_node ...) - Paths have internal structure:
Not just
(path (path_segments (identifier) (identifier)))(path)
Example Behavior Test Structure:
behavior SimpleBehavior {
walk_around
}
---
(source_file
(declaration
(behavior
name: (identifier)
root: (behavior_node
(action_node (identifier))))))
Regenerating Parser
If grammar.js changes:
cd /Users/sienna/Development/storybook/tree-sitter-storybook && npm run build
This runs tree-sitter generate and compiles the parser.
Test Results (as of 2026-02-09)
✅ All 27 tests passing:
- 17 declaration tests
- 7 behavior tree tests (selector, sequence, repeat, nested, subtree, etc.)
- 3 basic tests
Behavior Tree Node Types Tested
action_node- Simple action identifiersselector_node-? { ... }- Try options in ordersequence_node-> { ... }- Execute in sequencerepeat_node-* { ... }- Repeat foreversubtree_node-@path::to::tree- Reference external behavior
Common Issues
- Bash tool failing with exit code 1 - Use Serena's execute_shell_command instead
- Path structure mismatch - Remember paths include path_segments wrapper
- Missing declaration wrapper - All top-level items wrap in
(declaration ...) - Missing behavior_node wrapper - Behavior children wrap in
(behavior_node ...)