Emit IL alongside raw IC10 for use in future optimization passes
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
use super::sys_call::SysCall;
|
||||
use crate::sys_call;
|
||||
use helpers::Span;
|
||||
use safer_ffi::prelude::*;
|
||||
use std::{borrow::Cow, ops::Deref};
|
||||
use tokenizer::token::Number;
|
||||
@@ -301,44 +302,6 @@ impl<'a> std::fmt::Display for WhileExpression<'a> {
|
||||
}
|
||||
}
|
||||
|
||||
#[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,
|
||||
},
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#[derive(Debug, Clone, PartialEq, Eq)]
|
||||
pub struct Spanned<T> {
|
||||
pub span: Span,
|
||||
|
||||
Reference in New Issue
Block a user