opam install . --deps-only --with-test
dune build
dune test
dune exec pirc -- [options] <file>
if it has been installed by dune install
you can run it directly:
pirc [options] <file>
E.g.:
cd examples
dune exec pirc -- -ast-dump json 1.pir
pirc -ast-dump json 2.pir
Then pirc
will parse the file and dump the ASTs to the current directory (in pretty-printed format by default).
-
-ast-dump <pprint|json>
: Dump the AST in pretty-printed or JSON format. -
use
-
to read the source code fromstdin
. E.g.:
cat examples/1.pir | dune exec pirc -- -
Tests are added by placing .pir and .ans files in test/test_src, then running dune test
in the root directory. The test runner will compile the .pir
file, run the compiled program, and compare the output to the .ans
file. If the output matches the .ans
file, the test passes.
-
-
Name your branch
<your-names>/<feature>
-
-
-
You can format your code using
dune fmt
-
-
You can enable repo-wide githooks to make sure your code is formatted and can build
chmod +x .githooks/pre-push
git config core.hooksPath .githooks