@known-diff heredoc-content-chunks: corpus commands.txt::Heredoc redirects
node <<JS
console.log("hi")
JS

bash -c <<JS
echo hi
JS

newins <<-EOF - org.freedesktop.Notifications.service
	[D-BUS Service]
	Name=org.freedesktop.Notifications
	Exec=/usr/libexec/notification-daemon
EOF
---
hasError: false
program [0,206] "node <<JS\nconsole.log(\"hi\")\nJS\n\nbash ..."
  redirected_statement [0,30] "node <<JS\nconsole.log(\"hi\")\nJS"
    command [0,4] "node"
      command_name [0,4] "node"
        word [0,4] "node"
    heredoc_redirect [5,30] "<<JS\nconsole.log(\"hi\")\nJS"
      (<<) [5,7] "<<"
      heredoc_start [7,9] "JS"
      heredoc_body [10,28] "console.log(\"hi\")\n"
        heredoc_content [10,28] "console.log(\"hi\")\n"
      heredoc_end [28,30] "JS"
  redirected_statement [32,55] "bash -c <<JS\necho hi\nJS"
    command [32,39] "bash -c"
      command_name [32,36] "bash"
        word [32,36] "bash"
      word [37,39] "-c"
    heredoc_redirect [40,55] "<<JS\necho hi\nJS"
      (<<) [40,42] "<<"
      heredoc_start [42,44] "JS"
      heredoc_body [45,53] "echo hi\n"
        heredoc_content [45,53] "echo hi\n"
      heredoc_end [53,55] "JS"
  redirected_statement [57,206] "newins <<-EOF - org.freedesktop.Notif..."
    command [57,63] "newins"
      command_name [57,63] "newins"
        word [57,63] "newins"
    heredoc_redirect [64,206] "<<-EOF - org.freedesktop.Notification..."
      (<<-) [64,67] "<<-"
      heredoc_start [67,70] "EOF"
      word [71,72] "-"
      word [73,110] "org.freedesktop.Notifications.service"
      heredoc_body [112,203] "[D-BUS Service]\n\tName=org.freedesktop..."
        heredoc_content [112,203] "[D-BUS Service]\n\tName=org.freedesktop..."
      heredoc_end [203,206] "EOF"
===
===
@known-diff heredoc-content-chunks: corpus commands.txt::Heredocs with variables
node <<JS
a $B ${C}
JS

exit
---
hasError: false
program [0,28] "node <<JS\na $B ${C}\nJS\n\nexit"
  redirected_statement [0,22] "node <<JS\na $B ${C}\nJS"
    command [0,4] "node"
      command_name [0,4] "node"
        word [0,4] "node"
    heredoc_redirect [5,22] "<<JS\na $B ${C}\nJS"
      (<<) [5,7] "<<"
      heredoc_start [7,9] "JS"
      heredoc_body [10,20] "a $B ${C}\n"
        heredoc_content [10,12] "a "
        simple_expansion [12,14] "$B"
          ($) [12,13] "$"
          variable_name [13,14] "B"
        heredoc_content [14,15] " "
        expansion [15,19] "${C}"
          (${) [15,17] "${"
          variable_name [17,18] "C"
          (}) [18,19] "}"
        heredoc_content [19,20] "\n"
      heredoc_end [20,22] "JS"
  command [24,28] "exit"
    command_name [24,28] "exit"
      word [24,28] "exit"
===
===
@known-diff heredoc-content-chunks: corpus commands.txt::Heredocs with file redirects
cat <<EOF > $tmpfile
a $B ${C}
EOF

wc -l $tmpfile
---
hasError: false
program [0,50] "cat <<EOF > $tmpfile\na $B ${C}\nEOF\n\nw..."
  redirected_statement [0,34] "cat <<EOF > $tmpfile\na $B ${C}\nEOF"
    command [0,3] "cat"
      command_name [0,3] "cat"
        word [0,3] "cat"
    heredoc_redirect [4,34] "<<EOF > $tmpfile\na $B ${C}\nEOF"
      (<<) [4,6] "<<"
      heredoc_start [6,9] "EOF"
      file_redirect [10,20] "> $tmpfile"
        (>) [10,11] ">"
        simple_expansion [12,20] "$tmpfile"
          ($) [12,13] "$"
          variable_name [13,20] "tmpfile"
      heredoc_body [21,31] "a $B ${C}\n"
        heredoc_content [21,23] "a "
        simple_expansion [23,25] "$B"
          ($) [23,24] "$"
          variable_name [24,25] "B"
        heredoc_content [25,26] " "
        expansion [26,30] "${C}"
          (${) [26,28] "${"
          variable_name [28,29] "C"
          (}) [29,30] "}"
        heredoc_content [30,31] "\n"
      heredoc_end [31,34] "EOF"
  command [36,50] "wc -l $tmpfile"
    command_name [36,38] "wc"
      word [36,38] "wc"
    word [39,41] "-l"
    simple_expansion [42,50] "$tmpfile"
      ($) [42,43] "$"
      variable_name [43,50] "tmpfile"
===
===
@known-diff heredoc-content-chunks: corpus commands.txt::Heredocs with many file redirects
FOO=bar echo <<EOF 2> err.txt > hello.txt
hello
EOF
---
hasError: false
program [0,51] "FOO=bar echo <<EOF 2> err.txt > hello..."
  redirected_statement [0,51] "FOO=bar echo <<EOF 2> err.txt > hello..."
    command [0,12] "FOO=bar echo"
      variable_assignment [0,7] "FOO=bar"
        variable_name [0,3] "FOO"
        (=) [3,4] "="
        word [4,7] "bar"
      command_name [8,12] "echo"
        word [8,12] "echo"
    heredoc_redirect [13,51] "<<EOF 2> err.txt > hello.txt\nhello\nEOF"
      (<<) [13,15] "<<"
      heredoc_start [15,18] "EOF"
      file_redirect [19,29] "2> err.txt"
        file_descriptor [19,20] "2"
        (>) [20,21] ">"
        word [22,29] "err.txt"
      file_redirect [30,41] "> hello.txt"
        (>) [30,31] ">"
        word [32,41] "hello.txt"
      heredoc_body [42,48] "hello\n"
        heredoc_content [42,48] "hello\n"
      heredoc_end [48,51] "EOF"
===
===
@known-diff heredoc-content-chunks: corpus commands.txt::Heredocs with pipes
one <<EOF | grep two
three
EOF
---
hasError: false
program [0,30] "one <<EOF | grep two\nthree\nEOF"
  redirected_statement [0,30] "one <<EOF | grep two\nthree\nEOF"
    command [0,3] "one"
      command_name [0,3] "one"
        word [0,3] "one"
    heredoc_redirect [4,30] "<<EOF | grep two\nthree\nEOF"
      (<<) [4,6] "<<"
      heredoc_start [6,9] "EOF"
      pipeline [10,20] "| grep two"
        (|) [10,11] "|"
        command [12,20] "grep two"
          command_name [12,16] "grep"
            word [12,16] "grep"
          word [17,20] "two"
      heredoc_body [21,27] "three\n"
        heredoc_content [21,27] "three\n"
      heredoc_end [27,30] "EOF"
===
===
@known-diff heredoc-content-chunks: corpus commands.txt::Heredocs with escaped expansions
cat  << EOF
DEV_NAME=\$(lsblk)
EOF
---
hasError: false
program [0,34] "cat  << EOF\nDEV_NAME=\\$(lsblk)\nEOF"
  redirected_statement [0,34] "cat  << EOF\nDEV_NAME=\\$(lsblk)\nEOF"
    command [0,3] "cat"
      command_name [0,3] "cat"
        word [0,3] "cat"
    heredoc_redirect [5,34] "<< EOF\nDEV_NAME=\\$(lsblk)\nEOF"
      (<<) [5,7] "<<"
      heredoc_start [8,11] "EOF"
      heredoc_body [12,31] "DEV_NAME=\\$(lsblk)\n"
        heredoc_content [12,31] "DEV_NAME=\\$(lsblk)\n"
      heredoc_end [31,34] "EOF"
