2026-02-09 22:06:25 +00:00
|
|
|
==================
|
|
|
|
|
Use declaration - simple
|
|
|
|
|
==================
|
|
|
|
|
|
|
|
|
|
use schema::core::Item;
|
|
|
|
|
|
|
|
|
|
---
|
|
|
|
|
|
|
|
|
|
(source_file
|
|
|
|
|
(declaration
|
|
|
|
|
(use_declaration
|
|
|
|
|
(path_segments
|
|
|
|
|
(identifier)
|
|
|
|
|
(identifier)
|
|
|
|
|
(identifier)))))
|
|
|
|
|
|
|
|
|
|
==================
|
|
|
|
|
Use declaration - grouped import
|
|
|
|
|
==================
|
|
|
|
|
|
|
|
|
|
use schema::core::{Item1, Item2, Item3};
|
|
|
|
|
|
|
|
|
|
---
|
|
|
|
|
|
|
|
|
|
(source_file
|
|
|
|
|
(declaration
|
|
|
|
|
(use_declaration
|
|
|
|
|
(path_segments
|
|
|
|
|
(identifier)
|
|
|
|
|
(identifier))
|
|
|
|
|
(identifier)
|
|
|
|
|
(identifier)
|
|
|
|
|
(identifier))))
|
|
|
|
|
|
|
|
|
|
==================
|
|
|
|
|
Use declaration - wildcard
|
|
|
|
|
==================
|
|
|
|
|
|
|
|
|
|
use schema::beings::*;
|
|
|
|
|
|
|
|
|
|
---
|
|
|
|
|
|
|
|
|
|
(source_file
|
|
|
|
|
(declaration
|
|
|
|
|
(use_declaration
|
|
|
|
|
(path_segments
|
|
|
|
|
(identifier)
|
|
|
|
|
(identifier)))))
|
|
|
|
|
|
|
|
|
|
==================
|
|
|
|
|
Character - full featured
|
|
|
|
|
==================
|
|
|
|
|
|
|
|
|
|
character Alice: Human from Curious {
|
|
|
|
|
age: 7
|
|
|
|
|
height: 4.2
|
|
|
|
|
name: "Alice Liddell"
|
|
|
|
|
curious: true
|
|
|
|
|
age_range: 5..10
|
|
|
|
|
|
|
|
|
|
---backstory
|
|
|
|
|
A curious young girl.
|
|
|
|
|
---
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
---
|
|
|
|
|
|
|
|
|
|
(source_file
|
|
|
|
|
(declaration
|
2026-02-14 17:43:26 +00:00
|
|
|
(character_declaration
|
2026-02-09 22:06:25 +00:00
|
|
|
name: (identifier)
|
|
|
|
|
species: (identifier)
|
|
|
|
|
template: (template_clause (identifier))
|
2026-02-14 17:43:26 +00:00
|
|
|
body: (character_body
|
2026-02-09 22:06:25 +00:00
|
|
|
(field
|
|
|
|
|
name: (dotted_path (identifier))
|
|
|
|
|
value: (value (integer)))
|
|
|
|
|
(field
|
|
|
|
|
name: (dotted_path (identifier))
|
|
|
|
|
value: (value (float)))
|
|
|
|
|
(field
|
|
|
|
|
name: (dotted_path (identifier))
|
|
|
|
|
value: (value (string)))
|
|
|
|
|
(field
|
|
|
|
|
name: (dotted_path (identifier))
|
|
|
|
|
value: (value (boolean)))
|
|
|
|
|
(field
|
|
|
|
|
name: (dotted_path (identifier))
|
|
|
|
|
value: (value (range (integer) (integer))))
|
|
|
|
|
(field
|
|
|
|
|
(prose_block
|
|
|
|
|
marker: (prose_marker)
|
|
|
|
|
tag: (identifier)
|
|
|
|
|
content: (prose_content)
|
|
|
|
|
end: (prose_marker)))))))
|
|
|
|
|
|
|
|
|
|
==================
|
|
|
|
|
Template with includes
|
|
|
|
|
==================
|
|
|
|
|
|
|
|
|
|
template BaseCharacter strict {
|
|
|
|
|
include Physical
|
|
|
|
|
include Mental
|
|
|
|
|
|
|
|
|
|
age: 0
|
|
|
|
|
name: ""
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
---
|
|
|
|
|
|
|
|
|
|
(source_file
|
|
|
|
|
(declaration
|
2026-02-14 17:43:26 +00:00
|
|
|
(template_declaration
|
2026-02-09 22:06:25 +00:00
|
|
|
name: (identifier)
|
2026-02-14 17:43:26 +00:00
|
|
|
body: (template_body
|
|
|
|
|
(include (identifier))
|
|
|
|
|
(include (identifier))
|
|
|
|
|
(field
|
|
|
|
|
name: (dotted_path (identifier))
|
|
|
|
|
value: (value (integer)))
|
|
|
|
|
(field
|
|
|
|
|
name: (dotted_path (identifier))
|
|
|
|
|
value: (value (string)))))))
|
2026-02-09 22:06:25 +00:00
|
|
|
|
|
|
|
|
==================
|
|
|
|
|
Life arc with states and transitions
|
|
|
|
|
==================
|
|
|
|
|
|
|
|
|
|
life_arc Journey {
|
|
|
|
|
---description
|
|
|
|
|
The character's journey.
|
|
|
|
|
---
|
|
|
|
|
|
|
|
|
|
state young {
|
|
|
|
|
on enter {
|
|
|
|
|
age: 5
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
on age >= 18 -> adult
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
state adult {
|
|
|
|
|
on retire is true -> retired
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
state retired {
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
---
|
|
|
|
|
|
|
|
|
|
(source_file
|
|
|
|
|
(declaration
|
2026-02-14 17:43:26 +00:00
|
|
|
(life_arc_declaration
|
2026-02-09 22:06:25 +00:00
|
|
|
name: (identifier)
|
|
|
|
|
(field
|
|
|
|
|
(prose_block
|
|
|
|
|
marker: (prose_marker)
|
|
|
|
|
tag: (identifier)
|
|
|
|
|
content: (prose_content)
|
|
|
|
|
end: (prose_marker)))
|
2026-02-14 17:43:26 +00:00
|
|
|
(state_block
|
2026-02-09 22:06:25 +00:00
|
|
|
name: (identifier)
|
2026-02-14 17:43:26 +00:00
|
|
|
body: (state_body
|
|
|
|
|
(on_enter
|
|
|
|
|
(block
|
|
|
|
|
(field
|
|
|
|
|
name: (dotted_path (identifier))
|
|
|
|
|
value: (value (integer)))))
|
|
|
|
|
(transition
|
|
|
|
|
condition: (expression
|
|
|
|
|
(comparison
|
|
|
|
|
(expression (primary_expression (path (path_segments (identifier)))))
|
|
|
|
|
(expression (primary_expression (integer)))))
|
|
|
|
|
target: (identifier))))
|
|
|
|
|
(state_block
|
2026-02-09 22:06:25 +00:00
|
|
|
name: (identifier)
|
2026-02-14 17:43:26 +00:00
|
|
|
body: (state_body
|
|
|
|
|
(transition
|
|
|
|
|
condition: (expression
|
|
|
|
|
(comparison
|
|
|
|
|
(expression (primary_expression (path (path_segments (identifier)))))
|
|
|
|
|
(expression (primary_expression (boolean)))))
|
|
|
|
|
target: (identifier))))
|
|
|
|
|
(state_block
|
|
|
|
|
name: (identifier)
|
|
|
|
|
body: (state_body)))))
|
2026-02-09 22:06:25 +00:00
|
|
|
|
|
|
|
|
==================
|
|
|
|
|
Institution
|
|
|
|
|
==================
|
|
|
|
|
|
|
|
|
|
institution Wonderland {
|
|
|
|
|
type: "fantasy_realm"
|
|
|
|
|
ruler: "Queen of Hearts"
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
---
|
|
|
|
|
|
|
|
|
|
(source_file
|
|
|
|
|
(declaration
|
2026-02-14 17:43:26 +00:00
|
|
|
(institution_declaration
|
2026-02-09 22:06:25 +00:00
|
|
|
name: (identifier)
|
2026-02-14 17:43:26 +00:00
|
|
|
body: (block
|
2026-02-09 22:06:25 +00:00
|
|
|
(field
|
|
|
|
|
name: (dotted_path (identifier))
|
|
|
|
|
value: (value (string)))
|
|
|
|
|
(field
|
|
|
|
|
name: (dotted_path (identifier))
|
|
|
|
|
value: (value (string)))))))
|
|
|
|
|
|
|
|
|
|
==================
|
|
|
|
|
Location
|
|
|
|
|
==================
|
|
|
|
|
|
|
|
|
|
location TeaParty {
|
|
|
|
|
description: "A mad tea party"
|
|
|
|
|
capacity: 10
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
---
|
|
|
|
|
|
|
|
|
|
(source_file
|
|
|
|
|
(declaration
|
2026-02-14 17:43:26 +00:00
|
|
|
(location_declaration
|
2026-02-09 22:06:25 +00:00
|
|
|
name: (identifier)
|
2026-02-14 17:43:26 +00:00
|
|
|
body: (block
|
2026-02-09 22:06:25 +00:00
|
|
|
(field
|
|
|
|
|
name: (dotted_path (identifier))
|
|
|
|
|
value: (value (string)))
|
|
|
|
|
(field
|
|
|
|
|
name: (dotted_path (identifier))
|
|
|
|
|
value: (value (integer)))))))
|
|
|
|
|
|
|
|
|
|
==================
|
|
|
|
|
Species with includes
|
|
|
|
|
==================
|
|
|
|
|
|
|
|
|
|
species Cat {
|
|
|
|
|
include Mammal
|
|
|
|
|
|
|
|
|
|
purrs: true
|
|
|
|
|
lives: 9
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
---
|
|
|
|
|
|
|
|
|
|
(source_file
|
|
|
|
|
(declaration
|
2026-02-14 17:43:26 +00:00
|
|
|
(species_declaration
|
2026-02-09 22:06:25 +00:00
|
|
|
name: (identifier)
|
2026-02-14 17:43:26 +00:00
|
|
|
body: (species_body
|
|
|
|
|
(include (identifier))
|
|
|
|
|
(species_field
|
|
|
|
|
name: (identifier)
|
|
|
|
|
value: (boolean))
|
|
|
|
|
(species_field
|
|
|
|
|
name: (identifier)
|
|
|
|
|
value: (integer))))))
|
2026-02-09 22:06:25 +00:00
|
|
|
|
|
|
|
|
==================
|
|
|
|
|
Enum declaration
|
|
|
|
|
==================
|
|
|
|
|
|
|
|
|
|
enum EmotionalState {
|
|
|
|
|
happy, sad, angry, confused, curious
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
---
|
|
|
|
|
|
|
|
|
|
(source_file
|
|
|
|
|
(declaration
|
|
|
|
|
(enum_declaration
|
|
|
|
|
name: (identifier)
|
|
|
|
|
(identifier)
|
|
|
|
|
(identifier)
|
|
|
|
|
(identifier)
|
|
|
|
|
(identifier)
|
|
|
|
|
(identifier))))
|
|
|
|
|
|
|
|
|
|
==================
|
|
|
|
|
Override syntax
|
|
|
|
|
==================
|
|
|
|
|
|
|
|
|
|
character SpecialAlice {
|
|
|
|
|
base: @Alice {
|
|
|
|
|
remove backstory
|
|
|
|
|
append age_category: "child"
|
|
|
|
|
curious: false
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
---
|
|
|
|
|
|
|
|
|
|
(source_file
|
|
|
|
|
(declaration
|
2026-02-14 17:43:26 +00:00
|
|
|
(character_declaration
|
2026-02-09 22:06:25 +00:00
|
|
|
name: (identifier)
|
2026-02-14 17:43:26 +00:00
|
|
|
body: (character_body
|
2026-02-09 22:06:25 +00:00
|
|
|
(field
|
|
|
|
|
name: (dotted_path (identifier))
|
|
|
|
|
value: (value
|
|
|
|
|
(override
|
|
|
|
|
(path (path_segments (identifier)))
|
|
|
|
|
(override_op (identifier))
|
|
|
|
|
(override_op
|
|
|
|
|
(field
|
|
|
|
|
name: (dotted_path (identifier))
|
|
|
|
|
value: (value (string))))
|
|
|
|
|
(override_op
|
|
|
|
|
(field
|
|
|
|
|
name: (dotted_path (identifier))
|
|
|
|
|
value: (value (boolean)))))))))))
|
|
|
|
|
|
|
|
|
|
==================
|
|
|
|
|
Complex expressions in conditions
|
|
|
|
|
==================
|
|
|
|
|
|
|
|
|
|
life_arc ComplexLogic {
|
|
|
|
|
state test {
|
|
|
|
|
on self.age > 18 and other.trust >= 0.5 -> trusted
|
|
|
|
|
on not self.valid or self.expired is true -> invalid
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
state trusted {
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
state invalid {
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
---
|
|
|
|
|
|
|
|
|
|
(source_file
|
|
|
|
|
(declaration
|
2026-02-14 17:43:26 +00:00
|
|
|
(life_arc_declaration
|
2026-02-09 22:06:25 +00:00
|
|
|
name: (identifier)
|
2026-02-14 17:43:26 +00:00
|
|
|
(state_block
|
|
|
|
|
name: (identifier)
|
|
|
|
|
body: (state_body
|
|
|
|
|
(transition
|
|
|
|
|
condition: (expression
|
|
|
|
|
(and_expression
|
|
|
|
|
(expression
|
|
|
|
|
(comparison
|
|
|
|
|
(expression
|
|
|
|
|
(field_access
|
|
|
|
|
(expression (primary_expression))
|
|
|
|
|
(identifier)))
|
|
|
|
|
(expression (primary_expression (integer)))))
|
|
|
|
|
(expression
|
|
|
|
|
(comparison
|
|
|
|
|
(expression
|
|
|
|
|
(field_access
|
|
|
|
|
(expression (primary_expression))
|
|
|
|
|
(identifier)))
|
|
|
|
|
(expression (primary_expression (float)))))))
|
|
|
|
|
target: (identifier))
|
|
|
|
|
(transition
|
|
|
|
|
condition: (expression
|
|
|
|
|
(or_expression
|
|
|
|
|
(expression
|
|
|
|
|
(not_expression
|
|
|
|
|
(expression
|
|
|
|
|
(field_access
|
|
|
|
|
(expression (primary_expression))
|
|
|
|
|
(identifier)))))
|
|
|
|
|
(expression
|
|
|
|
|
(comparison
|
|
|
|
|
(expression
|
|
|
|
|
(field_access
|
|
|
|
|
(expression (primary_expression))
|
|
|
|
|
(identifier)))
|
|
|
|
|
(expression (primary_expression (boolean)))))))
|
|
|
|
|
target: (identifier))))
|
|
|
|
|
(state_block
|
2026-02-09 22:06:25 +00:00
|
|
|
name: (identifier)
|
2026-02-14 17:43:26 +00:00
|
|
|
body: (state_body))
|
|
|
|
|
(state_block
|
|
|
|
|
name: (identifier)
|
|
|
|
|
body: (state_body)))))
|
2026-02-09 22:06:25 +00:00
|
|
|
|
|
|
|
|
==================
|
|
|
|
|
List and object values
|
|
|
|
|
==================
|
|
|
|
|
|
|
|
|
|
character DataRich {
|
|
|
|
|
tags: ["smart", "brave", "curious"]
|
|
|
|
|
stats: {
|
|
|
|
|
strength: 10
|
|
|
|
|
intelligence: 15
|
|
|
|
|
}
|
|
|
|
|
matrix: [[1, 2], [3, 4]]
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
---
|
|
|
|
|
|
|
|
|
|
(source_file
|
|
|
|
|
(declaration
|
2026-02-14 17:43:26 +00:00
|
|
|
(character_declaration
|
2026-02-09 22:06:25 +00:00
|
|
|
name: (identifier)
|
2026-02-14 17:43:26 +00:00
|
|
|
body: (character_body
|
2026-02-09 22:06:25 +00:00
|
|
|
(field
|
|
|
|
|
name: (dotted_path (identifier))
|
|
|
|
|
value: (value
|
|
|
|
|
(list
|
|
|
|
|
(value (string))
|
|
|
|
|
(value (string))
|
|
|
|
|
(value (string)))))
|
|
|
|
|
(field
|
|
|
|
|
name: (dotted_path (identifier))
|
|
|
|
|
value: (value
|
|
|
|
|
(object
|
|
|
|
|
(block
|
|
|
|
|
(field
|
|
|
|
|
name: (dotted_path (identifier))
|
|
|
|
|
value: (value (integer)))
|
|
|
|
|
(field
|
|
|
|
|
name: (dotted_path (identifier))
|
|
|
|
|
value: (value (integer)))))))
|
|
|
|
|
(field
|
|
|
|
|
name: (dotted_path (identifier))
|
|
|
|
|
value: (value
|
|
|
|
|
(list
|
|
|
|
|
(value
|
|
|
|
|
(list
|
|
|
|
|
(value (integer))
|
|
|
|
|
(value (integer))))
|
|
|
|
|
(value
|
|
|
|
|
(list
|
|
|
|
|
(value (integer))
|
|
|
|
|
(value (integer)))))))))))
|
|
|
|
|
|
|
|
|
|
==================
|
|
|
|
|
Dotted field paths
|
|
|
|
|
==================
|
|
|
|
|
|
|
|
|
|
character Nested {
|
|
|
|
|
appearance.hair.color: "blonde"
|
|
|
|
|
stats.mental.intelligence: 15
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
---
|
|
|
|
|
|
|
|
|
|
(source_file
|
|
|
|
|
(declaration
|
2026-02-14 17:43:26 +00:00
|
|
|
(character_declaration
|
2026-02-09 22:06:25 +00:00
|
|
|
name: (identifier)
|
2026-02-14 17:43:26 +00:00
|
|
|
body: (character_body
|
2026-02-09 22:06:25 +00:00
|
|
|
(field
|
|
|
|
|
name: (dotted_path
|
|
|
|
|
(identifier)
|
|
|
|
|
(identifier)
|
|
|
|
|
(identifier))
|
|
|
|
|
value: (value (string)))
|
|
|
|
|
(field
|
|
|
|
|
name: (dotted_path
|
|
|
|
|
(identifier)
|
|
|
|
|
(identifier)
|
|
|
|
|
(identifier))
|
|
|
|
|
value: (value (integer)))))))
|