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

@@ -39,13 +39,11 @@ pub fn get_hover_info(text: &str, line: usize, character: usize) -> Option<Hover
}
// Add the character offset (assuming UTF-8)
let mut char_count = 0;
for (byte_pos, _) in line_text.char_indices() {
for (char_count, (byte_pos, _)) in line_text.char_indices().enumerate() {
if char_count == character {
byte_offset += byte_pos;
break;
}
char_count += 1;
}
break;
}
@@ -123,13 +121,11 @@ pub fn get_semantic_hover_info(doc: &Document, line: usize, character: usize) ->
return None;
}
let mut char_count = 0;
for (byte_pos, _) in line_text.char_indices() {
for (char_count, (byte_pos, _)) in line_text.char_indices().enumerate() {
if char_count == character {
byte_offset += byte_pos;
break;
}
char_count += 1;
}
break;
}
@@ -156,7 +152,7 @@ pub fn get_semantic_hover_info(doc: &Document, line: usize, character: usize) ->
let word = target_ident?;
// Look up the symbol in the name table
let symbol_info = doc.name_table.lookup(&[word.clone()])?;
let symbol_info = doc.name_table.lookup(std::slice::from_ref(&word))?;
// Find the declaration in the AST
for decl in &ast.declarations {