Project setup

This commit is contained in:
2026-04-24 09:29:53 +02:00
parent c90f3afd95
commit c73f99d9e6
9 changed files with 69 additions and 4 deletions
+30
View File
@@ -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 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.
+9 -1
View File
@@ -2,5 +2,13 @@
name: implement
description: 'Implement all @copilot annotations'
---
# General
Find and implement all `@copilot` comments in the codebase. Modify only code related to those annotations, and always make sure that tests are added.
Find and implement all `@copilot` comments in the codebase. Only modify code related to those annotations. Skip e2e tests unless asked.
## Plan Mode
If you are currently in plan mode, look at all the annotations and always create a plan first.
Only start modifying code once the plan has been approved by the user.
## Implementation
Implement the changes requested at the location of the annotation.
After the implementation is finished, remove the comment containing the annotation.