feat(resolver): implement cross-file template resolution

Enable characters to inherit from templates defined in different files
across the project structure.

- Add file_index field to NameEntry to track declaration source files
- Update NameTable::from_files() to set file indices when merging tables
- Change conversion pipeline to pass &[ast::File] instead of flat arrays
- Update merge functions to use two-level indexing:
  all_files[entry.file_index].declarations[entry.decl_index]
- Update all affected tests to use new signatures
This commit is contained in:
2026-02-08 15:45:30 +00:00
parent 9c20dd4092
commit 4c89c80748
9 changed files with 136 additions and 62 deletions

View File

@@ -52,6 +52,7 @@ fn valid_character_decl() -> impl Strategy<Value = (String, Declaration)> {
valid_ident().prop_map(|name| {
let decl = Declaration::Character(Character {
name: name.clone(),
species: None,
fields: vec![],
template: None,
@@ -157,6 +158,7 @@ proptest! {
let declarations: Vec<_> = (0..count).map(|i| {
Declaration::Character(Character {
name: name.clone(),
species: None,
fields: vec![],
template: None,
@@ -177,6 +179,7 @@ proptest! {
declarations: vec![
Declaration::Character(Character {
name: name.clone(),
species: None,
fields: vec![],
template: None,
@@ -254,6 +257,7 @@ proptest! {
declarations: vec![
Declaration::Character(Character {
name: name.clone(),
species: None,
fields: vec![],
template: None,