Changeset - f2dca476327a
[Not reviewed]
0 2 0
Hans-Dieter Hiep - 5 years ago 2020-02-10 12:06:28
hdh@cwi.nl
Fixes fall-through component definition error
2 files changed with 11 insertions and 5 deletions:
0 comments (0 inline, 0 general)
src/protocol/eval.rs
Show inline comments
 
@@ -1517,8 +1517,10 @@ impl Prompt {
 
        }
 
    }
 
    pub fn step(&mut self, h: &Heap, ctx: &mut EvalContext) -> EvalResult {
 
        if let Some(stmt) = self.position {
 
            let stmt = &h[stmt];
 
        if self.position.is_none() {
 
            return Err(EvalContinuation::Terminal);
 
        }
 
        let stmt = &h[self.position.unwrap()];
 
        match stmt {
 
            Statement::Block(stmt) => {
 
                // Continue to first statement
 
@@ -1656,9 +1658,6 @@ impl Prompt {
 
                Err(EvalContinuation::Stepping)
 
            }
 
        }
 
        } else {
 
            Err(EvalContinuation::Terminal)
 
        }
 
    }
 
    fn compute_function(h: &Heap, fun: FunctionId, args: &Vec<Value>) -> Option<Value> {
 
        let mut prompt = Self::new(h, fun.upcast(), args);
src/protocol/parser.rs
Show inline comments
 
@@ -1081,6 +1081,13 @@ impl LinkStatements {
 
}
 

	
 
impl Visitor for LinkStatements {
 
    fn visit_symbol_definition(&mut self, h: &mut Heap, def: DefinitionId) -> VisitorResult {
 
        assert!(self.prev.is_none());
 
        recursive_symbol_definition(self, h, def)?;
 
        // Clear out last statement
 
        self.prev = None;
 
        Ok(())
 
    }
 
    fn visit_statement(&mut self, h: &mut Heap, stmt: StatementId) -> VisitorResult {
 
        if let Some(UniqueStatementId(prev)) = self.prev.take() {
 
            h[prev].link_next(stmt);
0 comments (0 inline, 0 general)