===
===
@known-diff heredoc-content-chunks: corpus commands.txt::Heredocs with indented closing delimiters
usage() {
	cat <<-EOF
		Usage: ${0##*/} FOO BAR
	EOF
}
---
hasError: false
program [0,54] "usage() {\n\tcat <<-EOF\n\t\tUsage: ${0##*..."
  function_definition [0,54] "usage() {\n\tcat <<-EOF\n\t\tUsage: ${0##*..."
    word [0,5] "usage"
    (() [5,6] "("
    ()) [6,7] ")"
    compound_statement [8,54] "{\n\tcat <<-EOF\n\t\tUsage: ${0##*/} FOO B..."
      ({) [8,9] "{"
      redirected_statement [11,52] "cat <<-EOF\n\t\tUsage: ${0##*/} FOO BAR\n..."
        command [11,14] "cat"
          command_name [11,14] "cat"
            word [11,14] "cat"
        heredoc_redirect [15,52] "<<-EOF\n\t\tUsage: ${0##*/} FOO BAR\n\tEOF"
          (<<-) [15,18] "<<-"
          heredoc_start [18,21] "EOF"
          heredoc_body [24,49] "Usage: ${0##*/} FOO BAR\n\t"
            heredoc_content [24,31] "Usage: "
            expansion [31,39] "${0##*/}"
              (${) [31,33] "${"
              special_variable_name [33,34] "0"
              (##) [34,36] "##"
              regex [36,38] "*/"
              (}) [38,39] "}"
            heredoc_content [39,49] " FOO BAR\n\t"
          heredoc_end [49,52] "EOF"
      (}) [53,54] "}"
===
===
@known-diff heredoc-content-chunks: corpus commands.txt::Heredocs with weird characters
node <<_DELIMITER_WITH_UNDERSCORES_
Hello.
_DELIMITER_WITH_UNDERSCORES_

node <<'```'
Hello.
```

node <<!HEREDOC!
Hello.
!HEREDOC!

node <<\'
Hello.
'

node <<\\
Hello.
\
---
hasError: false
program [0,171] "node <<_DELIMITER_WITH_UNDERSCORES_\nH..."
  redirected_statement [0,71] "node <<_DELIMITER_WITH_UNDERSCORES_\nH..."
    command [0,4] "node"
      command_name [0,4] "node"
        word [0,4] "node"
    heredoc_redirect [5,71] "<<_DELIMITER_WITH_UNDERSCORES_\nHello...."
      (<<) [5,7] "<<"
      heredoc_start [7,35] "_DELIMITER_WITH_UNDERSCORES_"
      heredoc_body [36,43] "Hello.\n"
        heredoc_content [36,43] "Hello.\n"
      heredoc_end [43,71] "_DELIMITER_WITH_UNDERSCORES_"
  redirected_statement [73,96] "node <<'```'\nHello.\n```"
    command [73,77] "node"
      command_name [73,77] "node"
        word [73,77] "node"
    heredoc_redirect [78,96] "<<'```'\nHello.\n```"
      (<<) [78,80] "<<"
      heredoc_start [80,85] "'```'"
      heredoc_body [86,93] "Hello.\n"
      heredoc_end [93,96] "```"
  redirected_statement [98,131] "node <<!HEREDOC!\nHello.\n!HEREDOC!"
    command [98,102] "node"
      command_name [98,102] "node"
        word [98,102] "node"
    heredoc_redirect [103,131] "<<!HEREDOC!\nHello.\n!HEREDOC!"
      (<<) [103,105] "<<"
      heredoc_start [105,114] "!HEREDOC!"
      heredoc_body [115,122] "Hello.\n"
        heredoc_content [115,122] "Hello.\n"
      heredoc_end [122,131] "!HEREDOC!"
  redirected_statement [133,151] "node <<\\'\nHello.\n'"
    command [133,137] "node"
      command_name [133,137] "node"
        word [133,137] "node"
    heredoc_redirect [138,151] "<<\\'\nHello.\n'"
      (<<) [138,140] "<<"
      heredoc_start [140,142] "\\'"
      heredoc_body [143,150] "Hello.\n"
      heredoc_end [150,151] "'"
  redirected_statement [153,171] "node <<\\\\\nHello.\n\\"
    command [153,157] "node"
      command_name [153,157] "node"
        word [153,157] "node"
    heredoc_redirect [158,171] "<<\\\\\nHello.\n\\"
      (<<) [158,160] "<<"
      heredoc_start [160,162] "\\\\"
      heredoc_body [163,170] "Hello.\n"
      heredoc_end [170,171] "\\"
===
===
@known-diff heredoc-content-chunks: corpus commands.txt::Heredocs with a rhs statement
cat <<-_EOF_ || die "cat EOF failed"
	#!/bin/sh
	echo hello
_EOF_
---
hasError: false
program [0,65] "cat <<-_EOF_ || die \"cat EOF failed\"\n..."
  redirected_statement [0,65] "cat <<-_EOF_ || die \"cat EOF failed\"\n..."
    command [0,3] "cat"
      command_name [0,3] "cat"
        word [0,3] "cat"
    heredoc_redirect [4,65] "<<-_EOF_ || die \"cat EOF failed\"\n\t#!/..."
      (<<-) [4,7] "<<-"
      heredoc_start [7,12] "_EOF_"
      (||) [13,15] "||"
      command [16,36] "die \"cat EOF failed\""
        command_name [16,19] "die"
          word [16,19] "die"
        string [20,36] "\"cat EOF failed\""
          (") [20,21] "\""
          string_content [21,35] "cat EOF failed"
          (") [35,36] "\""
      heredoc_body [38,60] "#!/bin/sh\n\techo hello\n"
        heredoc_content [38,60] "#!/bin/sh\n\techo hello\n"
      heredoc_end [60,65] "_EOF_"
===
===
@known-diff heredoc-content-chunks: corpus commands.txt::Heredocs with a $ that is not an expansion
cat <<EOF
# check out this regex '^EOF$'
EOF
---
hasError: false
program [0,44] "cat <<EOF\n# check out this regex '^EO..."
  redirected_statement [0,44] "cat <<EOF\n# check out this regex '^EO..."
    command [0,3] "cat"
      command_name [0,3] "cat"
        word [0,3] "cat"
    heredoc_redirect [4,44] "<<EOF\n# check out this regex '^EOF$'\nEOF"
      (<<) [4,6] "<<"
      heredoc_start [6,9] "EOF"
      heredoc_body [10,41] "# check out this regex '^EOF$'\n"
        heredoc_content [10,41] "# check out this regex '^EOF$'\n"
      heredoc_end [41,44] "EOF"
===
===
@known-diff heredoc-content-chunks: corpus commands.txt::Nested Heredocs
cat <<OUTER
Outer Heredoc Start
$(cat <<INNER
Inner Heredoc Content
$(cat <<INNERMOST
Innermost Heredoc Content
INNERMOST
)
INNER)
Outer Heredoc End
OUTER
---
hasError: false
program [0,154] "cat <<OUTER\nOuter Heredoc Start\n$(cat..."
  redirected_statement [0,154] "cat <<OUTER\nOuter Heredoc Start\n$(cat..."
    command [0,3] "cat"
      command_name [0,3] "cat"
        word [0,3] "cat"
    heredoc_redirect [4,154] "<<OUTER\nOuter Heredoc Start\n$(cat <<I..."
      (<<) [4,6] "<<"
      heredoc_start [6,11] "OUTER"
      heredoc_body [12,149] "Outer Heredoc Start\n$(cat <<INNER\nInn..."
        heredoc_content [12,32] "Outer Heredoc Start\n"
        command_substitution [32,130] "$(cat <<INNER\nInner Heredoc Content\n$..."
          ($() [32,34] "$("
          redirected_statement [34,129] "cat <<INNER\nInner Heredoc Content\n$(c..."
            command [34,37] "cat"
              command_name [34,37] "cat"
                word [34,37] "cat"
            heredoc_redirect [38,129] "<<INNER\nInner Heredoc Content\n$(cat <..."
              (<<) [38,40] "<<"
              heredoc_start [40,45] "INNER"
              heredoc_body [46,124] "Inner Heredoc Content\n$(cat <<INNERMO..."
                heredoc_content [46,68] "Inner Heredoc Content\n"
                command_substitution [68,123] "$(cat <<INNERMOST\nInnermost Heredoc C..."
                  ($() [68,70] "$("
                  redirected_statement [70,121] "cat <<INNERMOST\nInnermost Heredoc Con..."
                    command [70,73] "cat"
                      command_name [70,73] "cat"
                        word [70,73] "cat"
                    heredoc_redirect [74,121] "<<INNERMOST\nInnermost Heredoc Content..."
                      (<<) [74,76] "<<"
                      heredoc_start [76,85] "INNERMOST"
                      heredoc_body [86,112] "Innermost Heredoc Content\n"
                        heredoc_content [86,112] "Innermost Heredoc Content\n"
                      heredoc_end [112,121] "INNERMOST"
                  ()) [122,123] ")"
                heredoc_content [123,124] "\n"
              heredoc_end [124,129] "INNER"
          ()) [129,130] ")"
        heredoc_content [130,149] "\nOuter Heredoc End\n"
      heredoc_end [149,154] "OUTER"
===
===
@known-diff expansion-replacement-escaped-backslash: corpus literals.txt::Variable expansions with regexes
A=${B//:;;/$'\n'}

# escaped space
C=${D/;\ *;|}
MOFILES=${LINGUAS// /.po }.po
MY_P="${PN/aspell/aspell"${ASPELL_VERSION}"}"
pyc=${pyc//*\/}
${pv/\.}
${new_test_cp//"${old_ver_cp}"/}
${tests_to_run//"${classes}"\/}
${allarchives// /\\|}
---
hasError: false
program [0,236] "A=${B//:;;/$'\\n'}\n\n# escaped space\nC=..."
  variable_assignment [0,17] "A=${B//:;;/$'\\n'}"
    variable_name [0,1] "A"
    (=) [1,2] "="
    expansion [2,17] "${B//:;;/$'\\n'}"
      (${) [2,4] "${"
      variable_name [4,5] "B"
      (//) [5,7] "//"
      regex [7,10] ":;;"
      (/) [10,11] "/"
      ansi_c_string [11,16] "$'\\n'"
      (}) [16,17] "}"
  comment [19,34] "# escaped space"
  variable_assignment [35,48] "C=${D/;\\ *;|}"
    variable_name [35,36] "C"
    (=) [36,37] "="
    expansion [37,48] "${D/;\\ *;|}"
      (${) [37,39] "${"
      variable_name [39,40] "D"
      (/) [40,41] "/"
      regex [41,47] ";\\ *;|"
      (}) [47,48] "}"
  variable_assignment [49,78] "MOFILES=${LINGUAS// /.po }.po"
    variable_name [49,56] "MOFILES"
    (=) [56,57] "="
    concatenation [57,78] "${LINGUAS// /.po }.po"
      expansion [57,75] "${LINGUAS// /.po }"
        (${) [57,59] "${"
        variable_name [59,66] "LINGUAS"
        (//) [66,68] "//"
        regex [68,69] " "
        (/) [69,70] "/"
        word [70,74] ".po "
        (}) [74,75] "}"
      word [75,78] ".po"
  variable_assignment [79,124] "MY_P=\"${PN/aspell/aspell\"${ASPELL_VER..."
    variable_name [79,83] "MY_P"
    (=) [83,84] "="
    string [84,124] "\"${PN/aspell/aspell\"${ASPELL_VERSION}\"}\""
      (") [84,85] "\""
      expansion [85,123] "${PN/aspell/aspell\"${ASPELL_VERSION}\"}"
        (${) [85,87] "${"
        variable_name [87,89] "PN"
        (/) [89,90] "/"
        regex [90,96] "aspell"
        (/) [96,97] "/"
        concatenation [97,122] "aspell\"${ASPELL_VERSION}\""
          word [97,103] "aspell"
          string [103,122] "\"${ASPELL_VERSION}\""
            (") [103,104] "\""
            expansion [104,121] "${ASPELL_VERSION}"
              (${) [104,106] "${"
              variable_name [106,120] "ASPELL_VERSION"
              (}) [120,121] "}"
            (") [121,122] "\""
        (}) [122,123] "}"
      (") [123,124] "\""
  variable_assignment [125,140] "pyc=${pyc//*\\/}"
    variable_name [125,128] "pyc"
    (=) [128,129] "="
    expansion [129,140] "${pyc//*\\/}"
      (${) [129,131] "${"
      variable_name [131,134] "pyc"
      (//) [134,136] "//"
      regex [136,138] "*\\"
      (/) [138,139] "/"
      (}) [139,140] "}"
  command [141,149] "${pv/\\.}"
    command_name [141,149] "${pv/\\.}"
      expansion [141,149] "${pv/\\.}"
        (${) [141,143] "${"
        variable_name [143,145] "pv"
        (/) [145,146] "/"
        regex [146,148] "\\."
        (}) [148,149] "}"
  command [150,182] "${new_test_cp//\"${old_ver_cp}\"/}"
    command_name [150,182] "${new_test_cp//\"${old_ver_cp}\"/}"
      expansion [150,182] "${new_test_cp//\"${old_ver_cp}\"/}"
        (${) [150,152] "${"
        variable_name [152,163] "new_test_cp"
        (//) [163,165] "//"
        string [165,180] "\"${old_ver_cp}\""
          (") [165,166] "\""
          expansion [166,179] "${old_ver_cp}"
            (${) [166,168] "${"
            variable_name [168,178] "old_ver_cp"
            (}) [178,179] "}"
          (") [179,180] "\""
        (/) [180,181] "/"
        (}) [181,182] "}"
  command [183,214] "${tests_to_run//\"${classes}\"\\/}"
    command_name [183,214] "${tests_to_run//\"${classes}\"\\/}"
      expansion [183,214] "${tests_to_run//\"${classes}\"\\/}"
        (${) [183,185] "${"
        variable_name [185,197] "tests_to_run"
        (//) [197,199] "//"
        string [199,211] "\"${classes}\""
          (") [199,200] "\""
          expansion [200,210] "${classes}"
            (${) [200,202] "${"
            variable_name [202,209] "classes"
            (}) [209,210] "}"
          (") [210,211] "\""
        regex [211,212] "\\"
        (/) [212,213] "/"
        (}) [213,214] "}"
  command [215,236] "${allarchives// /\\\\|}"
    command_name [215,236] "${allarchives// /\\\\|}"
      expansion [215,236] "${allarchives// /\\\\|}"
        (${) [215,217] "${"
        variable_name [217,228] "allarchives"
        (//) [228,230] "//"
        regex [230,231] " "
        (/) [231,232] "/"
        word [232,235] "\\\\|"
        (}) [235,236] "}"
===
===
@known-diff expansion-bang-hash-special: corpus literals.txt::Variable Expansions: Bizarre Cases
${!#}
${!# }
${!##}
${!## }
${!##/}
# here be dragons
echo "${kw}? ( ${cond:+${cond}? (} ${baseuri}-${ver}-${kw}.${suff} ${cond:+) })"
---
hasError: true
program [0,134] "${!#}\n${!# }\n${!##}\n${!## }\n${!##/}\n#..."
  command [0,5] "${!#}"
    command_name [0,5] "${!#}"
      expansion [0,5] "${!#}"
        (${) [0,2] "${"
        (!) [2,3] "!"
        (#) [3,4] "#"
        (}) [4,5] "}"
  command [6,12] "${!# }"
    command_name [6,12] "${!# }"
      expansion [6,12] "${!# }"
        (${) [6,8] "${"
        (!) [8,9] "!"
        special_variable_name [9,10] "#"
        word [10,11] " "
        (}) [11,12] "}"
  command [13,19] "${!##}"
    command_name [13,19] "${!##}"
      expansion [13,19] "${!##}"
        (${) [13,15] "${"
        (!) [15,16] "!"
        (#) [16,17] "#"
        (#) [17,18] "#"
        (}) [18,19] "}"
  command [20,27] "${!## }"
    command_name [20,27] "${!## }"
      expansion [20,27] "${!## }"
        (${) [20,22] "${"
        (!) [22,23] "!"
        (#) [23,24] "#"
        special_variable_name [24,25] "#"
        word [25,26] " "
        (}) [26,27] "}"
  command [28,35] "${!##/}"
    command_name [28,35] "${!##/}"
      expansion [28,35] "${!##/}"
        (${) [28,30] "${"
        (!) [30,31] "!"
        (#) [31,32] "#"
        special_variable_name [32,33] "#"
        (/) [33,34] "/"
        (}) [34,35] "}"
  comment [36,53] "# here be dragons"
  command [54,134] "echo \"${kw}? ( ${cond:+${cond}? (} ${..."
    command_name [54,58] "echo"
      word [54,58] "echo"
    string [59,134] "\"${kw}? ( ${cond:+${cond}? (} ${baseu..."
      (") [59,60] "\""
      expansion [60,65] "${kw}"
        (${) [60,62] "${"
        variable_name [62,64] "kw"
        (}) [64,65] "}"
      string_content [65,69] "? ( "
      expansion [69,88] "${cond:+${cond}? (}"
        (${) [69,71] "${"
        variable_name [71,75] "cond"
        (:+) [75,77] ":+"
        concatenation [77,87] "${cond}? ("
          expansion [77,84] "${cond}"
            (${) [77,79] "${"
            variable_name [79,83] "cond"
            (}) [83,84] "}"
          word [84,87] "? ("
        (}) [87,88] "}"
      expansion [88,99] " ${baseuri}"
        (${) [88,91] " ${"
        variable_name [91,98] "baseuri"
        (}) [98,99] "}"
      string_content [99,100] "-"
      expansion [100,106] "${ver}"
        (${) [100,102] "${"
        variable_name [102,105] "ver"
        (}) [105,106] "}"
      string_content [106,107] "-"
      expansion [107,112] "${kw}"
        (${) [107,109] "${"
        variable_name [109,111] "kw"
        (}) [111,112] "}"
      string_content [112,113] "."
      expansion [113,120] "${suff}"
        (${) [113,115] "${"
        variable_name [115,119] "suff"
        (}) [119,120] "}"
      expansion [120,132] " ${cond:+) }"
        (${) [120,123] " ${"
        variable_name [123,127] "cond"
        (:+) [127,129] ":+"
        word [129,131] ") "
        (}) [131,132] "}"
      string_content [132,133] ")"
      (") [133,134] "\""
===
===
@known-diff expansion-equals-operator: corpus literals.txt::Variable Expansions: Weird Cases
${completions[*]}
${=1}
${2?}
${p_key#*=}
${abc:- }
${B[0]# }
${to_enables[0]##*/}
exec "${0#-}" --rcfile "${BASH_IT_BASHRC:-${HOME?}/.bashrc}"
recho "TDEFAULTS = ${selvecs:+-DSELECT_VECS=\"$selvecs\"}"
local msg="${2:-command '$1' does not exist}"
${cdir:+#}
${dict_langs:+;}
${UTIL_LINUX_LIBC[@]/%/? ( sys-apps/util-linux )}
${id}${2+ ${2}}
${BRANDING_GCC_PKGVERSION/(/(Gentoo ${PVR}${extvers}, } # look at that parenthesis!
some-command ${foo:+--arg <(printf '%s\n' "$foo")}
---
hasError: false
program [0,477] "${completions[*]}\n${=1}\n${2?}\n${p_key..."
  command [0,17] "${completions[*]}"
    command_name [0,17] "${completions[*]}"
      expansion [0,17] "${completions[*]}"
        (${) [0,2] "${"
        subscript [2,16] "completions[*]"
          variable_name [2,13] "completions"
          ([) [13,14] "["
          word [14,15] "*"
          (]) [15,16] "]"
        (}) [16,17] "}"
  command [18,23] "${=1}"
    command_name [18,23] "${=1}"
      expansion [18,23] "${=1}"
        (${) [18,20] "${"
        (=) [20,21] "="
        word [21,22] "1"
        (}) [22,23] "}"
  command [24,29] "${2?}"
    command_name [24,29] "${2?}"
      expansion [24,29] "${2?}"
        (${) [24,26] "${"
        variable_name [26,27] "2"
        (?) [27,28] "?"
        (}) [28,29] "}"
  command [30,41] "${p_key#*=}"
    command_name [30,41] "${p_key#*=}"
      expansion [30,41] "${p_key#*=}"
        (${) [30,32] "${"
        variable_name [32,37] "p_key"
        (#) [37,38] "#"
        regex [38,40] "*="
        (}) [40,41] "}"
  command [42,51] "${abc:- }"
    command_name [42,51] "${abc:- }"
      expansion [42,51] "${abc:- }"
        (${) [42,44] "${"
        variable_name [44,47] "abc"
        (:-) [47,49] ":-"
        word [49,50] " "
        (}) [50,51] "}"
  command [52,61] "${B[0]# }"
    command_name [52,61] "${B[0]# }"
      expansion [52,61] "${B[0]# }"
        (${) [52,54] "${"
        subscript [54,58] "B[0]"
          variable_name [54,55] "B"
          ([) [55,56] "["
          number [56,57] "0"
          (]) [57,58] "]"
        (#) [58,59] "#"
        regex [59,60] " "
        (}) [60,61] "}"
  command [62,82] "${to_enables[0]##*/}"
    command_name [62,82] "${to_enables[0]##*/}"
      expansion [62,82] "${to_enables[0]##*/}"
        (${) [62,64] "${"
        subscript [64,77] "to_enables[0]"
          variable_name [64,74] "to_enables"
          ([) [74,75] "["
          number [75,76] "0"
          (]) [76,77] "]"
        (##) [77,79] "##"
        regex [79,81] "*/"
        (}) [81,82] "}"
  command [83,143] "exec \"${0#-}\" --rcfile \"${BASH_IT_BAS..."
    command_name [83,87] "exec"
      word [83,87] "exec"
    string [88,96] "\"${0#-}\""
      (") [88,89] "\""
      expansion [89,95] "${0#-}"
        (${) [89,91] "${"
        special_variable_name [91,92] "0"
        (#) [92,93] "#"
        regex [93,94] "-"
        (}) [94,95] "}"
      (") [95,96] "\""
    word [97,105] "--rcfile"
    string [106,143] "\"${BASH_IT_BASHRC:-${HOME?}/.bashrc}\""
      (") [106,107] "\""
      expansion [107,142] "${BASH_IT_BASHRC:-${HOME?}/.bashrc}"
        (${) [107,109] "${"
        variable_name [109,123] "BASH_IT_BASHRC"
        (:-) [123,125] ":-"
        concatenation [125,141] "${HOME?}/.bashrc"
          expansion [125,133] "${HOME?}"
            (${) [125,127] "${"
            variable_name [127,131] "HOME"
            (?) [131,132] "?"
            (}) [132,133] "}"
          word [133,141] "/.bashrc"
        (}) [141,142] "}"
      (") [142,143] "\""
  command [144,202] "recho \"TDEFAULTS = ${selvecs:+-DSELEC..."
    command_name [144,149] "recho"
      word [144,149] "recho"
    string [150,202] "\"TDEFAULTS = ${selvecs:+-DSELECT_VECS..."
      (") [150,151] "\""
      string_content [151,163] "TDEFAULTS = "
      expansion [163,201] "${selvecs:+-DSELECT_VECS=\\\"$selvecs\\\"}"
        (${) [163,165] "${"
        variable_name [165,172] "selvecs"
        (:+) [172,174] ":+"
        concatenation [174,200] "-DSELECT_VECS=\\\"$selvecs\\\""
          word [174,190] "-DSELECT_VECS=\\\""
          simple_expansion [190,198] "$selvecs"
            ($) [190,191] "$"
            variable_name [191,198] "selvecs"
          word [198,200] "\\\""
        (}) [200,201] "}"
      (") [201,202] "\""
  declaration_command [203,248] "local msg=\"${2:-command '$1' does not..."
    (local) [203,208] "local"
    variable_assignment [209,248] "msg=\"${2:-command '$1' does not exist}\""
      variable_name [209,212] "msg"
      (=) [212,213] "="
      string [213,248] "\"${2:-command '$1' does not exist}\""
        (") [213,214] "\""
        expansion [214,247] "${2:-command '$1' does not exist}"
          (${) [214,216] "${"
          variable_name [216,217] "2"
          (:-) [217,219] ":-"
          concatenation [219,246] "command '$1' does not exist"
            word [219,226] "command"
            raw_string [227,231] "'$1'"
            word [231,246] " does not exist"
          (}) [246,247] "}"
        (") [247,248] "\""
  command [249,259] "${cdir:+#}"
    command_name [249,259] "${cdir:+#}"
      expansion [249,259] "${cdir:+#}"
        (${) [249,251] "${"
        variable_name [251,255] "cdir"
        (:+) [255,257] ":+"
        word [257,258] "#"
        (}) [258,259] "}"
  command [260,276] "${dict_langs:+;}"
    command_name [260,276] "${dict_langs:+;}"
      expansion [260,276] "${dict_langs:+;}"
        (${) [260,262] "${"
        variable_name [262,272] "dict_langs"
        (:+) [272,274] ":+"
        word [274,275] ";"
        (}) [275,276] "}"
  command [277,326] "${UTIL_LINUX_LIBC[@]/%/? ( sys-apps/u..."
    command_name [277,326] "${UTIL_LINUX_LIBC[@]/%/? ( sys-apps/u..."
      expansion [277,326] "${UTIL_LINUX_LIBC[@]/%/? ( sys-apps/u..."
        (${) [277,279] "${"
        subscript [279,297] "UTIL_LINUX_LIBC[@]"
          variable_name [279,294] "UTIL_LINUX_LIBC"
          ([) [294,295] "["
          word [295,296] "@"
          (]) [296,297] "]"
        (/%) [297,299] "/%"
        (/) [299,300] "/"
        word [300,325] "? ( sys-apps/util-linux )"
        (}) [325,326] "}"
  command [327,342] "${id}${2+ ${2}}"
    command_name [327,342] "${id}${2+ ${2}}"
      concatenation [327,342] "${id}${2+ ${2}}"
        expansion [327,332] "${id}"
          (${) [327,329] "${"
          variable_name [329,331] "id"
          (}) [331,332] "}"
        expansion [332,342] "${2+ ${2}}"
          (${) [332,334] "${"
          variable_name [334,335] "2"
          (+) [335,336] "+"
          expansion [337,341] "${2}"
            (${) [337,339] "${"
            variable_name [339,340] "2"
            (}) [340,341] "}"
          (}) [341,342] "}"
  command [343,398] "${BRANDING_GCC_PKGVERSION/(/(Gentoo $..."
    command_name [343,398] "${BRANDING_GCC_PKGVERSION/(/(Gentoo $..."
      expansion [343,398] "${BRANDING_GCC_PKGVERSION/(/(Gentoo $..."
        (${) [343,345] "${"
        variable_name [345,368] "BRANDING_GCC_PKGVERSION"
        (/) [368,369] "/"
        regex [369,370] "("
        (/) [370,371] "/"
        concatenation [371,397] "(Gentoo ${PVR}${extvers}, "
          word [371,379] "(Gentoo "
          expansion [379,385] "${PVR}"
            (${) [379,381] "${"
            variable_name [381,384] "PVR"
            (}) [384,385] "}"
          expansion [385,395] "${extvers}"
            (${) [385,387] "${"
            variable_name [387,394] "extvers"
            (}) [394,395] "}"
          word [395,397] ", "
        (}) [397,398] "}"
  comment [399,426] "# look at that parenthesis!"
  command [427,477] "some-command ${foo:+--arg <(printf '%..."
    command_name [427,439] "some-command"
      word [427,439] "some-command"
    expansion [440,477] "${foo:+--arg <(printf '%s\\n' \"$foo\")}"
      (${) [440,442] "${"
      variable_name [442,445] "foo"
      (:+) [445,447] ":+"
      concatenation [447,476] "--arg <(printf '%s\\n' \"$foo\")"
        word [447,452] "--arg"
        process_substitution [453,476] "<(printf '%s\\n' \"$foo\")"
          (<() [453,455] "<("
          command [455,475] "printf '%s\\n' \"$foo\""
            command_name [455,461] "printf"
              word [455,461] "printf"
            raw_string [462,468] "'%s\\n'"
            string [469,475] "\"$foo\""
              (") [469,470] "\""
              simple_expansion [470,474] "$foo"
                ($) [470,471] "$"
                variable_name [471,474] "foo"
              (") [474,475] "\""
          ()) [475,476] ")"
      (}) [476,477] "}"
===
===
@known-diff number-base-with-expansion: corpus literals.txt::Variable Expansions: Regex
A=${B//:;;/$'\n'}
C="${D/#* -E /}"
BASH_IT_GIT_URL="${BASH_IT_GIT_URL/git@/https://}"
10#${command_start##*.}
echo ${LIB_DEPEND//\[static-libs(+)]}
${ALL_LLVM_TARGETS[@]/%/(-)?}
filterdiff -p1 ${paths[@]/#/-i }
${cflags//-O? /$(get-flag O) }
curf="${f%'-roff2html'*}.html"
reff="${f/'-roff2html'*/'-ref'}.html"
---
hasError: false
program [0,310] "A=${B//:;;/$'\\n'}\nC=\"${D/#* -E /}\"\nBA..."
  variable_assignment [0,17] "A=${B//:;;/$'\\n'}"
    variable_name [0,1] "A"
    (=) [1,2] "="
    expansion [2,17] "${B//:;;/$'\\n'}"
      (${) [2,4] "${"
      variable_name [4,5] "B"
      (//) [5,7] "//"
      regex [7,10] ":;;"
      (/) [10,11] "/"
      ansi_c_string [11,16] "$'\\n'"
      (}) [16,17] "}"
  variable_assignment [18,34] "C=\"${D/#* -E /}\""
    variable_name [18,19] "C"
    (=) [19,20] "="
    string [20,34] "\"${D/#* -E /}\""
      (") [20,21] "\""
      expansion [21,33] "${D/#* -E /}"
        (${) [21,23] "${"
        variable_name [23,24] "D"
        (/#) [24,26] "/#"
        regex [26,31] "* -E "
        (/) [31,32] "/"
        (}) [32,33] "}"
      (") [33,34] "\""
  variable_assignment [35,85] "BASH_IT_GIT_URL=\"${BASH_IT_GIT_URL/gi..."
    variable_name [35,50] "BASH_IT_GIT_URL"
    (=) [50,51] "="
    string [51,85] "\"${BASH_IT_GIT_URL/git@/https://}\""
      (") [51,52] "\""
      expansion [52,84] "${BASH_IT_GIT_URL/git@/https://}"
        (${) [52,54] "${"
        variable_name [54,69] "BASH_IT_GIT_URL"
        (/) [69,70] "/"
        regex [70,74] "git@"
        (/) [74,75] "/"
        word [75,83] "https://"
        (}) [83,84] "}"
      (") [84,85] "\""
  command [86,109] "10#${command_start##*.}"
    command_name [86,109] "10#${command_start##*.}"
      concatenation [86,109] "10#${command_start##*.}"
        word [86,89] "10#"
        expansion [89,109] "${command_start##*.}"
          (${) [89,91] "${"
          variable_name [91,104] "command_start"
          (##) [104,106] "##"
          regex [106,108] "*."
          (}) [108,109] "}"
  command [110,147] "echo ${LIB_DEPEND//\\[static-libs(+)]}"
    command_name [110,114] "echo"
      word [110,114] "echo"
    expansion [115,147] "${LIB_DEPEND//\\[static-libs(+)]}"
      (${) [115,117] "${"
      variable_name [117,127] "LIB_DEPEND"
      (//) [127,129] "//"
      regex [129,146] "\\[static-libs(+)]"
      (}) [146,147] "}"
  command [148,177] "${ALL_LLVM_TARGETS[@]/%/(-)?}"
    command_name [148,177] "${ALL_LLVM_TARGETS[@]/%/(-)?}"
      expansion [148,177] "${ALL_LLVM_TARGETS[@]/%/(-)?}"
        (${) [148,150] "${"
        subscript [150,169] "ALL_LLVM_TARGETS[@]"
          variable_name [150,166] "ALL_LLVM_TARGETS"
          ([) [166,167] "["
          word [167,168] "@"
          (]) [168,169] "]"
        (/%) [169,171] "/%"
        (/) [171,172] "/"
        word [172,176] "(-)?"
        (}) [176,177] "}"
  command [178,210] "filterdiff -p1 ${paths[@]/#/-i }"
    command_name [178,188] "filterdiff"
      word [178,188] "filterdiff"
    word [189,192] "-p1"
    expansion [193,210] "${paths[@]/#/-i }"
      (${) [193,195] "${"
      subscript [195,203] "paths[@]"
        variable_name [195,200] "paths"
        ([) [200,201] "["
        word [201,202] "@"
        (]) [202,203] "]"
      (/#) [203,205] "/#"
      (/) [205,206] "/"
      word [206,209] "-i "
      (}) [209,210] "}"
  command [211,241] "${cflags//-O? /$(get-flag O) }"
    command_name [211,241] "${cflags//-O? /$(get-flag O) }"
      expansion [211,241] "${cflags//-O? /$(get-flag O) }"
        (${) [211,213] "${"
        variable_name [213,219] "cflags"
        (//) [219,221] "//"
        regex [221,225] "-O? "
        (/) [225,226] "/"
        command_substitution [226,239] "$(get-flag O)"
          ($() [226,228] "$("
          command [228,238] "get-flag O"
            command_name [228,236] "get-flag"
              word [228,236] "get-flag"
            word [237,238] "O"
          ()) [238,239] ")"
        word [239,240] " "
        (}) [240,241] "}"
  variable_assignment [242,272] "curf=\"${f%'-roff2html'*}.html\""
    variable_name [242,246] "curf"
    (=) [246,247] "="
    string [247,272] "\"${f%'-roff2html'*}.html\""
      (") [247,248] "\""
      expansion [248,266] "${f%'-roff2html'*}"
        (${) [248,250] "${"
        variable_name [250,251] "f"
        (%) [251,252] "%"
        raw_string [252,264] "'-roff2html'"
        regex [264,265] "*"
        (}) [265,266] "}"
      string_content [266,271] ".html"
      (") [271,272] "\""
  variable_assignment [273,310] "reff=\"${f/'-roff2html'*/'-ref'}.html\""
    variable_name [273,277] "reff"
    (=) [277,278] "="
    string [278,310] "\"${f/'-roff2html'*/'-ref'}.html\""
      (") [278,279] "\""
      expansion [279,304] "${f/'-roff2html'*/'-ref'}"
        (${) [279,281] "${"
        variable_name [281,282] "f"
        (/) [282,283] "/"
        regex [283,296] "'-roff2html'*"
        (/) [296,297] "/"
        raw_string [297,303] "'-ref'"
        (}) [303,304] "}"
      string_content [304,309] ".html"
      (") [309,310] "\""
===
===
@known-diff expansion-default-array: corpus literals.txt::Arrays and array expansions
a=()
b=(1 2 3)

echo ${a[@]}
echo ${#b[@]}

a[$i]=50
a+=(foo "bar" $(baz))

printf "  %-9s" "${seq0:-(default)}"
---
hasError: false
program [0,112] "a=()\nb=(1 2 3)\n\necho ${a[@]}\necho ${#..."
  variable_assignment [0,4] "a=()"
    variable_name [0,1] "a"
    (=) [1,2] "="
    array [2,4] "()"
      (() [2,3] "("
      ()) [3,4] ")"
  variable_assignment [5,14] "b=(1 2 3)"
    variable_name [5,6] "b"
    (=) [6,7] "="
    array [7,14] "(1 2 3)"
      (() [7,8] "("
      number [8,9] "1"
      number [10,11] "2"
      number [12,13] "3"
      ()) [13,14] ")"
  command [16,28] "echo ${a[@]}"
    command_name [16,20] "echo"
      word [16,20] "echo"
    expansion [21,28] "${a[@]}"
      (${) [21,23] "${"
      subscript [23,27] "a[@]"
        variable_name [23,24] "a"
        ([) [24,25] "["
        word [25,26] "@"
        (]) [26,27] "]"
      (}) [27,28] "}"
  command [29,42] "echo ${#b[@]}"
    command_name [29,33] "echo"
      word [29,33] "echo"
    expansion [34,42] "${#b[@]}"
      (${) [34,36] "${"
      (#) [36,37] "#"
      subscript [37,41] "b[@]"
        variable_name [37,38] "b"
        ([) [38,39] "["
        word [39,40] "@"
        (]) [40,41] "]"
      (}) [41,42] "}"
  variable_assignment [44,52] "a[$i]=50"
    subscript [44,49] "a[$i]"
      variable_name [44,45] "a"
      ([) [45,46] "["
      simple_expansion [46,48] "$i"
        ($) [46,47] "$"
        variable_name [47,48] "i"
      (]) [48,49] "]"
    (=) [49,50] "="
    number [50,52] "50"
  variable_assignment [53,74] "a+=(foo \"bar\" $(baz))"
    variable_name [53,54] "a"
    (+=) [54,56] "+="
    array [56,74] "(foo \"bar\" $(baz))"
      (() [56,57] "("
      word [57,60] "foo"
      string [61,66] "\"bar\""
        (") [61,62] "\""
        string_content [62,65] "bar"
        (") [65,66] "\""
      command_substitution [67,73] "$(baz)"
        ($() [67,69] "$("
        command [69,72] "baz"
          command_name [69,72] "baz"
            word [69,72] "baz"
        ()) [72,73] ")"
      ()) [73,74] ")"
  command [76,112] "printf \"  %-9s\" \"${seq0:-(default)}\""
    command_name [76,82] "printf"
      word [76,82] "printf"
    string [83,91] "\"  %-9s\""
      (") [83,84] "\""
      string_content [84,90] "  %-9s"
      (") [90,91] "\""
    string [92,112] "\"${seq0:-(default)}\""
      (") [92,93] "\""
      expansion [93,111] "${seq0:-(default)}"
        (${) [93,95] "${"
        variable_name [95,99] "seq0"
        (:-) [99,101] ":-"
        word [101,110] "(default)"
        (}) [110,111] "}"
      (") [111,112] "\""
===
===
@known-diff empty-backtick: corpus literals.txt::Concatenation with double backticks
main() {
    local foo="asd"`
        `"fgh"
}
---
hasError: false
program [0,46] "main() {\n    local foo=\"asd\"`\n       ..."
  function_definition [0,46] "main() {\n    local foo=\"asd\"`\n       ..."
    word [0,4] "main"
    (() [4,5] "("
    ()) [5,6] ")"
    compound_statement [7,46] "{\n    local foo=\"asd\"`\n        `\"fgh\"\n}"
      ({) [7,8] "{"
      declaration_command [13,44] "local foo=\"asd\"`\n        `\"fgh\""
        (local) [13,18] "local"
        variable_assignment [19,44] "foo=\"asd\"`\n        `\"fgh\""
          variable_name [19,22] "foo"
          (=) [22,23] "="
          concatenation [23,44] "\"asd\"`\n        `\"fgh\""
            string [23,28] "\"asd\""
              (") [23,24] "\""
              string_content [24,27] "asd"
              (") [27,28] "\""
            command_substitution [28,39] "`\n        `"
              (`) [28,29] "`"
              (`) [38,39] "`"
            string [39,44] "\"fgh\""
              (") [39,40] "\""
              string_content [40,43] "fgh"
              (") [43,44] "\""
      (}) [45,46] "}"
===
===
@known-diff escaped-space-argument: corpus programs.txt::Escaped whitespace
echo 1 \ 2 \ 3
---
hasError: false
program [0,14] "echo 1 \\ 2 \\ 3"
  command [0,14] "echo 1 \\ 2 \\ 3"
    command_name [0,4] "echo"
      word [0,4] "echo"
    number [5,6] "1"
    word [7,10] "\\ 2"
    word [11,14] "\\ 3"
===
===
@known-diff expansion-equals-operator: corpus statements.txt::For statements
for a in 1 2 $(seq 5 10); do
  echo $a
done

for ARG; do
  echo $ARG
  ARG=''
done

for c in ${=1}; do
	echo c
done
---
hasError: false
program [0,115] "for a in 1 2 $(seq 5 10); do\n  echo $..."
  for_statement [0,43] "for a in 1 2 $(seq 5 10); do\n  echo $..."
    (for) [0,3] "for"
    variable_name [4,5] "a"
    (in) [6,8] "in"
    number [9,10] "1"
    number [11,12] "2"
    command_substitution [13,24] "$(seq 5 10)"
      ($() [13,15] "$("
      command [15,23] "seq 5 10"
        command_name [15,18] "seq"
          word [15,18] "seq"
        number [19,20] "5"
        number [21,23] "10"
      ()) [23,24] ")"
    (;) [24,25] ";"
    do_group [26,43] "do\n  echo $a\ndone"
      (do) [26,28] "do"
      command [31,38] "echo $a"
        command_name [31,35] "echo"
          word [31,35] "echo"
        simple_expansion [36,38] "$a"
          ($) [36,37] "$"
          variable_name [37,38] "a"
      (done) [39,43] "done"
  for_statement [45,82] "for ARG; do\n  echo $ARG\n  ARG=''\ndone"
    (for) [45,48] "for"
    variable_name [49,52] "ARG"
    (;) [52,53] ";"
    do_group [54,82] "do\n  echo $ARG\n  ARG=''\ndone"
      (do) [54,56] "do"
      command [59,68] "echo $ARG"
        command_name [59,63] "echo"
          word [59,63] "echo"
        simple_expansion [64,68] "$ARG"
          ($) [64,65] "$"
          variable_name [65,68] "ARG"
      variable_assignment [71,77] "ARG=''"
        variable_name [71,74] "ARG"
        (=) [74,75] "="
        raw_string [75,77] "''"
      (done) [78,82] "done"
  for_statement [84,115] "for c in ${=1}; do\n\techo c\ndone"
    (for) [84,87] "for"
    variable_name [88,89] "c"
    (in) [90,92] "in"
    expansion [93,98] "${=1}"
      (${) [93,95] "${"
      (=) [95,96] "="
      word [96,97] "1"
      (}) [97,98] "}"
    (;) [98,99] ";"
    do_group [100,115] "do\n\techo c\ndone"
      (do) [100,102] "do"
      command [104,110] "echo c"
        command_name [104,108] "echo"
          word [104,108] "echo"
        word [109,110] "c"
      (done) [111,115] "done"
===
===
@known-diff case-pattern-after-continuation: corpus statements.txt::Case statements
case "opt" in
  a)
    echo a
    ;;

  b)
    echo b
    ;&

  c)
    echo c;;
esac

case "opt" in
  (a)
    echo a
    ;;

  (b)
    echo b
    ;&

  (c)
    echo c;;
esac

case "$Z" in
  ab*|cd*) ef
esac

case $dest in
  *.[1357])
    exit $?
    ;;
esac

case x in x) echo meow ;; esac

case foo in
  bar\ baz) : ;;
esac

case "$arg" in
  *([0-9])([0-9])) echo "$arg"
esac

case ${lang} in
CMakeLists.txt | \
	cmake_modules | \
	${PN}.pot) ;;
*) rm -r ${lang} || die ;;
esac
---
hasError: false
program [0,478] "case \"opt\" in\n  a)\n    echo a\n    ;;\n..."
  case_statement [0,84] "case \"opt\" in\n  a)\n    echo a\n    ;;\n..."
    (case) [0,4] "case"
    string [5,10] "\"opt\""
      (") [5,6] "\""
      string_content [6,9] "opt"
      (") [9,10] "\""
    (in) [11,13] "in"
    case_item [16,36] "a)\n    echo a\n    ;;"
      word [16,17] "a"
      ()) [17,18] ")"
      command [23,29] "echo a"
        command_name [23,27] "echo"
          word [23,27] "echo"
        word [28,29] "a"
      (;;) [34,36] ";;"
    case_item [40,60] "b)\n    echo b\n    ;&"
      word [40,41] "b"
      ()) [41,42] ")"
      command [47,53] "echo b"
        command_name [47,51] "echo"
          word [47,51] "echo"
        word [52,53] "b"
      (;&) [58,60] ";&"
    case_item [64,79] "c)\n    echo c;;"
      word [64,65] "c"
      ()) [65,66] ")"
      command [71,77] "echo c"
        command_name [71,75] "echo"
          word [71,75] "echo"
        word [76,77] "c"
      (;;) [77,79] ";;"
    (esac) [80,84] "esac"
  case_statement [86,173] "case \"opt\" in\n  (a)\n    echo a\n    ;;..."
    (case) [86,90] "case"
    string [91,96] "\"opt\""
      (") [91,92] "\""
      string_content [92,95] "opt"
      (") [95,96] "\""
    (in) [97,99] "in"
    case_item [102,123] "(a)\n    echo a\n    ;;"
      (() [102,103] "("
      word [103,104] "a"
      ()) [104,105] ")"
      command [110,116] "echo a"
        command_name [110,114] "echo"
          word [110,114] "echo"
        word [115,116] "a"
      (;;) [121,123] ";;"
    case_item [127,148] "(b)\n    echo b\n    ;&"
      (() [127,128] "("
      word [128,129] "b"
      ()) [129,130] ")"
      command [135,141] "echo b"
        command_name [135,139] "echo"
          word [135,139] "echo"
        word [140,141] "b"
      (;&) [146,148] ";&"
    case_item [152,168] "(c)\n    echo c;;"
      (() [152,153] "("
      word [153,154] "c"
      ()) [154,155] ")"
      command [160,166] "echo c"
        command_name [160,164] "echo"
          word [160,164] "echo"
        word [165,166] "c"
      (;;) [166,168] ";;"
    (esac) [169,173] "esac"
  case_statement [175,206] "case \"$Z\" in\n  ab*|cd*) ef\nesac"
    (case) [175,179] "case"
    string [180,184] "\"$Z\""
      (") [180,181] "\""
      simple_expansion [181,183] "$Z"
        ($) [181,182] "$"
        variable_name [182,183] "Z"
      (") [183,184] "\""
    (in) [185,187] "in"
    case_item [190,202] "ab*|cd*) ef\n"
      extglob_pattern [190,193] "ab*"
      (|) [193,194] "|"
      extglob_pattern [194,197] "cd*"
      ()) [197,198] ")"
      command [199,201] "ef"
        command_name [199,201] "ef"
          word [199,201] "ef"
    (esac) [202,206] "esac"
  case_statement [208,257] "case $dest in\n  *.[1357])\n    exit $?..."
    (case) [208,212] "case"
    simple_expansion [213,218] "$dest"
      ($) [213,214] "$"
      variable_name [214,218] "dest"
    (in) [219,221] "in"
    case_item [224,252] "*.[1357])\n    exit $?\n    ;;"
      concatenation [224,232] "*.[1357]"
        word [224,226] "*."
        word [226,227] "["
        number [227,231] "1357"
        word [231,232] "]"
      ()) [232,233] ")"
      command [238,245] "exit $?"
        command_name [238,242] "exit"
          word [238,242] "exit"
        simple_expansion [243,245] "$?"
          ($) [243,244] "$"
          special_variable_name [244,245] "?"
      (;;) [250,252] ";;"
    (esac) [253,257] "esac"
  case_statement [259,289] "case x in x) echo meow ;; esac"
    (case) [259,263] "case"
    word [264,265] "x"
    (in) [266,268] "in"
    case_item [269,284] "x) echo meow ;;"
      word [269,270] "x"
      ()) [270,271] ")"
      command [272,281] "echo meow"
        command_name [272,276] "echo"
          word [272,276] "echo"
        word [277,281] "meow"
      (;;) [282,284] ";;"
    (esac) [285,289] "esac"
  case_statement [291,324] "case foo in\n  bar\\ baz) : ;;\nesac"
    (case) [291,295] "case"
    word [296,299] "foo"
    (in) [300,302] "in"
    case_item [305,319] "bar\\ baz) : ;;"
      word [305,313] "bar\\ baz"
      ()) [313,314] ")"
      command [315,316] ":"
        command_name [315,316] ":"
          word [315,316] ":"
      (;;) [317,319] ";;"
    (esac) [320,324] "esac"
  case_statement [326,376] "case \"$arg\" in\n  *([0-9])([0-9])) ech..."
    (case) [326,330] "case"
    string [331,337] "\"$arg\""
      (") [331,332] "\""
      simple_expansion [332,336] "$arg"
        ($) [332,333] "$"
        variable_name [333,336] "arg"
      (") [336,337] "\""
    (in) [338,340] "in"
    case_item [343,372] "*([0-9])([0-9])) echo \"$arg\"\n"
      extglob_pattern [343,358] "*([0-9])([0-9])"
      ()) [358,359] ")"
      command [360,371] "echo \"$arg\""
        command_name [360,364] "echo"
          word [360,364] "echo"
        string [365,371] "\"$arg\""
          (") [365,366] "\""
          simple_expansion [366,370] "$arg"
            ($) [366,367] "$"
            variable_name [367,370] "arg"
          (") [370,371] "\""
    (esac) [372,376] "esac"
  case_statement [378,478] "case ${lang} in\nCMakeLists.txt | \\\n\tc..."
    (case) [378,382] "case"
    expansion [383,390] "${lang}"
      (${) [383,385] "${"
      variable_name [385,389] "lang"
      (}) [389,390] "}"
    (in) [391,393] "in"
    case_item [394,446] "CMakeLists.txt | \\\n\tcmake_modules | \\..."
      word [394,408] "CMakeLists.txt"
      (|) [409,410] "|"
      extglob_pattern [414,427] "cmake_modules"
      (|) [428,429] "|"
      concatenation [433,442] "${PN}.pot"
        expansion [433,438] "${PN}"
          (${) [433,435] "${"
          variable_name [435,437] "PN"
          (}) [437,438] "}"
        word [438,442] ".pot"
      ()) [442,443] ")"
      (;;) [444,446] ";;"
    case_item [447,473] "*) rm -r ${lang} || die ;;"
      extglob_pattern [447,448] "*"
      ()) [448,449] ")"
      list [450,470] "rm -r ${lang} || die"
        command [450,463] "rm -r ${lang}"
          command_name [450,452] "rm"
            word [450,452] "rm"
          word [453,455] "-r"
          expansion [456,463] "${lang}"
            (${) [456,458] "${"
            variable_name [458,462] "lang"
            (}) [462,463] "}"
        (||) [464,466] "||"
        command [467,470] "die"
          command_name [467,470] "die"
            word [467,470] "die"
      (;;) [471,473] ";;"
    (esac) [474,478] "esac"
===
@known-diff cfor-compound-assign-negative: corpus statements.txt::C-style for statements
for (( c=1; c<=5; c++ ))
do
  echo $c
done

for (( c=1; c<=5; c++ )) {
	echo $c
}

for (( ; ; ))
do
  echo 'forever'
done

for ((cx = 0; c = $cx / $pf, c < $wc - $k; )); do
		echo "$cx"
done

for (( i = 4;;i--)) ; do echo $i; if (( $i == 0 )); then break; fi; done

# added post-bash-4.2
for (( i = j = k = 1; i % 9 || (j *= -1, $( ((i%9)) || printf " " >&2; echo 0), k++ <= 10); i += j ))
do
printf "$i"
done

echo

( for (( i = j = k = 1; i % 9 || (j *= -1, $( ((i%9)) || printf " " >&2; echo 0), k++ <= 10); i += j ))
do
printf "$i"
done )
---
hasError: false
program [0,542] "for (( c=1; c<=5; c++ ))\ndo\n  echo $c..."
  c_style_for_statement [0,42] "for (( c=1; c<=5; c++ ))\ndo\n  echo $c..."
    (for) [0,3] "for"
    ((() [4,6] "(("
    variable_assignment [7,10] "c=1"
      variable_name [7,8] "c"
      (=) [8,9] "="
      number [9,10] "1"
    (;) [10,11] ";"
    binary_expression [12,16] "c<=5"
      word [12,13] "c"
      (<=) [13,15] "<="
      number [15,16] "5"
    (;) [16,17] ";"
    postfix_expression [18,21] "c++"
      word [18,19] "c"
      (++) [19,21] "++"
    ())) [22,24] "))"
    do_group [25,42] "do\n  echo $c\ndone"
      (do) [25,27] "do"
      command [30,37] "echo $c"
        command_name [30,34] "echo"
          word [30,34] "echo"
        simple_expansion [35,37] "$c"
          ($) [35,36] "$"
          variable_name [36,37] "c"
      (done) [38,42] "done"
  c_style_for_statement [44,81] "for (( c=1; c<=5; c++ )) {\n\techo $c\n}"
    (for) [44,47] "for"
    ((() [48,50] "(("
    variable_assignment [51,54] "c=1"
      variable_name [51,52] "c"
      (=) [52,53] "="
      number [53,54] "1"
    (;) [54,55] ";"
    binary_expression [56,60] "c<=5"
      word [56,57] "c"
      (<=) [57,59] "<="
      number [59,60] "5"
    (;) [60,61] ";"
    postfix_expression [62,65] "c++"
      word [62,63] "c"
      (++) [63,65] "++"
    ())) [66,68] "))"
    compound_statement [69,81] "{\n\techo $c\n}"
      ({) [69,70] "{"
      command [72,79] "echo $c"
        command_name [72,76] "echo"
          word [72,76] "echo"
        simple_expansion [77,79] "$c"
          ($) [77,78] "$"
          variable_name [78,79] "c"
      (}) [80,81] "}"
  c_style_for_statement [83,121] "for (( ; ; ))\ndo\n  echo 'forever'\ndone"
    (for) [83,86] "for"
    ((() [87,89] "(("
    (;) [90,91] ";"
    (;) [92,93] ";"
    ())) [94,96] "))"
    do_group [97,121] "do\n  echo 'forever'\ndone"
      (do) [97,99] "do"
      command [102,116] "echo 'forever'"
        command_name [102,106] "echo"
          word [102,106] "echo"
        raw_string [107,116] "'forever'"
      (done) [117,121] "done"
  c_style_for_statement [123,190] "for ((cx = 0; c = $cx / $pf, c < $wc ..."
    (for) [123,126] "for"
    ((() [127,129] "(("
    variable_assignment [129,135] "cx = 0"
      variable_name [129,131] "cx"
      (=) [132,133] "="
      number [134,135] "0"
    (;) [135,136] ";"
    variable_assignment [137,150] "c = $cx / $pf"
      variable_name [137,138] "c"
      (=) [139,140] "="
      binary_expression [141,150] "$cx / $pf"
        simple_expansion [141,144] "$cx"
          ($) [141,142] "$"
          variable_name [142,144] "cx"
        (/) [145,146] "/"
        simple_expansion [147,150] "$pf"
          ($) [147,148] "$"
          variable_name [148,150] "pf"
    (,) [150,151] ","
    binary_expression [152,164] "c < $wc - $k"
      word [152,153] "c"
      (<) [154,155] "<"
      binary_expression [156,164] "$wc - $k"
        simple_expansion [156,159] "$wc"
          ($) [156,157] "$"
          variable_name [157,159] "wc"
        (-) [160,161] "-"
        simple_expansion [162,164] "$k"
          ($) [162,163] "$"
          variable_name [163,164] "k"
    (;) [164,165] ";"
    ())) [166,168] "))"
    (;) [168,169] ";"
    do_group [170,190] "do\n\t\techo \"$cx\"\ndone"
      (do) [170,172] "do"
      command [175,185] "echo \"$cx\""
        command_name [175,179] "echo"
          word [175,179] "echo"
        string [180,185] "\"$cx\""
          (") [180,181] "\""
          simple_expansion [181,184] "$cx"
            ($) [181,182] "$"
            variable_name [182,184] "cx"
          (") [184,185] "\""
      (done) [186,190] "done"
  c_style_for_statement [192,264] "for (( i = 4;;i--)) ; do echo $i; if ..."
    (for) [192,195] "for"
    ((() [196,198] "(("
    variable_assignment [199,204] "i = 4"
      variable_name [199,200] "i"
      (=) [201,202] "="
      number [203,204] "4"
    (;) [204,205] ";"
    (;) [205,206] ";"
    postfix_expression [206,209] "i--"
      word [206,207] "i"
      (--) [207,209] "--"
    ())) [209,211] "))"
    (;) [212,213] ";"
    do_group [214,264] "do echo $i; if (( $i == 0 )); then br..."
      (do) [214,216] "do"
      command [217,224] "echo $i"
        command_name [217,221] "echo"
          word [217,221] "echo"
        simple_expansion [222,224] "$i"
          ($) [222,223] "$"
          variable_name [223,224] "i"
      (;) [224,225] ";"
      if_statement [226,258] "if (( $i == 0 )); then break; fi"
        (if) [226,228] "if"
        command [229,242] "(( $i == 0 ))"
          command_name [229,242] "(( $i == 0 ))"
            arithmetic_expansion [229,242] "(( $i == 0 ))"
              ((() [229,231] "(("
              binary_expression [232,239] "$i == 0"
                simple_expansion [232,234] "$i"
                  ($) [232,233] "$"
                  variable_name [233,234] "i"
                (==) [235,237] "=="
                number [238,239] "0"
              ())) [240,242] "))"
        (;) [242,243] ";"
        (then) [244,248] "then"
        command [249,254] "break"
          command_name [249,254] "break"
            word [249,254] "break"
        (;) [254,255] ";"
        (fi) [256,258] "fi"
      (;) [258,259] ";"
      (done) [260,264] "done"
  comment [266,287] "# added post-bash-4.2"
  c_style_for_statement [288,409] "for (( i = j = k = 1; i % 9 || (j *= ..."
    (for) [288,291] "for"
    ((() [292,294] "(("
    variable_assignment [295,308] "i = j = k = 1"
      variable_name [295,296] "i"
      (=) [297,298] "="
      variable_assignment [299,308] "j = k = 1"
        variable_name [299,300] "j"
        (=) [301,302] "="
        variable_assignment [303,308] "k = 1"
          variable_name [303,304] "k"
          (=) [305,306] "="
          number [307,308] "1"
    (;) [308,309] ";"
    binary_expression [310,378] "i % 9 || (j *= -1, $( ((i%9)) || prin..."
      binary_expression [310,315] "i % 9"
        word [310,311] "i"
        (%) [312,313] "%"
        number [314,315] "9"
      (||) [316,318] "||"
      parenthesized_expression [319,378] "(j *= -1, $( ((i%9)) || printf \" \" >&..."
        (() [319,320] "("
        binary_expression [320,327] "j *= -1"
          word [320,321] "j"
          (*=) [322,324] "*="
          unary_expression [325,327] "-1"
            (-) [325,326] "-"
            number [326,327] "1"
        (,) [327,328] ","
        command_substitution [329,366] "$( ((i%9)) || printf \" \" >&2; echo 0)"
          ($() [329,331] "$("
          list [332,357] "((i%9)) || printf \" \" >&2"
            command [332,339] "((i%9))"
              command_name [332,339] "((i%9))"
                arithmetic_expansion [332,339] "((i%9))"
                  ((() [332,334] "(("
                  binary_expression [334,337] "i%9"
                    variable_name [334,335] "i"
                    (%) [335,336] "%"
                    number [336,337] "9"
                  ())) [337,339] "))"
            (||) [340,342] "||"
            redirected_statement [343,357] "printf \" \" >&2"
              command [343,353] "printf \" \""
                command_name [343,349] "printf"
                  word [343,349] "printf"
                string [350,353] "\" \""
                  (") [350,351] "\""
                  string_content [351,352] " "
                  (") [352,353] "\""
              file_redirect [354,357] ">&2"
                (>&) [354,356] ">&"
                number [356,357] "2"
          (;) [357,358] ";"
          command [359,365] "echo 0"
            command_name [359,363] "echo"
              word [359,363] "echo"
            number [364,365] "0"
          ()) [365,366] ")"
        (,) [366,367] ","
        binary_expression [368,377] "k++ <= 10"
          postfix_expression [368,371] "k++"
            word [368,369] "k"
            (++) [369,371] "++"
          (<=) [372,374] "<="
          number [375,377] "10"
        ()) [377,378] ")"
    (;) [378,379] ";"
    binary_expression [380,386] "i += j"
      word [380,381] "i"
      (+=) [382,384] "+="
      word [385,386] "j"
    ())) [387,389] "))"
    do_group [390,409] "do\nprintf \"$i\"\ndone"
      (do) [390,392] "do"
      command [393,404] "printf \"$i\""
        command_name [393,399] "printf"
          word [393,399] "printf"
        string [400,404] "\"$i\""
          (") [400,401] "\""
          simple_expansion [401,403] "$i"
            ($) [401,402] "$"
            variable_name [402,403] "i"
          (") [403,404] "\""
      (done) [405,409] "done"
  command [411,415] "echo"
    command_name [411,415] "echo"
      word [411,415] "echo"
  subshell [417,542] "( for (( i = j = k = 1; i % 9 || (j *..."
    (() [417,418] "("
    c_style_for_statement [419,540] "for (( i = j = k = 1; i % 9 || (j *= ..."
      (for) [419,422] "for"
      ((() [423,425] "(("
      variable_assignment [426,439] "i = j = k = 1"
        variable_name [426,427] "i"
        (=) [428,429] "="
        variable_assignment [430,439] "j = k = 1"
          variable_name [430,431] "j"
          (=) [432,433] "="
          variable_assignment [434,439] "k = 1"
            variable_name [434,435] "k"
            (=) [436,437] "="
            number [438,439] "1"
      (;) [439,440] ";"
      binary_expression [441,509] "i % 9 || (j *= -1, $( ((i%9)) || prin..."
        binary_expression [441,446] "i % 9"
          word [441,442] "i"
          (%) [443,444] "%"
          number [445,446] "9"
        (||) [447,449] "||"
        parenthesized_expression [450,509] "(j *= -1, $( ((i%9)) || printf \" \" >&..."
          (() [450,451] "("
          binary_expression [451,458] "j *= -1"
            word [451,452] "j"
            (*=) [453,455] "*="
            unary_expression [456,458] "-1"
              (-) [456,457] "-"
              number [457,458] "1"
          (,) [458,459] ","
          command_substitution [460,497] "$( ((i%9)) || printf \" \" >&2; echo 0)"
            ($() [460,462] "$("
            list [463,488] "((i%9)) || printf \" \" >&2"
              command [463,470] "((i%9))"
                command_name [463,470] "((i%9))"
                  arithmetic_expansion [463,470] "((i%9))"
                    ((() [463,465] "(("
                    binary_expression [465,468] "i%9"
                      variable_name [465,466] "i"
                      (%) [466,467] "%"
                      number [467,468] "9"
                    ())) [468,470] "))"
              (||) [471,473] "||"
              redirected_statement [474,488] "printf \" \" >&2"
                command [474,484] "printf \" \""
                  command_name [474,480] "printf"
                    word [474,480] "printf"
                  string [481,484] "\" \""
                    (") [481,482] "\""
                    string_content [482,483] " "
                    (") [483,484] "\""
                file_redirect [485,488] ">&2"
                  (>&) [485,487] ">&"
                  number [487,488] "2"
            (;) [488,489] ";"
            command [490,496] "echo 0"
              command_name [490,494] "echo"
                word [490,494] "echo"
              number [495,496] "0"
            ()) [496,497] ")"
          (,) [497,498] ","
          binary_expression [499,508] "k++ <= 10"
            postfix_expression [499,502] "k++"
              word [499,500] "k"
              (++) [500,502] "++"
            (<=) [503,505] "<="
            number [506,508] "10"
          ()) [508,509] ")"
      (;) [509,510] ";"
      binary_expression [511,517] "i += j"
        word [511,512] "i"
        (+=) [513,515] "+="
        word [516,517] "j"
      ())) [518,520] "))"
      do_group [521,540] "do\nprintf \"$i\"\ndone"
        (do) [521,523] "do"
        command [524,535] "printf \"$i\""
          command_name [524,530] "printf"
            word [524,530] "printf"
          string [531,535] "\"$i\""
            (") [531,532] "\""
            simple_expansion [532,534] "$i"
              ($) [532,533] "$"
              variable_name [533,534] "i"
            (") [534,535] "\""
        (done) [536,540] "done"
    ()) [541,542] ")"
===
===
@known-diff case-short-option-pattern: corpus statements.txt::Test command paren statefulness with a case glob
[[ ${test} == @($(IFS='|'; echo "${skip[*]}")) ]]

case ${out} in
*"not supported"*|\
*"operation not supported"*)
	;;
esac

case $1 in
-o)
	owner=$2
	shift
	;;
-g) ;;
esac

[[ a == \"+(?)\" ]]
---
hasError: false
program [0,193] "[[ ${test} == @($(IFS='|'; echo \"${sk..."
  test_command [0,49] "[[ ${test} == @($(IFS='|'; echo \"${sk..."
    ([[) [0,2] "[["
    binary_expression [3,46] "${test} == @($(IFS='|'; echo \"${skip[..."
      expansion [3,10] "${test}"
        (${) [3,5] "${"
        variable_name [5,9] "test"
        (}) [9,10] "}"
      (==) [11,13] "=="
      extglob_pattern [14,16] "@("
      command_substitution [16,45] "$(IFS='|'; echo \"${skip[*]}\")"
        ($() [16,18] "$("
        variable_assignment [18,25] "IFS='|'"
          variable_name [18,21] "IFS"
          (=) [21,22] "="
          raw_string [22,25] "'|'"
        (;) [25,26] ";"
        command [27,44] "echo \"${skip[*]}\""
          command_name [27,31] "echo"
            word [27,31] "echo"
          string [32,44] "\"${skip[*]}\""
            (") [32,33] "\""
            expansion [33,43] "${skip[*]}"
              (${) [33,35] "${"
              subscript [35,42] "skip[*]"
                variable_name [35,39] "skip"
                ([) [39,40] "["
                word [40,41] "*"
                (]) [41,42] "]"
              (}) [42,43] "}"
            (") [43,44] "\""
        ()) [44,45] ")"
      extglob_pattern [45,46] ")"
    (]]) [47,49] "]]"
  case_statement [51,123] "case ${out} in\n*\"not supported\"*|\\\n*\"..."
    (case) [51,55] "case"
    expansion [56,62] "${out}"
      (${) [56,58] "${"
      variable_name [58,61] "out"
      (}) [61,62] "}"
    (in) [63,65] "in"
    case_item [66,118] "*\"not supported\"*|\\\n*\"operation not s..."
      extglob_pattern [66,67] "*"
      string [67,82] "\"not supported\""
        (") [67,68] "\""
        string_content [68,81] "not supported"
        (") [81,82] "\""
      extglob_pattern [82,83] "*"
      (|) [83,84] "|"
      concatenation [86,113] "*\"operation not supported\"*"
        word [86,87] "*"
        string [87,112] "\"operation not supported\""
          (") [87,88] "\""
          string_content [88,111] "operation not supported"
          (") [111,112] "\""
        word [112,113] "*"
      ()) [113,114] ")"
      (;;) [116,118] ";;"
    (esac) [119,123] "esac"
  case_statement [125,172] "case $1 in\n-o)\n\towner=$2\n\tshift\n\t;;\n-..."
    (case) [125,129] "case"
    simple_expansion [130,132] "$1"
      ($) [130,131] "$"
      variable_name [131,132] "1"
    (in) [133,135] "in"
    case_item [136,160] "-o)\n\towner=$2\n\tshift\n\t;;"
      word [136,138] "-o"
      ()) [138,139] ")"
      variable_assignment [141,149] "owner=$2"
        variable_name [141,146] "owner"
        (=) [146,147] "="
        simple_expansion [147,149] "$2"
          ($) [147,148] "$"
          variable_name [148,149] "2"
      command [151,156] "shift"
        command_name [151,156] "shift"
          word [151,156] "shift"
      (;;) [158,160] ";;"
    case_item [161,167] "-g) ;;"
      word [161,163] "-g"
      ()) [163,164] ")"
      (;;) [165,167] ";;"
    (esac) [168,172] "esac"
  test_command [174,193] "[[ a == \\\"+(?)\\\" ]]"
    ([[) [174,176] "[["
    binary_expression [177,190] "a == \\\"+(?)\\\""
      word [177,178] "a"
      (==) [179,181] "=="
      extglob_pattern [182,190] "\\\"+(?)\\\""
    (]]) [191,193] "]]"

===
@known-diff dollar-backtick-substitution: corpus statements.txt::Command substution with $ and backticks
$(eval echo $`echo ${foo}`)
---
hasError: false
program [0,27] "$(eval echo $`echo ${foo}`)"
  command [0,27] "$(eval echo $`echo ${foo}`)"
    command_name [0,27] "$(eval echo $`echo ${foo}`)"
      command_substitution [0,27] "$(eval echo $`echo ${foo}`)"
        ($() [0,2] "$("
        command [2,26] "eval echo $`echo ${foo}`"
          command_name [2,6] "eval"
            word [2,6] "eval"
          word [7,11] "echo"
          concatenation [12,26] "$`echo ${foo}`"
            ($) [12,13] "$"
            command_substitution [13,26] "`echo ${foo}`"
              (`) [13,14] "`"
              command [14,25] "echo ${foo}"
                command_name [14,18] "echo"
                  word [14,18] "echo"
                expansion [19,25] "${foo}"
                  (${) [19,21] "${"
                  variable_name [21,24] "foo"
                  (}) [24,25] "}"
              (`) [25,26] "`"
        ()) [26,27] ")"
===
===
