You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Jan 28, 2022. It is now read-only.
Once the dependencies are installed, you should be able to build the compiler:
stack build
Test
stack test
To run an individual test (e.g., C value test), use:
stack test --ta '-p C value test'
Format
We use brittany. You can format all files (slow) with make fmt.
You can format all files changed since a git-ref REF in a directory using
./scripts/format.bash REF DIR
You can format all files in a directory using
./scripts/format.bash all DIR
The formatting script will not format files which have unstaged changes.
Run
For usage information:
stack exec compiler-exe -- -h
For example, to run function foo in file bar, use:
stack exec compiler-exe c foo bar.c -- --solve
Configuration
There is a configuration system in src/Util/Cfg.hs. You can add new
configuration options there. Configuration options can be set by environmental
variables, like so:
C_cfg_with_underscores_instead_of_dashes=value stack run -- ...
One particularly useful configuration options is C_streams, which enables
logging streams. You can log to named streams using logIf in
src/Util/Log.hs, and the output will only appear if the specified stream is
enabled.