---
source: brush-parser/src/parser/mod.rs
expression: "ParseResult { input, result: &result }"
---
ParseResult(
  input: "\\\ncase x in\nx)\n    echo y\nesac\\\n",
  result: Program(
    complete_commands: [
      CompoundList([
        CompoundListItem(AndOrList(
          first: Pipeline(
            seq: [
              Compound(CaseClause(CaseClauseCommand(
                value: Word(
                  value: "x",
                  loc: Some(SourceSpan(
                    start: SourcePosition(
                      index: 7,
                      line: 2,
                      column: 6,
                    ),
                    end: SourcePosition(
                      index: 8,
                      line: 2,
                      column: 7,
                    ),
                  )),
                ),
                cases: [
                  CaseItem(
                    patterns: [
                      Word(
                        value: "x",
                        loc: Some(SourceSpan(
                          start: SourcePosition(
                            index: 12,
                            line: 3,
                            column: 1,
                          ),
                          end: SourcePosition(
                            index: 13,
                            line: 3,
                            column: 2,
                          ),
                        )),
                      ),
                    ],
                    cmd: Some(CompoundList([
                      CompoundListItem(AndOrList(
                        first: Pipeline(
                          seq: [
                            Simple(SimpleCommand(
                              word_or_name: Some(Word(
                                value: "echo",
                                loc: Some(SourceSpan(
                                  start: SourcePosition(
                                    index: 19,
                                    line: 4,
                                    column: 5,
                                  ),
                                  end: SourcePosition(
                                    index: 23,
                                    line: 4,
                                    column: 9,
                                  ),
                                )),
                              )),
                              suffix: Some(CommandSuffix([
                                Word(Word(
                                  value: "y",
                                  loc: Some(SourceSpan(
                                    start: SourcePosition(
                                      index: 24,
                                      line: 4,
                                      column: 10,
                                    ),
                                    end: SourcePosition(
                                      index: 25,
                                      line: 4,
                                      column: 11,
                                    ),
                                  )),
                                )),
                              ])),
                            )),
                          ],
                        ),
                      ), Sequence),
                    ])),
                    post_action: ExitCase,
                    loc: Some(SourceSpan(
                      start: SourcePosition(
                        index: 12,
                        line: 3,
                        column: 1,
                      ),
                      end: SourcePosition(
                        index: 25,
                        line: 4,
                        column: 11,
                      ),
                    )),
                  ),
                ],
                loc: SourceSpan(
                  start: SourcePosition(
                    index: 0,
                    line: 1,
                    column: 1,
                  ),
                  end: SourcePosition(
                    index: 32,
                    line: 6,
                    column: 1,
                  ),
                ),
              )), None),
            ],
          ),
        ), Sequence),
      ]),
    ],
  ),
)
