floats
Ondřej Hruška 4 years ago
parent 4be5b4e05b
commit 822e7912aa
Signed by untrusted user: MightyPork
GPG Key ID: 2C5FD5035250423D
  1. 4
      crsn/src/asm/parse/mod.rs
  2. 2
      crsn/src/asm/parse/parse_cond.rs
  3. 12
      crsn/src/asm/parse/parse_instr.rs
  4. 2
      crsn/src/module/mod.rs

@ -1,9 +1,9 @@
use std::sync::atomic::{AtomicU32, AtomicU64}; use std::sync::atomic::AtomicU32;
pub use parse_instr::parse_instructions; pub use parse_instr::parse_instructions;
use crate::asm::error::CrsnError; use crate::asm::error::CrsnError;
use crate::asm::instr::{Flatten, Op, Routine}; use crate::asm::instr::Op;
use crate::asm::parse::sexp_expect::expect_list; use crate::asm::parse::sexp_expect::expect_list;
use crate::module::CrsnExtension; use crate::module::CrsnExtension;

@ -1,7 +1,7 @@
use sexp::Sexp; use sexp::Sexp;
use crate::asm::error::CrsnError; use crate::asm::error::CrsnError;
use crate::asm::instr::{Cond, cond, Instr, Flatten}; use crate::asm::instr::{Cond, cond, Flatten};
use crate::asm::parse::parse_instr::parse_instructions; use crate::asm::parse::parse_instr::parse_instructions;
use crate::asm::parse::sexp_expect::{expect_list, expect_string_atom}; use crate::asm::parse::sexp_expect::{expect_list, expect_string_atom};
use crate::asm::patches::TryRemove; use crate::asm::patches::TryRemove;

@ -1,7 +1,8 @@
use sexp::Sexp; use sexp::Sexp;
use crate::asm::data::literal::RoutineName;
use crate::asm::error::CrsnError; use crate::asm::error::CrsnError;
use crate::asm::instr::{Instr, Flatten, Routine}; use crate::asm::instr::{Flatten, Instr, Routine};
use crate::asm::parse::arg_parser::TokenParser; use crate::asm::parse::arg_parser::TokenParser;
use crate::asm::parse::parse_cond::parse_cond_branch; use crate::asm::parse::parse_cond::parse_cond_branch;
use crate::asm::parse::sexp_expect::{expect_list, expect_string_atom}; use crate::asm::parse::sexp_expect::{expect_list, expect_string_atom};
@ -9,7 +10,6 @@ use crate::asm::patches::SexpIsA;
use crate::module::{CrsnExtension, ParseRes}; use crate::module::{CrsnExtension, ParseRes};
use super::parse_op::parse_op; use super::parse_op::parse_op;
use crate::asm::data::literal::RoutineName;
pub fn parse_instructions(items: impl Iterator<Item=Sexp>, parsers: &[Box<dyn CrsnExtension>]) -> Result<Box<dyn Flatten>, CrsnError> { pub fn parse_instructions(items: impl Iterator<Item=Sexp>, parsers: &[Box<dyn CrsnExtension>]) -> Result<Box<dyn Flatten>, CrsnError> {
let mut parsed = vec![]; let mut parsed = vec![];
@ -68,10 +68,10 @@ pub fn parse_instructions(items: impl Iterator<Item=Sexp>, parsers: &[Box<dyn Cr
Ok(Box::new(parsed)) Ok(Box::new(parsed))
} }
fn parse_routine(mut toki : impl Iterator<Item=Sexp> + Clone, parsers: &[Box<dyn CrsnExtension>]) -> Result<Box<dyn Flatten>, CrsnError> { fn parse_routine(mut toki: impl Iterator<Item=Sexp> + Clone, parsers: &[Box<dyn CrsnExtension>]) -> Result<Box<dyn Flatten>, CrsnError> {
let name = expect_string_atom(toki.next())?; let name = expect_string_atom(toki.next())?;
let arg_tokens = TokenParser::new(toki.clone().take_while(|e| e.is_atom()).collect()); let _arg_tokens = TokenParser::new(toki.clone().take_while(|e| e.is_atom()).collect());
// TODO parse arg tokens // TODO parse arg tokens
@ -79,6 +79,6 @@ fn parse_routine(mut toki : impl Iterator<Item=Sexp> + Clone, parsers: &[Box<dyn
return Ok(Box::new(Routine { return Ok(Box::new(Routine {
name: RoutineName(name), name: RoutineName(name),
body body,
})) }));
} }

@ -7,7 +7,7 @@ pub use eval_res::EvalRes;
use crate::asm::data::literal::Value; use crate::asm::data::literal::Value;
use crate::asm::data::Mask; use crate::asm::data::Mask;
use crate::asm::error::CrsnError; use crate::asm::error::CrsnError;
use crate::asm::instr::{Op, Flatten}; use crate::asm::instr::{Flatten, Op};
use crate::asm::parse::arg_parser::TokenParser; use crate::asm::parse::arg_parser::TokenParser;
use crate::runtime::fault::Fault; use crate::runtime::fault::Fault;
use crate::runtime::run_thread::state::RunState; use crate::runtime::run_thread::state::RunState;

Loading…
Cancel
Save