提取命名空间
(&self, file_path: &Path)
| 392 | |
| 393 | /// 提取命名空间 |
| 394 | fn _extract_namespace(&self, file_path: &Path) -> String { |
| 395 | // 从文件内容解析命名空间 |
| 396 | if let Ok(content) = fs::read_to_string(file_path) { |
| 397 | return self._extract_namespace_from_content(&content, &file_path.to_path_buf()); |
| 398 | } |
| 399 | "global".to_string() |
| 400 | } |
| 401 | |
| 402 | /// 解析单个文件(完整实现,支持多语言) |
| 403 | pub fn parse_file(&mut self, file_path: &PathBuf) -> Result<(), String> { |
no test coverage detected