Finish Chapter 16

Implement basic parsing / scanner

Signed-off-by: Daniel Henry <iamdanhenry@gmail.com>
This commit is contained in:
2025-08-22 03:43:08 -05:00
parent 6029f876ac
commit 495545ef22
8 changed files with 427 additions and 48 deletions

View File

@@ -22,20 +22,16 @@ make debug
make bear
```
## Run (current behavior)
The current `main` builds a tiny test chunk and disassembles it—theres no REPL or script runner yet.
## Usage
Run a file
```sh
./bin/clox
clox [file]
```
Example output:
```
== test chunk ==
0000 123 OP_CONSTANT 0 '1.2'
0002 | OP_RETURN
Run Repl
```sh
clox
```
## Layout
@@ -47,12 +43,3 @@ obj/ # build objects (generated)
bin/ # executable output (generated)
```
## Notes
- Tracks the books **clox** implementation; commits may follow chapters.
- `compile_commands.json` can be generated via `make bear` for editor tooling.
## License
Private / for learning.