Updated tree-sitter grammar to match v0.3.0 LALRPOP parser: Grammar updates: - Schedule: block-based syntax with extends, override, recurrence - Life arc: requires clause for field validation - Template: uses behaviors/schedules syntax - Behavior: correct keywords (choose/then/repeat with optional params) - Type system: concept_comparison with any/is_condition - Removed concept semicolon requirement Query file updates: - highlights.scm: updated node names to *_declaration - outline.scm: updated for new declaration node names - indents.scm: updated node names, removed concept semicolon Corpus test updates: - Created schedules.txt with v0.3.0 syntax tests - Created highlights.txt for highlighting tests - Updated type_system.txt for v0.3.0 type syntax - Updated behaviors.txt for correct expression wrapping - Updated declarations.txt to use correct node names - Updated basic.txt to use character_declaration/character_body - Deleted obsolete v0.2.0 syntax tests Integration tests: - Added tree_sitter_integration.rs test suite - Fixed test_any_type to use correct v0.3.0 syntax - Fixed test_tree_sitter_grammar_builds to use generate command
49 lines
875 B
Scheme
49 lines
875 B
Scheme
; Indentation query for Storybook DSL
|
|
|
|
; Increase indent after opening braces
|
|
[
|
|
"{"
|
|
"("
|
|
"["
|
|
] @indent.begin
|
|
|
|
; Decrease indent before closing braces
|
|
[
|
|
"}"
|
|
")"
|
|
"]"
|
|
] @indent.end
|
|
|
|
; Special handling for prose blocks
|
|
(prose_block
|
|
marker: (prose_marker) @indent.begin
|
|
content: (_)
|
|
end: (_) @indent.end
|
|
)
|
|
|
|
; Block structures that should indent their contents
|
|
[
|
|
(block)
|
|
(character_declaration)
|
|
(template_declaration)
|
|
(life_arc_declaration)
|
|
(state_block)
|
|
(schedule_declaration)
|
|
(schedule_block)
|
|
(behavior_declaration)
|
|
(institution_declaration)
|
|
(relationship_declaration)
|
|
(location_declaration)
|
|
(species_declaration)
|
|
(enum_declaration)
|
|
(selector_node)
|
|
(sequence_node)
|
|
(decorator_node)
|
|
(sub_concept)
|
|
(concept_comparison)
|
|
(variant_pattern)
|
|
] @indent.begin
|
|
|
|
; Dedent after semicolon at top level
|
|
(use_declaration ";" @indent.end)
|