diff --git a/src/protocol/ast_printer.rs b/src/protocol/ast_printer.rs index 4e566cdc23d634459b11530513dee8b50d57f704..6aff2810101c2a5143012ad83ec80eaa21cd852d 100644 --- a/src/protocol/ast_printer.rs +++ b/src/protocol/ast_printer.rs @@ -36,6 +36,8 @@ const PREFIX_BREAK_STMT_ID: &'static str = "SBre"; const PREFIX_CONTINUE_STMT_ID: &'static str = "SCon"; const PREFIX_SYNC_STMT_ID: &'static str = "SSyn"; const PREFIX_ENDSYNC_STMT_ID: &'static str = "SESy"; +const PREFIX_FORK_STMT_ID: &'static str = "SFrk"; +const PREFIX_END_FORK_STMT_ID: &'static str = "SEFk"; const PREFIX_RETURN_STMT_ID: &'static str = "SRet"; const PREFIX_ASSERT_STMT_ID: &'static str = "SAsr"; const PREFIX_GOTO_STMT_ID: &'static str = "SGot"; @@ -511,6 +513,24 @@ impl ASTWriter { self.kv(indent2).with_s_key("StartSync").with_disp_val(&stmt.start_sync.0.index); self.kv(indent2).with_s_key("Next").with_disp_val(&stmt.next.index); }, + Statement::Fork(stmt) => { + self.kv(indent).with_id(PREFIX_FORK_STMT_ID, stmt.this.0.index) + .with_s_key("Fork"); + self.kv(indent2).with_s_key("EndFork").with_disp_val(&stmt.end_fork.0.index); + self.kv(indent2).with_s_key("LeftBody"); + self.write_stmt(heap, stmt.left_body.upcast(), indent3); + + if let Some(right_body_id) = stmt.right_body { + self.kv(indent2).with_s_key("RightBody"); + self.write_stmt(heap, right_body_id.upcast(), indent3); + } + }, + Statement::EndFork(stmt) => { + self.kv(indent).with_id(PREFIX_END_FORK_STMT_ID, stmt.this.0.index) + .with_s_key("EndFork"); + self.kv(indent2).with_s_key("StartFork").with_disp_val(&stmt.start_fork.0.index); + self.kv(indent2).with_s_key("Next").with_disp_val(&stmt.next.index); + } Statement::Return(stmt) => { self.kv(indent).with_id(PREFIX_RETURN_STMT_ID, stmt.this.0.index) .with_s_key("Return");