1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
mod callback;
mod datasource;
mod executor;
mod state;
use std::collections::HashMap;
pub use self::callback::*;
pub use self::datasource::{LoopControl, RuntimeContext};
pub use self::executor::RuntimeExecutor;
pub use self::state::ExecutionState;
use crate::error::{Result, RuntimeError};
use crate::format::*;
/// Result of a single step of runtime execution
#[derive(Debug)]
pub enum StepResult {
/// Execution paused normally (e.g. awaiting user input)
Done,
/// The runtime needs a condition to be evaluated externally.
/// Call `resume_condition()` with the result, then call `step()` again.
NeedsCondition(String),
/// The runtime needs a script to be evaluated externally.
/// Call `resume_script()` with the result, then call `step()` again.
NeedsScript(String),
/// The runtime needs a story file to be loaded.
/// Call `provide_story_data()` with the file contents, then call `step()` again.
NeedsStoryFile(String),
}
/// Internal state tracking for step/resume execution
enum StepPhase {
/// Ready for normal execution
Ready,
/// Yielded for condition evaluation; child is saved for resumption
AwaitingCondition { child: Child },
/// Yielded for script evaluation
AwaitingScript,
/// Yielded for story file loading; paragraph target saved
AwaitingStoryFile {
story_name: String,
paragraph_name: String,
arguments: Vec<ResolvedArgument>,
},
}
impl Default for StepPhase {
fn default() -> Self {
StepPhase::Ready
}
}
/// Runtime manages the execution context and executor together
pub struct Runtime<E: RuntimeExecutor> {
context: RuntimeContext,
executor: E,
/// Internal phase for step/resume execution
phase: StepPhase,
/// Condition result provided by the caller after NeedsCondition
condition_result: Option<bool>,
/// Script result provided by the caller after NeedsScript
script_result: Option<(Option<RValue>, bool)>,
}
impl<E: RuntimeExecutor> Runtime<E> {
pub fn new(executor: E) -> Self {
Self {
context: RuntimeContext::new(),
executor,
phase: StepPhase::default(),
condition_result: None,
script_result: None,
}
}
pub fn new_with_context(executor: E, context: RuntimeContext) -> Self {
Self {
context,
executor,
phase: StepPhase::default(),
condition_result: None,
script_result: None,
}
}
pub fn context(&self) -> &RuntimeContext {
&self.context
}
pub fn context_mut(&mut self) -> &mut RuntimeContext {
&mut self.context
}
pub fn executor(&self) -> &E {
&self.executor
}
pub fn executor_mut(&mut self) -> &mut E {
&mut self.executor
}
pub fn add_story(&mut self, story: Story) {
self.context.stories_mut().push(story);
}
pub fn has_story(&self, name: &str) -> bool {
self.context.stories().iter().any(|s| s.name == name)
}
pub fn get_story(&self, name: &str) -> Result<&Story> {
self.context
.stories()
.iter()
.find(|s| s.name == name)
.ok_or(RuntimeError::StoryNotFound(name.to_string()))
}
pub fn get_paragraph(&self, story_name: &str, name: &str) -> Result<&Paragraph> {
let story = self.get_story(story_name)?;
story
.paragraphs
.iter()
.find(|s| s.name == name)
.ok_or(RuntimeError::ParagraphNotFound(name.to_string()))
}
pub fn list_stories(&self) -> Vec<String> {
self.context
.stories()
.iter()
.map(|s| s.name.clone())
.collect()
}
pub fn list_paragraphs(&self, story_name: &str) -> Result<Vec<String>> {
let story = self.get_story(story_name)?;
Ok(story.paragraphs.iter().map(|p| p.name.clone()).collect())
}
pub fn traverse_lines<F>(
&mut self,
story_name: &str,
paragraph_name: &str,
mut callback: F,
) -> Result<()>
where
F: FnMut(&ChildContent) -> Result<bool>,
{
let paragraph = self.get_paragraph(story_name, paragraph_name)?;
for child in paragraph.block.children() {
if child.content.is_comment() {
continue;
}
let is_continue = callback(&child.content)?;
if !is_continue {
break;
}
}
Ok(())
}
pub fn save(&self) -> Result<Vec<ExecutionState>> {
let stack = self.context.stack().clone();
Ok(stack)
}
pub fn restore(&mut self, states: Vec<ExecutionState>) -> Result<()> {
*self.context.stack_mut() = states;
Ok(())
}
pub fn start(&mut self, story_name: &str, entry_name: Option<&str>) -> Result<()> {
if self.context.stories().is_empty() {
return Err(RuntimeError::NoStory);
}
let is_empty = self.context.stack().is_empty();
if is_empty {
let entry_name = entry_name.unwrap_or("entry");
self.push_loaded_paragraph(story_name.to_string(), entry_name.to_string(), &[])?;
} else {
return Err(RuntimeError::StoryStarted);
}
Ok(())
}
pub fn terminate(&mut self) -> Result<()> {
if self.context.stack().is_empty() {
return Err(RuntimeError::StoryNotStarted);
}
self.context.stack_mut().clear();
self.context
.archive_variables_mut()
.as_object_mut()?
.clear();
self.executor.finished(&mut self.context);
Ok(())
}
pub fn get_current_state(&self) -> Result<&ExecutionState> {
self.context
.stack()
.last()
.ok_or(RuntimeError::StoryNotStarted)
}
pub fn get_current_state_mut(&mut self) -> Result<&mut ExecutionState> {
self.context
.stack_mut()
.last_mut()
.ok_or(RuntimeError::StoryNotStarted)
}
pub fn break_current_block(&mut self) -> Result<()> {
if let Some(state) = self.context.stack_mut().pop() {
// if the stack is empty, try to load the next paragraph of the current story
if self.context.stack().is_empty() {
if let Some(next_paragraph) = {
let story = self.get_story(&state.story)?;
let mut paragraph_iter = story.paragraphs.iter();
paragraph_iter.position(|s| s.name == state.paragraph);
paragraph_iter.next().cloned()
} {
self.push_loaded_paragraph(state.story.clone(), next_paragraph.name, &[])?;
} else {
self.executor.finished(&mut self.context);
}
}
Ok(())
} else {
// Use this error to tell the user that the story is finished, who should
// break the loop or stop the execution
Err(RuntimeError::StoryFinished)
}
}
/// Resolve all variables in the argument list to literal values
pub fn resolve_arguments(&mut self, args: Vec<Argument>) -> Result<Vec<ResolvedArgument>> {
let mut resolved_args = Vec::new();
for arg in args {
let resolved_value = self
.executor
.get_rvalue(&self.context, &arg.value)?
.to_owned();
resolved_args.push(ResolvedArgument {
name: arg.name.clone(),
value: resolved_value,
});
}
Ok(resolved_args)
}
fn push_loaded_paragraph(
&mut self,
story_name: String,
paragraph_name: String,
arguments: &[ResolvedArgument],
) -> Result<()> {
// exclude "story" and "paragraph" arguments, which are reserved
let provided_args: Vec<ResolvedArgument> = arguments
.iter()
.filter(|arg| arg.name != "story" && arg.name != "paragraph")
.cloned()
.collect();
let paragraph = self.get_paragraph(&story_name, ¶graph_name)?;
let block = paragraph.block.clone();
// build locals
let mut remaining = provided_args
.into_iter()
.map(|arg| (arg.name, arg.value))
.collect::<HashMap<String, Literal>>();
let mut locals = HashMap::new();
for parameter in ¶graph.parameters {
if let Some(value) = remaining.remove(¶meter.name) {
locals.insert(parameter.name.clone(), value);
continue;
}
if let Some(default_value) = ¶meter.default_value {
locals.insert(parameter.name.clone(), default_value.clone());
continue;
}
return Err(RuntimeError::MissingParagraphArgument {
story: story_name.to_string(),
paragraph: paragraph.name.clone(),
argument: parameter.name.clone(),
});
}
// there may be extra arguments that are not defined in the paragraph parameters,
// log a warning and ignore them
if !remaining.is_empty() {
let mut ignored = remaining.into_keys().collect::<Vec<_>>();
ignored.sort();
log::warn!(
"Ignoring unexpected paragraph arguments when entering {}::{}: {}",
story_name,
paragraph.name,
ignored.join(", ")
);
}
self.context.stack_mut().push(ExecutionState::new_paragraph(
story_name,
paragraph_name,
block,
locals,
));
Ok(())
}
fn push_or_await_paragraph(
&mut self,
story_name: String,
paragraph_name: String,
arguments: &[ResolvedArgument],
) -> Result<bool> {
if self.has_story(&story_name) {
self.push_loaded_paragraph(story_name, paragraph_name, arguments)?;
Ok(true)
} else {
self.phase = StepPhase::AwaitingStoryFile {
story_name,
paragraph_name,
arguments: arguments.to_vec(),
};
Ok(false)
}
}
/// Execute steps synchronously until paused or an external async operation is needed.
///
/// Returns `StepResult::Done` when execution pauses (e.g. awaiting user input).
/// Returns `StepResult::NeedsCondition`, `NeedsScript`, or `NeedsStoryFile` when
/// an external async operation is required. The caller should perform the operation,
/// call the corresponding resume method, then call `step()` again.
pub fn step(&mut self) -> Result<StepResult> {
loop {
if let Some(result) = self.step_one()? {
return Ok(result);
}
}
}
/// Process one iteration of the execution loop.
/// Returns `None` if the loop should continue, or `Some(StepResult)` to yield.
fn step_one(&mut self) -> Result<Option<StepResult>> {
// Handle resume from pending phase
match std::mem::replace(&mut self.phase, StepPhase::Ready) {
StepPhase::Ready => {} // normal path
StepPhase::AwaitingCondition { child } => {
// Resuming after condition evaluation
return self.process_child(child);
}
StepPhase::AwaitingScript => {
// Resuming after script evaluation
let (_, is_continue) = self
.script_result
.take()
.expect("resumed from AwaitingScript without script result");
return Ok(if is_continue {
None
} else {
Some(StepResult::Done)
});
}
StepPhase::AwaitingStoryFile {
story_name,
paragraph_name,
arguments,
} => {
self.push_loaded_paragraph(story_name, paragraph_name, &arguments)?;
return Ok(None); // continue execution
}
}
// Check loop control signal from #break / #continue
if let Some(control) = self.context.take_loop_control() {
// Pop states until we find the loop body state
let found = self.pop_to_loop_body();
if found {
match control {
LoopControl::Break => {
// Advance parent index past the loop child (undo the decrement)
if let Ok(parent_state) = self.get_current_state_mut() {
parent_state.index += 1;
}
}
LoopControl::Continue => {
// Parent index is already at the loop child (decremented),
// so the next iteration will re-evaluate the condition
}
}
} else {
log::warn!("Loop control signal received but no loop body found in stack");
}
return Ok(None); // continue
}
let current_state = self.get_current_state_mut()?;
if let Some(child) = current_state.next_line() {
self.process_child(child)
} else {
self.break_current_block()?;
Ok(None) // continue
}
}
/// Process a single child (attributes + content).
/// Called both for fresh children and when resuming after condition evaluation.
fn process_child(&mut self, child: Child) -> Result<Option<StepResult>> {
if child.content.is_comment() {
return Ok(None);
}
let mut is_loop = false;
let marker = child.marker.clone();
// Tracks whether the marker has already been emitted (e.g. before yielding NeedsCondition),
// to prevent double-emission at the end of this method.
let mut marker_emitted = false;
// Extract attribute info before potentially moving child
let (keyword, condition) = if !child.attributes.is_empty() {
if child.attributes.len() > 1 {
log::warn!("Multiple attributes on same child, only last one is used");
}
let attr = child.attributes.last().unwrap();
(attr.keyword.clone(), attr.condition.clone())
} else {
(String::new(), None)
};
// Process attributes
if !keyword.is_empty() {
match keyword.as_str() {
"cond" | "if" => {
if let Some(ref cond_str) = condition {
let result = match self.condition_result.take() {
Some(r) => r,
None => {
// Emit marker before yielding so callers see it immediately
if let Some(marker) = marker.as_ref() {
self.executor.handle_marker(&mut self.context, marker)?;
}
let cond_str = cond_str.clone();
self.phase = StepPhase::AwaitingCondition { child };
return Ok(Some(StepResult::NeedsCondition(cond_str)));
}
};
// Marker was already emitted before the condition yield
marker_emitted = true;
if !result {
return Ok(None); // condition not met, skip this child
}
}
}
"while" => {
if let Some(ref cond_str) = condition {
let result = match self.condition_result.take() {
Some(r) => r,
None => {
// Emit marker before yielding so callers see it immediately
if let Some(marker) = marker.as_ref() {
self.executor.handle_marker(&mut self.context, marker)?;
}
let cond_str = cond_str.clone();
self.phase = StepPhase::AwaitingCondition { child };
return Ok(Some(StepResult::NeedsCondition(cond_str)));
}
};
// Marker was already emitted before the condition yield
marker_emitted = true;
if !result {
return Ok(None); // condition not met, skip this child
}
self.get_current_state_mut()?.index -= 1;
is_loop = true;
}
}
"loop" => {
self.get_current_state_mut()?.index -= 1;
is_loop = true;
}
_ => {
log::warn!("Unknown attribute keyword: {}", keyword);
}
}
}
// Process content
let is_continue = match child.content {
ChildContent::Block(block) => {
let current_state = self.get_current_state()?.clone();
if is_loop {
self.context.stack_mut().push(ExecutionState::new_loop_body(
current_state.story,
current_state.paragraph,
block.clone(),
));
} else {
self.context.stack_mut().push(ExecutionState::new(
current_state.story,
current_state.paragraph,
block.clone(),
));
}
true
}
ChildContent::TextLine(leading, text, tailing) => {
let leading = match leading {
LeadingText::None => None,
LeadingText::Text(t) => Some(t),
LeadingText::TemplateLiteral(template_literal) => {
let text = self
.executor
.calculate_template_literal(&self.context, &template_literal)?;
Some(text)
}
};
let text = match text {
Text::None => None,
Text::Text(t) => Some(t),
Text::TemplateLiteral(template_literal) => {
let text = self
.executor
.calculate_template_literal(&self.context, &template_literal)?;
Some(text)
}
};
let tailing = match tailing {
TailingText::None => None,
TailingText::Text(t) => Some(t),
};
self.executor.handle_text(
&mut self.context,
leading.as_deref(),
text.as_deref(),
tailing.as_deref(),
)?
}
ChildContent::CommandLine(command) => {
let command = ResolvedCommandLine {
command: command.command,
arguments: self.resolve_arguments(command.arguments)?,
};
self.executor.handle_command(&mut self.context, &command)?
}
ChildContent::SystemCallLine(systemcall) => {
let systemcall = ResolvedSystemCallLine {
command: systemcall.command,
arguments: self.resolve_arguments(systemcall.arguments)?,
};
match self.handle_system_call(&systemcall)? {
Some(v) => v,
None => {
// Phase was set to AwaitingStoryFile by handle_system_call
let story_name = match &self.phase {
StepPhase::AwaitingStoryFile { story_name, .. } => story_name.clone(),
_ => unreachable!(),
};
return Ok(Some(StepResult::NeedsStoryFile(story_name)));
}
}
}
ChildContent::EmbeddedCode(script) => {
if let Some((_, is_continue)) = self.script_result.take() {
is_continue
} else {
self.phase = StepPhase::AwaitingScript;
return Ok(Some(StepResult::NeedsScript(script)));
}
}
ChildContent::Comment(_) => true,
};
if !marker_emitted {
if let Some(marker) = marker.as_ref() {
self.executor.handle_marker(&mut self.context, marker)?;
}
}
Ok(if is_continue {
None
} else {
Some(StepResult::Done)
})
}
/// Provide the result of a condition evaluation after `step()` returned `NeedsCondition`.
/// Call `step()` again after this to continue execution.
pub fn resume_condition(&mut self, result: bool) {
self.condition_result = Some(result);
}
/// Provide the result of a script evaluation after `step()` returned `NeedsScript`.
/// `result` is the evaluated value (or None), `is_continue` indicates whether
/// execution should continue immediately after this script.
/// Call `step()` again after this to continue execution.
pub fn resume_script(&mut self, result: Option<RValue>, is_continue: bool) {
self.script_result = Some((result, is_continue));
}
/// Provide story file data after `step()` returned `NeedsStoryFile`.
/// The data will be parsed and added to the story list.
/// Call `step()` again after this to continue execution.
pub fn provide_story_data(&mut self, story_name: &str, data: Vec<u8>) -> Result<()> {
let text = String::from_utf8(data)
.map_err(|e| anyhow::anyhow!("Failed to parse story file: {}", e))?;
let (_, story) = crate::parser::parse(story_name, &text).map_err(|e| {
anyhow::anyhow!(
"Failed to parse story file '{}': {}",
story_name,
e.to_string()
)
})?;
self.context.stories_mut().push(story);
Ok(())
}
/// Pop states from the stack until a loop body state is found and popped.
/// Returns true if a loop body was found, false otherwise.
fn pop_to_loop_body(&mut self) -> bool {
while let Some(state) = self.context.stack_mut().pop() {
if state.is_loop_body {
return true;
}
}
false
}
/// Handle system call line synchronously.
/// Returns `Ok(Some(is_continue))` for normal completion, or `Ok(None)` when
/// a story file needs to be loaded (phase set to `AwaitingStoryFile`).
fn handle_system_call(
&mut self,
systemcall_line: &ResolvedSystemCallLine,
) -> Result<Option<bool>> {
match systemcall_line.command.as_str() {
"goto" => {
let story_name = match systemcall_line.get_argument("story") {
Some(v) => {
if v.is_string() {
v.to_string()
} else {
return Err(RuntimeError::WrongArgumentSystemCallLine(
"Expected a string argument".to_string(),
));
}
}
None => self.get_current_state().unwrap().story.clone(),
};
if let Some(paragraph_name) = systemcall_line.get_argument("paragraph") {
let paragraph_name = if paragraph_name.is_string() {
paragraph_name.to_string()
} else {
return Err(RuntimeError::WrongArgumentSystemCallLine(
"Expected a string argument".to_string(),
));
};
self.context.stack_mut().clear();
if !self.push_or_await_paragraph(
story_name,
paragraph_name,
&systemcall_line.arguments,
)? {
return Ok(None);
}
} else {
return Err(RuntimeError::WrongArgumentSystemCallLine(
"Paragraph name not provided".to_string(),
));
}
Ok(Some(true))
}
"replace" => {
let story_name = match systemcall_line.get_argument("story") {
Some(v) => {
if v.is_string() {
v.to_string()
} else {
return Err(RuntimeError::WrongArgumentSystemCallLine(
"Expected a string argument".to_string(),
));
}
}
None => self.get_current_state().unwrap().story.clone(),
};
if let Some(paragraph_name) = systemcall_line.get_argument("paragraph") {
let paragraph_name = if paragraph_name.is_string() {
paragraph_name.to_string()
} else {
return Err(RuntimeError::WrongArgumentSystemCallLine(
"Expected a string argument".to_string(),
));
};
let current_paragraph = self
.context
.stack_mut()
.pop()
.expect("No paragraph in stack to replace, this should not happen.");
loop {
if self.context.stack().is_empty() {
break;
}
// pop the stack until the last state is not the same on story and paragraph
// to remove all sub-blocks on the same paragraph
let last_state = self.context.stack().last().unwrap();
if last_state.story == current_paragraph.story
&& last_state.paragraph == current_paragraph.paragraph
{
self.context.stack_mut().pop();
} else {
break;
}
}
if !self.push_or_await_paragraph(
story_name,
paragraph_name,
&systemcall_line.arguments,
)? {
return Ok(None);
}
} else {
return Err(RuntimeError::WrongArgumentSystemCallLine(
"Paragraph name not provided".to_string(),
));
}
Ok(Some(true))
}
"call" => {
let story_name = match systemcall_line.get_argument("story") {
Some(v) => {
if v.is_string() {
v.to_string()
} else {
return Err(RuntimeError::WrongArgumentSystemCallLine(
"Expected a string argument".to_string(),
));
}
}
None => self.get_current_state().unwrap().story.clone(),
};
if let Some(paragraph_name) = systemcall_line.get_argument("paragraph") {
let paragraph_name = if paragraph_name.is_string() {
paragraph_name.to_string()
} else {
return Err(RuntimeError::WrongArgumentSystemCallLine(
"Expected a string argument".to_string(),
));
};
if !self.push_or_await_paragraph(
story_name,
paragraph_name,
&systemcall_line.arguments,
)? {
return Ok(None);
}
} else {
return Err(RuntimeError::WrongArgumentSystemCallLine(
"Paragraph name not provided".to_string(),
));
}
Ok(Some(true))
}
"leave" => {
self.break_current_block()?;
Ok(Some(true))
}
"break" => {
self.context.set_loop_control(LoopControl::Break);
Ok(Some(true))
}
"continue" => {
self.context.set_loop_control(LoopControl::Continue);
Ok(Some(true))
}
"finish" => {
self.context.stack_mut().clear();
self.executor.finished(&mut self.context);
Ok(Some(false))
}
_ => self
.executor
.handle_extra_system_call(&mut self.context, systemcall_line)
.map(Some),
}
}
}