2026-02-09 22:06:25 +00:00
|
|
|
; Highlights query for Storybook DSL
|
|
|
|
|
; Maps grammar nodes to standard highlight groups
|
|
|
|
|
|
|
|
|
|
; Comments
|
|
|
|
|
(line_comment) @comment.line
|
|
|
|
|
(block_comment) @comment.block
|
|
|
|
|
|
|
|
|
|
; Keywords - Declaration keywords
|
|
|
|
|
[
|
|
|
|
|
"character"
|
|
|
|
|
"template"
|
|
|
|
|
"life_arc"
|
|
|
|
|
"schedule"
|
|
|
|
|
"behavior"
|
|
|
|
|
"institution"
|
|
|
|
|
"relationship"
|
|
|
|
|
"location"
|
|
|
|
|
"species"
|
|
|
|
|
"enum"
|
|
|
|
|
"state"
|
2026-02-14 14:29:29 +00:00
|
|
|
"concept"
|
|
|
|
|
"sub_concept"
|
feat(lang): rename concept_comparison to definition (v0.3.2)
Renames the `concept_comparison` keyword to `definition` across the
entire codebase for better readability and conciseness.
Changes:
- Tree-sitter grammar: `concept_comparison` node → `definition`
- Tree-sitter queries: highlights, outline, and indents updated
- Zed extension highlights.scm updated to match
- Lexer: `Token::ConceptComparison` → `Token::Definition`
- Parser: `ConceptComparisonDecl` rule → `DefinitionDecl`
- AST: `Declaration::ConceptComparison` → `Declaration::Definition`,
`ConceptComparisonDecl` struct → `DefinitionDecl`
- All Rust source files updated (validate, names, convert, references,
semantic_tokens, symbols, code_actions, hover, completion)
- `validate_concept_comparison_patterns` → `validate_definition_patterns`
- Example file and test corpus updated
- Spec docs: created SBIR-v0.3.2-SPEC.md, updated TYPE-SYSTEM.md,
README.md, SBIR-CHANGELOG.md, SBIR-v0.3.1-SPEC.md
2026-02-23 20:37:52 +00:00
|
|
|
"definition"
|
2026-02-09 22:06:25 +00:00
|
|
|
] @keyword.declaration
|
|
|
|
|
|
|
|
|
|
; Keywords - Control flow and modifiers
|
|
|
|
|
[
|
|
|
|
|
"and"
|
|
|
|
|
"or"
|
|
|
|
|
"not"
|
|
|
|
|
"on"
|
|
|
|
|
"enter"
|
|
|
|
|
"strict"
|
|
|
|
|
] @keyword.control
|
|
|
|
|
|
|
|
|
|
; Keywords - Import/module
|
|
|
|
|
[
|
|
|
|
|
"use"
|
|
|
|
|
"include"
|
|
|
|
|
"from"
|
|
|
|
|
] @keyword.import
|
|
|
|
|
|
|
|
|
|
; Keywords - Special
|
|
|
|
|
[
|
|
|
|
|
"as"
|
|
|
|
|
"self"
|
|
|
|
|
"other"
|
|
|
|
|
"remove"
|
|
|
|
|
"append"
|
|
|
|
|
"is"
|
|
|
|
|
] @keyword.special
|
|
|
|
|
|
2026-02-14 16:41:37 +00:00
|
|
|
; any type keyword
|
|
|
|
|
(any_type) @keyword.special
|
|
|
|
|
|
2026-02-09 22:06:25 +00:00
|
|
|
; Boolean literals
|
|
|
|
|
[
|
|
|
|
|
"true"
|
|
|
|
|
"false"
|
|
|
|
|
] @constant.builtin.boolean
|
|
|
|
|
|
|
|
|
|
; Numbers
|
|
|
|
|
(integer) @constant.numeric.integer
|
|
|
|
|
(float) @constant.numeric.float
|
|
|
|
|
(time) @constant.numeric.time
|
|
|
|
|
(duration) @constant.numeric.duration
|
|
|
|
|
|
|
|
|
|
; Strings
|
|
|
|
|
(string) @string
|
|
|
|
|
|
|
|
|
|
; Identifiers in different contexts
|
2026-02-14 17:43:26 +00:00
|
|
|
(character_declaration name: (identifier) @type.character)
|
|
|
|
|
(template_declaration name: (identifier) @type.template)
|
|
|
|
|
(life_arc_declaration name: (identifier) @type.life_arc)
|
|
|
|
|
(schedule_declaration name: (identifier) @type.schedule)
|
|
|
|
|
(behavior_declaration name: (identifier) @type.behavior)
|
|
|
|
|
(institution_declaration name: (identifier) @type.institution)
|
|
|
|
|
(relationship_declaration name: (identifier) @type.relationship)
|
|
|
|
|
(location_declaration name: (identifier) @type.location)
|
|
|
|
|
(species_declaration name: (identifier) @type.species)
|
2026-02-09 22:06:25 +00:00
|
|
|
(enum_declaration name: (identifier) @type.enum)
|
2026-02-14 17:43:26 +00:00
|
|
|
(state_block name: (identifier) @type.state)
|
2026-02-14 14:29:29 +00:00
|
|
|
(concept_declaration name: (identifier) @type.concept)
|
|
|
|
|
(sub_concept parent: (identifier) @type.concept)
|
|
|
|
|
(sub_concept name: (identifier) @type.sub_concept)
|
feat(lang): rename concept_comparison to definition (v0.3.2)
Renames the `concept_comparison` keyword to `definition` across the
entire codebase for better readability and conciseness.
Changes:
- Tree-sitter grammar: `concept_comparison` node → `definition`
- Tree-sitter queries: highlights, outline, and indents updated
- Zed extension highlights.scm updated to match
- Lexer: `Token::ConceptComparison` → `Token::Definition`
- Parser: `ConceptComparisonDecl` rule → `DefinitionDecl`
- AST: `Declaration::ConceptComparison` → `Declaration::Definition`,
`ConceptComparisonDecl` struct → `DefinitionDecl`
- All Rust source files updated (validate, names, convert, references,
semantic_tokens, symbols, code_actions, hover, completion)
- `validate_concept_comparison_patterns` → `validate_definition_patterns`
- Example file and test corpus updated
- Spec docs: created SBIR-v0.3.2-SPEC.md, updated TYPE-SYSTEM.md,
README.md, SBIR-CHANGELOG.md, SBIR-v0.3.1-SPEC.md
2026-02-23 20:37:52 +00:00
|
|
|
(definition name: (identifier) @type.definition)
|
2026-02-14 14:29:29 +00:00
|
|
|
(variant_pattern name: (identifier) @type.variant)
|
2026-02-14 17:43:26 +00:00
|
|
|
(template_declaration species: (identifier) @type.builtin)
|
2026-02-09 22:06:25 +00:00
|
|
|
|
|
|
|
|
; Field names
|
|
|
|
|
(field name: (dotted_path) @property)
|
2026-02-14 14:29:29 +00:00
|
|
|
(sub_concept_field name: (identifier) @property)
|
2026-02-09 22:06:25 +00:00
|
|
|
|
|
|
|
|
; Species reference
|
2026-02-14 17:43:26 +00:00
|
|
|
(character_declaration species: (identifier) @type.builtin)
|
2026-02-09 22:06:25 +00:00
|
|
|
|
|
|
|
|
; Paths and identifiers
|
|
|
|
|
(path) @namespace
|
|
|
|
|
(identifier) @variable
|
|
|
|
|
|
|
|
|
|
; Prose blocks - tag and content
|
|
|
|
|
(prose_block tag: (identifier) @tag)
|
|
|
|
|
(prose_block marker: (prose_marker) @punctuation.delimiter)
|
|
|
|
|
(prose_content) @markup.raw
|
|
|
|
|
|
|
|
|
|
; Operators
|
|
|
|
|
[
|
|
|
|
|
">"
|
|
|
|
|
">="
|
|
|
|
|
"<"
|
|
|
|
|
"<="
|
|
|
|
|
"->"
|
|
|
|
|
"is"
|
|
|
|
|
] @operator
|
|
|
|
|
|
|
|
|
|
; Punctuation
|
|
|
|
|
[
|
|
|
|
|
"{"
|
|
|
|
|
"}"
|
|
|
|
|
] @punctuation.bracket
|
|
|
|
|
|
|
|
|
|
[
|
|
|
|
|
"("
|
|
|
|
|
")"
|
|
|
|
|
] @punctuation.bracket
|
|
|
|
|
|
|
|
|
|
[
|
|
|
|
|
"["
|
|
|
|
|
"]"
|
|
|
|
|
] @punctuation.bracket
|
|
|
|
|
|
|
|
|
|
[
|
|
|
|
|
":"
|
|
|
|
|
"::"
|
|
|
|
|
";"
|
|
|
|
|
","
|
|
|
|
|
"."
|
|
|
|
|
".."
|
|
|
|
|
"*"
|
|
|
|
|
"@"
|
|
|
|
|
] @punctuation.delimiter
|
|
|
|
|
|
|
|
|
|
; Behavior tree nodes
|
|
|
|
|
(action_node (identifier) @function.action)
|
|
|
|
|
|
|
|
|
|
; Transitions
|
|
|
|
|
(transition "->" @operator.transition)
|
|
|
|
|
(transition target: (identifier) @type.state)
|
|
|
|
|
|
|
|
|
|
; Schedule blocks
|
2026-02-14 17:43:26 +00:00
|
|
|
(schedule_block name: (identifier) @function.schedule_block)
|
2026-02-09 22:06:25 +00:00
|
|
|
|
|
|
|
|
; Override operations
|
|
|
|
|
(override "@" @keyword.override)
|
|
|
|
|
(override_op "remove" @keyword.override)
|
|
|
|
|
(override_op "append" @keyword.override)
|
|
|
|
|
|
|
|
|
|
; Template clause
|
|
|
|
|
(template_clause "from" @keyword.import)
|
|
|
|
|
|
|
|
|
|
; Error handling
|
|
|
|
|
(ERROR) @error
|