colis-anr / morbig

A static parser for POSIX Shell
Other
192 stars 8 forks source link

Morbig accepts unclosed backquotes in here documents and doesn't give them any word CST #93

Closed Niols closed 5 years ago

Niols commented 5 years ago

The following script:

cat <<EOF
(this `(is some) lisp)
EOF

should probably (I'm not sure) be rejected because of the backquote in the here document that is unclosed. Dash rejects it while Morbig accepts it.

Also, there does not seem to be any word CST for this here document!

[
  "IoRedirect_IoHere",
  [
    "IoHere_DLess_HereEnd",
    [
      "HereEnd_Word",
      [ "Word", "EOF", [ [ "WordName", "EOF" ] ] ]
    ],
    [ "Word", "(ceci `(est du) lisp)\n", [] ]
  ]
]