Project setup
This commit is contained in:
@@ -1,3 +1,33 @@
|
||||
# C2
|
||||
C2 is a compiler for a new language.
|
||||
See the README.md for information about this project.
|
||||
|
||||
## Code Changes
|
||||
After every code change, ensure the binary builds correctly,
|
||||
and run the unit tests (`make test`).
|
||||
|
||||
Ensure that every new function and code path has useful unit tests.
|
||||
|
||||
### Creating Source Files
|
||||
Whenever a new source file is created, it must be added to the `include.mk` file.
|
||||
A test file should also be created.
|
||||
|
||||
Test source files do not have to be added to the include.mk file.
|
||||
These are added to the `test.c` file by means of directly `#include`ing the C file.
|
||||
|
||||
### Testing
|
||||
Any test source code must be prefixed with test_xyz, where xyz matches
|
||||
the source file it is trying to test.
|
||||
For instance, a test for `buffer.c` must be called `test_buffer.c`.
|
||||
|
||||
There will be no `test_buffer.h`. Instead, `test.c` will directly
|
||||
`#include` the C–source-file directly.
|
||||
|
||||
## Language Syntax
|
||||
Since this is a compiler for a new language, do not assume anything
|
||||
of its syntax.
|
||||
Always check the `specs` directory.
|
||||
|
||||
If there is anything unclear, ask the user for clarification.
|
||||
It is certainly possible that there are contradictions in the
|
||||
spec that have to be solved first.
|
||||
|
||||
Reference in New Issue
Block a user