feat(lexer): add type system keywords

Added four keywords for new type system:
- concept: Base type definition
- sub_concept: Enum/record sub-type definition
- concept_comparison: Compile-time enum mapping
- any: Universal type for dynamic contexts

Also added:
- CLAUDE.md with project instructions and commit guidelines
- Test coverage for new keywords
- Crate-level deny directives for unused variables and dead code

Fixed pre-existing clippy issues to pass pre-commit hooks.
This commit is contained in:
2026-02-13 22:31:56 +00:00
parent 16deb5d237
commit f258a526e3
14 changed files with 151 additions and 74 deletions

View File

@@ -105,14 +105,16 @@ pub enum Priority {
Critical,
}
impl Priority {
pub fn from_str(s: &str) -> Option<Self> {
impl std::str::FromStr for Priority {
type Err = ();
fn from_str(s: &str) -> Result<Self, Self::Err> {
match s {
| "low" => Some(Priority::Low),
| "normal" => Some(Priority::Normal),
| "high" => Some(Priority::High),
| "critical" => Some(Priority::Critical),
| _ => None,
| "low" => Ok(Priority::Low),
| "normal" => Ok(Priority::Normal),
| "high" => Ok(Priority::High),
| "critical" => Ok(Priority::Critical),
| _ => Err(()),
}
}
}
@@ -126,7 +128,7 @@ pub struct Character {
pub template: Option<Vec<String>>, // `from Template1, Template2`
pub uses_behaviors: Option<Vec<BehaviorLink>>, // `uses behaviors: [...]`
pub uses_schedule: Option<Vec<String>>, /* `uses schedule: ScheduleName` or `uses schedules:
* [...]` */
* [...]` */
pub span: Span,
}