From 5f5cf9dc7ff11b90a622bea1c24e352a8f755aeb Mon Sep 17 00:00:00 2001 From: Andrew Walbran Date: Mon, 3 Apr 2023 14:43:44 +0100 Subject: [PATCH] Add a comment explaining the state machine. --- exerciser/src/main.rs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/exerciser/src/main.rs b/exerciser/src/main.rs index 2f1cfb68..3d7fc978 100644 --- a/exerciser/src/main.rs +++ b/exerciser/src/main.rs @@ -56,6 +56,10 @@ fn main() -> anyhow::Result<()> { .with_context(|| format!("Failed to open {:?}", input_filename))?; let parser = Parser::new(&input_contents); + // Find a specially-formatted comment followed by a code block, and then call `write_output` + // with the contents of the code block, to write to a file named by the comment. Code blocks + // without matching comments will be ignored, as will comments which are not followed by a code + // block. let mut next_filename: Option = None; let mut current_file: Option = None; for event in parser {