language-bash icon indicating copy to clipboard operation
language-bash copied to clipboard

Parse and pretty-print Bash shell scripts

Results 16 language-bash issues
Sort by recently updated
recently updated
newest added

It would be useful for me if comments were put in the AST in a "Comment" construct (I plan to translate them into Comments in my new language).

I use language-bash in ghcup to parse variable assignments from files like `/etc/os-release`: https://gitlab.haskell.org/haskell/ghcup-hs/-/blob/master/lib/GHCup/Utils/Bash.hs This works relatively well, but when I profile ghcup on the simplest command `ghcup list`, I...

Megaparsec is more actively maintained, and will give us better error messages

https://hackage.haskell.org/package/language-bash-0.9.0/docs/Language-Bash-Parse.html#v:parse is only String. That is really unfortunate. String is both a weird (not even UTF-8) format and is unefficient. I generally don't use it at all. Nothing else from...

I tried to get all top-level assignments and ended up with: ```hs extractAssignments :: List -> [Assign] extractAssignments (List stms) = join $ fmap getAssign $ getCommands stms where getCommands...

QuickCheck found this in [this job](https://travis-ci.org/knrafto/language-bash/jobs/162677842) ``` Tests Properties brace expansion: FAIL (0.08s) *** Failed! Assertion failed (after 56 tests): "\\}\\,,{y}{\\{\\ }\\}{}\\}s\\ p\\{\\},\\,lhhiq\\,qv}{}\\},}\\}\\ \\,{\\}\\ \\{a\\ \\,\\,z\\,t" Use --quickcheck-replay '55 TFGenR...

e.g. ``` echo 'foo' | cat ``` Right now we can't handle a newline after `|`.

It would be nice if we had `Monoid` and `Semigroup` instances for the `List` type.

Consider the following here document: Heredoc Here "EOF" False (stringToWord "here document") If pretty printed it looks like that:

Looks like arithmetic becomes an `ArithSubst String`, and it isn't parsed any further. What's the plan there? Should I instead try to parse the arithmetic strings as C?