Skip to content

Block or alt after groups separated by semicolons assumes parent's indentation as first group's #795

Description

@miffi

The snippet of shrubbery code below does not parse.

a; b
   | c

However, the snippet below does, and its parsed output is (multi (group a) (group b (alts (block (group c))))).

a; b
| c

This means that the parser is inferring the group b's indentation to be at the start of the line. This is different from other cases of syntax forms where multiple groups are separated horizontally, like in opener-closers, where b's alt branch would have to be aligned with its start to compile. Therefore, I think the parser should change to parse the first snippet instead of the second.

P.S. This also affects blocks. This compiles and gives (multi (group a) (group b (block (group c))))

a; b:
 c

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions