Skip to content

Commit ef95bbe

Browse files
committed
Fix recognition of simple Techniques with only top-level steps
1 parent f4cb1fa commit ef95bbe

File tree

2 files changed

+24
-2
lines changed

2 files changed

+24
-2
lines changed

examples/minimal/SimpleList.tq

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
1. Open door
2+
2. Through door
3+
3. Close door, accepting that it will make a smug and self-satisified
4+
sigh with the knowledge of a job well done.

src/parsing/parser.rs

Lines changed: 20 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -252,8 +252,8 @@ impl<'i> Parser<'i> {
252252
}
253253

254254
// Check if this Technique is a single set of one or more
255-
// top-level Scope::SectionChunk
256-
if is_section(self.source) && procedures.is_empty() {
255+
// top-level Scopes (steps or sections)
256+
if (is_section(self.source) || is_step(self.source)) && procedures.is_empty() {
257257
while !self.is_finished() {
258258
self.trim_whitespace();
259259
if self.is_finished() {
@@ -269,6 +269,24 @@ impl<'i> Parser<'i> {
269269
self.skip_to_next_line();
270270
}
271271
}
272+
} else if is_step_dependent(self.source) {
273+
match self.read_step_dependent() {
274+
Ok(step) => sections.push(step),
275+
Err(error) => {
276+
self.problems
277+
.push(error);
278+
self.skip_to_next_line();
279+
}
280+
}
281+
} else if is_step_parallel(self.source) {
282+
match self.read_step_parallel() {
283+
Ok(step) => sections.push(step),
284+
Err(error) => {
285+
self.problems
286+
.push(error);
287+
self.skip_to_next_line();
288+
}
289+
}
272290
} else {
273291
self.problems
274292
.push(ParsingError::Unrecognized(self.offset, 0));

0 commit comments

Comments
 (0)