cleanup notes and sloppy formatting.

This commit is contained in:
Mark Thom
2018-01-27 00:14:10 -07:00
parent ab7ba0a207
commit 6894162c91

View File

@@ -372,8 +372,7 @@ impl<'a, TermMarker: Allocator<'a>> CodeGenerator<'a, TermMarker>
Ok(()) Ok(())
} }
fn call_arith_eval(&self, term: &'a Term, target_int: usize) fn call_arith_eval(&self, term: &'a Term, target_int: usize) -> Result<ArithCont, ArithmeticError>
-> Result<ArithCont, ArithmeticError>
{ {
let mut evaluator = ArithmeticEvaluator::new(self.marker.bindings(), target_int); let mut evaluator = ArithmeticEvaluator::new(self.marker.bindings(), target_int);
evaluator.eval(term) evaluator.eval(term)
@@ -383,7 +382,8 @@ impl<'a, TermMarker: Allocator<'a>> CodeGenerator<'a, TermMarker>
code: &mut Code, is_exposed: bool) code: &mut Code, is_exposed: bool)
-> Result<(), ParserError> -> Result<(), ParserError>
{ {
for (chunk_num, _, terms) in iter { for (chunk_num, _, terms) in iter
{
for (i, term) in terms.iter().enumerate() for (i, term) in terms.iter().enumerate()
{ {
let term_loc = if i + 1 < terms.len() { let term_loc = if i + 1 < terms.len() {
@@ -475,10 +475,6 @@ impl<'a, TermMarker: Allocator<'a>> CodeGenerator<'a, TermMarker>
if conjunct_info.allocates() { if conjunct_info.allocates() {
code.insert(dealloc_index, Line::Control(ControlInstruction::Deallocate)); code.insert(dealloc_index, Line::Control(ControlInstruction::Deallocate));
} }
// mark the first uninitialized jmp command (if there is one)
// by code.len() - index.
//TODO
} }
pub fn compile_rule<'b: 'a>(&mut self, rule: &'b Rule) -> Result<Code, ParserError> pub fn compile_rule<'b: 'a>(&mut self, rule: &'b Rule) -> Result<Code, ParserError>