Emit IL alongside raw IC10 for use in future optimization passes

This commit is contained in:
2025-12-12 15:51:36 -07:00
parent 1230f83951
commit 3fb04aef3b
23 changed files with 990 additions and 523 deletions

View File

@@ -5,3 +5,4 @@ edition = "2024"
[dependencies]
crc32fast = { workspace = true }
lsp-types = { workspace = true }

View File

@@ -2,6 +2,44 @@ mod helper_funcs;
mod macros;
mod syscall;
#[derive(Debug, Clone, Copy, PartialEq, Eq)]
pub struct Span {
pub start_line: usize,
pub end_line: usize,
pub start_col: usize,
pub end_col: usize,
}
impl From<Span> for lsp_types::Range {
fn from(value: Span) -> Self {
Self {
start: lsp_types::Position {
line: value.start_line as u32,
character: value.start_col as u32,
},
end: lsp_types::Position {
line: value.end_line as u32,
character: value.end_col as u32,
},
}
}
}
impl From<&Span> for lsp_types::Range {
fn from(value: &Span) -> Self {
Self {
start: lsp_types::Position {
line: value.start_line as u32,
character: value.start_col as u32,
},
end: lsp_types::Position {
line: value.end_line as u32,
character: value.end_col as u32,
},
}
}
}
/// This trait will allow the LSP to emit documentation for various tokens and expressions.
/// You can easily create documentation for large enums with the `documented!` macro.
pub trait Documentation {