mirror of
https://github.com/Dummi26/mers.git
synced 2025-12-16 03:57:50 +01:00
mers rewrite is starting to be usable
This commit is contained in:
@@ -0,0 +1 @@
|
||||
|
||||
|
||||
@@ -1,9 +1,6 @@
|
||||
use std::sync::Arc;
|
||||
|
||||
use crate::{
|
||||
info::Info,
|
||||
program::{self, parsed::CompInfo},
|
||||
};
|
||||
use crate::program;
|
||||
|
||||
pub mod errors;
|
||||
pub mod statements;
|
||||
@@ -96,7 +93,7 @@ impl Source {
|
||||
/// Useful for debugging the parser.
|
||||
pub fn section_begin(&mut self, section: String) -> Arc<String> {
|
||||
#[cfg(debug_assertions)]
|
||||
println!("Section begin: {}", §ion);
|
||||
println!("[mers:parse] Section begin: {}", §ion);
|
||||
let arc = Arc::new(section);
|
||||
self.sections.push(SectionMarker {
|
||||
section: Arc::clone(&arc),
|
||||
@@ -141,7 +138,7 @@ impl SectionMarker {
|
||||
if Arc::strong_count(&self.section) == 1 {
|
||||
self.end = Some(end);
|
||||
#[cfg(debug_assertions)]
|
||||
println!("Section end : {}", &self.section);
|
||||
println!("[mers:parse] Section end : {}", &self.section);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2,7 +2,7 @@ use std::sync::Arc;
|
||||
|
||||
use super::Source;
|
||||
use crate::{
|
||||
data::{self, Data},
|
||||
data::Data,
|
||||
program::{self, parsed::MersStatement},
|
||||
};
|
||||
|
||||
@@ -142,12 +142,6 @@ pub fn parse_no_chain(
|
||||
},
|
||||
})
|
||||
}
|
||||
"loop" => {
|
||||
src.section_begin("loop".to_string());
|
||||
Box::new(program::parsed::r#loop::Loop {
|
||||
inner: parse(src)?.expect("err: EOF instead of inner statement after loop"),
|
||||
})
|
||||
}
|
||||
"switch" => {
|
||||
src.section_begin("loop".to_string());
|
||||
todo!()
|
||||
|
||||
Reference in New Issue
Block a user