Make decodal the published library crate

This commit is contained in:
2026-06-25 22:51:16 +09:00
parent 6e2363632b
commit 87fef44c68
20 changed files with 159 additions and 96 deletions
+3 -3
View File
@@ -1,6 +1,6 @@
use std::collections::BTreeMap;
use decodal_core::{
use decodal::{
Data, Diagnostic, DiagnosticKind, EmptyLoader, Engine, LoadedSource, SourceId, SourceLoader,
Span, format_diagnostic_with,
};
@@ -81,7 +81,7 @@ impl SourceLoader for VirtualLoader {
&mut self,
current_key: Option<&str>,
specifier: &str,
) -> decodal_core::Result<LoadedSource> {
) -> decodal::Result<LoadedSource> {
let key = resolve_import(current_key, specifier).ok_or_else(|| {
Diagnostic::new(
DiagnosticKind::Import,
@@ -139,7 +139,7 @@ fn normalize_path(path: &str) -> Option<String> {
}
}
fn format_diagnostic_with_root(diagnostic: &decodal_core::Diagnostic, root_name: &str) -> String {
fn format_diagnostic_with_root(diagnostic: &decodal::Diagnostic, root_name: &str) -> String {
format_diagnostic_with(diagnostic, |source| {
(source == SourceId(0)).then_some(root_name)
})