Skip to content

Add explicit parallel tracking to PrintOrderer #33

@andrewjstone

Description

@andrewjstone

TLDR

By adding aPrintOrderEntry::ParallelEnd variant to be output from PrintOrderer::print_order, we can drastically simplify our property_indents_are_correct test method.

Details

The PrintOrderer code from #29 only writes when parallel entries start to the ordering output from PrintOrderer::print_order. The ending of parallelism is implicitly specified by the indent level decreasing in a subsequent PrintOrderEntry::Node. This doesn't make printing any harder, as there is no need to print when parallel nodes end. However, not having this information does make the property based testing code more complicated. Instead of ensuring that the indent level in the PrintOrderEntry matches the expected depth of the indent stack, we have to check if the indent level is exactly one less than the number of entries on the stack, which indicates that parallelism has ended. This occurs in multiple match clauses and makes the test harder to read.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions