update skill
This commit is contained in:
@@ -13,11 +13,11 @@ from Zig, copy the Zig structure into C.
|
|||||||
|
|
||||||
## Key files
|
## Key files
|
||||||
|
|
||||||
- `astgen.c` — C implementation (modify this)
|
- `stage0/astgen.c` — C implementation (modify this)
|
||||||
- `astgen_test.zig` — corpus tests (enable/skip tests here)
|
- `stage0/astgen_test.zig` — corpus tests (enable/skip tests here)
|
||||||
- `~/code/zig/lib/std/zig/AstGen.zig` — upstream reference (~14k lines)
|
- `lib/std/zig/AstGen.zig` — upstream reference (~14k lines)
|
||||||
- `~/code/zig/lib/std/zig/Ast.zig` — AST node accessors
|
- `lib/std/zig/Ast.zig` — AST node accessors
|
||||||
- `~/code/zig/lib/std/zig/Zir.zig` — ZIR instruction definitions
|
- `lib/std/zig/Zir.zig` — ZIR instruction definitions
|
||||||
|
|
||||||
## Loop
|
## Loop
|
||||||
|
|
||||||
@@ -39,7 +39,7 @@ Remove or comment out the `if (true) return error.SkipZigTest` line.
|
|||||||
### Step 3: Run tests
|
### Step 3: Run tests
|
||||||
|
|
||||||
```sh
|
```sh
|
||||||
zig build test 2>&1
|
zig build test-zig0 2>&1
|
||||||
```
|
```
|
||||||
|
|
||||||
Record the output. If tests pass, go to Step 7.
|
Record the output. If tests pass, go to Step 7.
|
||||||
@@ -75,7 +75,7 @@ mechanically.
|
|||||||
### Step 6: Port the fix
|
### Step 6: Port the fix
|
||||||
|
|
||||||
Apply the minimal mechanical change to `astgen.c` to match the upstream.
|
Apply the minimal mechanical change to `astgen.c` to match the upstream.
|
||||||
Run `zig build test` after each change to check for progress.
|
Run `zig build test-zig0` after each change to check for progress.
|
||||||
|
|
||||||
**Progress** means any of:
|
**Progress** means any of:
|
||||||
- `inst_len` diff decreased
|
- `inst_len` diff decreased
|
||||||
@@ -92,7 +92,8 @@ continue to Step 7 (commit progress, re-skip).
|
|||||||
a TODO comment describing the remaining diff.
|
a TODO comment describing the remaining diff.
|
||||||
2. Remove ALL `fprintf`/`printf` debug statements from `astgen.c`.
|
2. Remove ALL `fprintf`/`printf` debug statements from `astgen.c`.
|
||||||
3. Remove `#include <stdio.h>` if it was added for debugging.
|
3. Remove `#include <stdio.h>` if it was added for debugging.
|
||||||
4. Verify: `zig build fmt && zig build all` must exit 0 with no unexpected output.
|
4. Verify: `zig build fmt-zig0 && zig build all-zig0 -Dvalgrind` must exit 0
|
||||||
|
with no unexpected output.
|
||||||
5. Commit:
|
5. Commit:
|
||||||
```sh
|
```sh
|
||||||
git add astgen.c astgen_test.zig
|
git add astgen.c astgen_test.zig
|
||||||
|
|||||||
Reference in New Issue
Block a user