---
source: brush-parser/src/parser/tests/functions.rs
expression: "ParseResult { input, result: &result }"
---
ParseResult(
  input: "foo() { echo 1; } |& cat",
  result: Program(
    complete_commands: [
      CompoundList([
        CompoundListItem(AndOrList(
          first: Pipeline(
            seq: [
              Function(FunctionDefinition(
                fname: Word(
                  value: "foo",
                  loc: "[location]",
                ),
                body: FunctionBody(BraceGroup(BraceGroupCommand(
                  list: CompoundList([
                    CompoundListItem(AndOrList(
                      first: Pipeline(
                        seq: [
                          Simple(SimpleCommand(
                            word_or_name: Some(Word(
                              value: "echo",
                              loc: "[location]",
                            )),
                            suffix: Some(CommandSuffix([
                              Word(Word(
                                value: "1",
                                loc: "[location]",
                              )),
                            ])),
                          )),
                        ],
                      ),
                    ), Sequence),
                  ]),
                  loc: "[location]",
                )), Some(RedirectList([
                  File(Some(2), DuplicateOutput, Fd(1)),
                ]))),
              )),
              Simple(SimpleCommand(
                word_or_name: Some(Word(
                  value: "cat",
                  loc: "[location]",
                )),
              )),
            ],
          ),
        ), Sequence),
      ]),
    ],
  ),
)
