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.
|
||||
|
||||
@@ -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.
|
||||
|
||||
+1
-1
@@ -1 +1 @@
|
||||
bin/
|
||||
/c2
|
||||
|
||||
@@ -14,4 +14,4 @@ In order to run the tests, run `make test`.
|
||||
The current version is v0. Its source code lives in the `v0` directory.
|
||||
|
||||
## Languages Specifications
|
||||
See the specs directory for information on the actual language syntax.
|
||||
See the specs directory for information on the actual language syntax.
|
||||
|
||||
@@ -0,0 +1,9 @@
|
||||
Copilot / contributor instructions for v0
|
||||
|
||||
- When adding new source or test files for v0, do NOT rely on wildcards. Add the file path explicitly to v0/include.mk in either V0_SRC (for library/source files) or V0_TEST (for test files beginning with `test_`).
|
||||
- v0/include.mk is included by the top-level Makefile and is a dependency for object builds. Modifying v0/include.mk will force appropriate recompilation.
|
||||
|
||||
Example:
|
||||
V0_SRC := v0/buffer.c v0/main.c
|
||||
V0_TEST := v0/test.c v0/test_buffer.c
|
||||
|
||||
@@ -0,0 +1,14 @@
|
||||
# General
|
||||
A C2–file starts with a module declaration followed by other declarations.
|
||||
|
||||
For instance:
|
||||
|
||||
```c2
|
||||
module mymodule;
|
||||
|
||||
import libc.stdio;
|
||||
|
||||
void main() {
|
||||
puts("Hello, world!");
|
||||
}
|
||||
```
|
||||
@@ -0,0 +1 @@
|
||||
/bin/
|
||||
Reference in New Issue
Block a user