package morbig

All checked builds pass
  1. Overview
  2. Docs
A trustworthy parser for POSIX shell

Install

dune-project
 Dependency

Authors

Maintainers

Sources

v0.11.0.tar.gz
md5=8829a7d682d7182c3d066b9ee42dec40
sha512=ed3fc21e6e9840a1a11f57cc34e9cd7f767227281c5822dd324f4b583a6ed126a22c9b79f3b3cf7b0dbdf6ff9c065e2ca25984e56aff9bd7f6ca41ec393525f9

Description

Morbig is a parser for shell scripts written in the POSIX shell script language. It parses the scripts statically, that is without executing them, and constructs a concrete syntax tree for each of them. The concrete syntax trees are built using constructors according to the shell grammar of the POSIX standard.

Added to opam-repository:

README

Morbig

A trustworthy static parser for POSIX shell

Morbig is a parser for shell scripts written in the POSIX shell script language. It parses the scripts statically, that is without executing them, and constructs a concrete syntax tree for each of them. The concrete syntax trees are built using constructors according to the shell grammar of the POSIX standard.

Download Build Status

git clone git@github.com:colis-anr/morbig.git

See COPYING.

Documentation

For tagged versions, you can have a look at the official documentation. We also provide custom documentation for the latest development version. Finally, you can always build the documentation yourself with:

make doc

Are you in a hurry?

Yes? Pull our docker image:

docker pull colisanr/morbig:latest

Then, define the following shell function:

    morbig () {
  D=$(cd "$(dirname "$1")"; pwd)
  B=$(basename "$1")
  docker run \
    -v "$D":/mnt \
    colisanr/morbig:latest --as simple /mnt/"$B"
}

After that, you should be able to run Morbig like this:

morbig my-script.sh

This will create a JSON file named my-script.sh.sjson.

You can also build a local docker image from the root of this repository:

docker build -t morbig .

Now if you want to use more features of Morbig, take the time to follow the building instructions of the next section.

Manual instructions

Install using OPAM

Please type

opam install morbig

to get the latest public release of Morbig.

If you want to use the development version of Morbig, read the next sections.

Dependencies

Morbig depends on the following software:

  • dune
  • menhir
  • OCaml ≥ 4.11. Older versions might work but are not officially supported.
  • odoc (for documentation only)
  • yojson and ppx_deriving_yojson
  • visitors

In case of discrepancies on dependencies, dune-project is the source of truth. Our continuous integration ensures that it is up-to-date.

Building

make

Installing

For OPAM-based environments:

make install

For system-wide installs:

PREFIX=... make install

Testing

make check

Dependencies (6)

  1. yojson >= "1.6.0" & < "3.0.0"
  2. visitors >= "20200207"
  3. ppx_deriving_yojson
  4. ocaml >= "4.11"
  5. menhir >= "20200211" & < "20260112"
  6. dune >= "2.5.0"

Dev Dependencies (2)

  1. conf-jq with-test
  2. odoc with-doc

Optional Dependencies

None

Used by

None

Conflicts

None

Build status

Results of building morbig with each compiler on check.ci.ocaml.org, run of against opam-repository 8a77e58. All results for this package.

Each result links to its build log. To keep crawlers from overloading the site, build logs require a GitHub sign-in (see ocurrent/opam-health-check). On your first log, GitHub asks you to “Authorize opam-health-check”, the OCurrent app that runs these checks; it sees only your public profile, not your repositories. The sign-in lasts 30 days.

Version OCaml 4.11 OCaml 4.14 OCaml 5.2 OCaml 5.4 OCaml 5.5
0.11.0 (this version) good good good good good
  • good Package successfully built
  • partial One of the dependencies failed to build
  • bad Package failed to build
  • n/a Package is not available in this environment
  • internal Internal failure