Files
c2/.github/copilot-instructions.md
T

1.4 KiB
Raw Blame History

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 #includeing 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 Csource-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.

Comitting

Often, the user modifies an interface (typically in a header file), and then asks the agent to update the implementation.

When creating a commit, make sure that both the user's and the agent's modifications are included in the commit.