| Crates.io | unfault-core |
| lib.rs | unfault-core |
| version | 0.1.7 |
| created_at | 2025-12-20 17:58:50.065963+00 |
| updated_at | 2026-01-15 13:47:34.338651+00 |
| description | Core parsing, semantics extraction, and graph building for unfault |
| homepage | https://unfault.dev |
| repository | https://github.com/unfault/core |
| max_upload_size | |
| id | 1996806 |
| size | 1,252,781 |
Core parsing, semantics extraction, and graph building for unfault.
This crate provides language-agnostic code analysis capabilities:
use unfault_core::parse::python::parse_python_file;
use unfault_core::semantics::python::model::PyFileSemantics;
use unfault_core::graph::build_code_graph;
use unfault_core::types::context::{SourceFile, Language};
use unfault_core::parse::ast::FileId;
// Parse a Python file
let source = SourceFile {
path: "example.py".to_string(),
language: Language::Python,
content: r#"
import os
from typing import List
def hello(name: str) -> str:
return f"Hello, {name}!"
"#.to_string(),
};
let parsed = parse_python_file(FileId(1), &source).unwrap();
let semantics = PyFileSemantics::from_parsed(&parsed);
println!("Imports: {:?}", semantics.imports);
println!("Functions: {:?}", semantics.functions);
unfault-core/
├── src/
│ ├── lib.rs # Public API exports
│ ├── error.rs # Error types
│ ├── parse/ # Tree-sitter parsing
│ │ ├── ast.rs # AST types and FileId
│ │ ├── python.rs # Python parser
│ │ ├── go.rs # Go parser
│ │ └── ...
│ ├── semantics/ # Semantic analysis
│ │ ├── common/ # Language-agnostic types
│ │ ├── python/ # Python-specific semantics
│ │ ├── go/ # Go-specific semantics
│ │ └── ...
│ ├── graph/ # Code graph construction
│ │ └── mod.rs # CodeGraph, GraphNode, GraphEdgeKind
│ └── types/ # Common types
│ ├── context.rs # SourceFile, Language
│ ├── profile.rs # Analysis profiles
│ └── ...
MIT