A whole host of stuff

We now have a primitive and not fully tested parser for strings and
symbol sequences.  We record the lines and columns of each object on
the object for better compile time error handling.

I've also structured the code base in a slightly weirder fashion,
which makes my includes look nicer.  I've split up stuff quite a bit
to ensure code units are bit more focused.
This commit is contained in:
2026-01-22 21:25:30 +00:00
parent 4ec6dd8259
commit a977f01a2a
14 changed files with 678 additions and 20 deletions

View File

@@ -1,10 +1,10 @@
CC=cc
DIST=build
OUT=$(DIST)/main.out
OUT=$(DIST)/arl.out
LDFLAGS=
GFLAGS=-Wall -Wextra -Wpedantic -std=c23
GFLAGS=-Wall -Wextra -Wpedantic -std=c23 -I./src/
DFLAGS=-ggdb -fsanitize=address -fsanitize=undefined
RFLAGS=-O3
@@ -15,14 +15,26 @@ else
CFLAGS=$(GFLAGS) $(DFLAGS)
endif
$(OUT): $(DIST)/main.o | $(DIST)
HEADERS=$(shell find "src" -type 'f' -name '*.h')
MODULES=main lib/vec lib/sv parser/ast parser/parser
OBJECTS=$(patsubst %,$(DIST)/%.o, $(MODULES))
$(OUT): $(OBJECTS) | $(DIST)
$(CC) $(CFLAGS) -o $@ $^ $(LDFLAGS)
$(DIST)/main.o: main.c | $(DIST)
$(CC) $(CFLAGS) -c -o $@ $^
$(DIST)/%.o: src/arl/%.c $(HEADERS) | $(DIST)
$(CC) $(CFLAGS) -c -o $@ $<
$(DIST)/%.o: src/arl/parser/%.c $(HEADERS) | $(DIST)
$(CC) $(CFLAGS) -c -o $@ $<
$(DIST)/%.o: src/arl/lib/%.c $(HEADERS) | $(DIST)
$(CC) $(CFLAGS) -c -o $@ $<
$(DIST):
mkdir -p $(DIST)
mkdir -p $(DIST)/lib
mkdir -p $(DIST)/parser
.PHONY: run clean
ARGS=