Compare commits

..

No commits in common. "dc44244e7b88fa86ca471d2659c4e772d6c9a817" and "3eee768ce1cd92a4f02c9105faef718b47bc9ba9" have entirely different histories.

3 changed files with 2 additions and 18 deletions

View file

@ -1,8 +1,6 @@
use crate::lst_parser::syntax_kind::SyntaxKind::*; use crate::lst_parser::syntax_kind::SyntaxKind::*;
use crate::SyntaxNode; use crate::SyntaxNode;
use rowan::Language; use rowan::Language;
// Heavily modified version of https://github.com/rust-analyzer/rowan/blob/e2d2e93e16c5104b136d0bc738a0d48346922200/examples/s_expressions.rs#L250-L266
macro_rules! ast_nodes { macro_rules! ast_nodes {
($($ast:ident, $kind:ident);+) => { ($($ast:ident, $kind:ident);+) => {
$( $(

View file

@ -1,7 +1,5 @@
use std::path::Path; use std::path::Path;
use self::files::{Files, OpenFileError};
mod error; mod error;
mod files; mod files;
@ -9,19 +7,8 @@ struct World;
impl World { impl World {
pub fn new(entry_point: &Path) -> Result<Self, WorldCreationError> { pub fn new(entry_point: &Path) -> Result<Self, WorldCreationError> {
let mut files = Files::default();
let (entry_point_id, errors) = files.add_file(entry_point)?;
todo!() todo!()
} }
} }
enum WorldCreationError { enum WorldCreationError {}
FailedToOpenEntryPoint(OpenFileError),
}
impl From<OpenFileError> for WorldCreationError {
fn from(value: OpenFileError) -> Self {
Self::FailedToOpenEntryPoint(value)
}
}

View file

@ -15,8 +15,7 @@ use crate::{
world::{error::Error, files::source_file::SourceFile}, world::{error::Error, files::source_file::SourceFile},
}; };
#[derive(Default)] struct Files {
pub struct Files {
inner: Vec<source_file::SourceFile>, inner: Vec<source_file::SourceFile>,
path_to_id_map: HashMap<PathBuf, FileId>, path_to_id_map: HashMap<PathBuf, FileId>,
} }