diff options
| author | eunhhu <[email protected]> | 2026-09-25 12:09:41 +0100 |
|---|---|---|
| committer | eunhhu <[email protected]> | 2026-09-25 12:09:41 +0100 |
| commit | a2a430f6c2d973232a4e995133b372ba877558cf (patch) | |
| tree | f1e22521ba03ff4683737131eec0af05e6e0cbd4 /prototypes/connections/Makefile | |
| parent | 08056bb65bb9d1cfa4ccb1cd0b9cb67554d560a3 (diff) | |
| download | pure-a2a430f6c2d973232a4e995133b372ba877558cf.tar.gz pure-a2a430f6c2d973232a4e995133b372ba877558cf.zip | |
Add text states and cursors to Pure modules
Module format v3 adds text states, cursors, UTF-8 constants, text inputs
and text views. A text state is a runtime-owned draft without a store, so a
large text edits as an extent tree. Cursors are byte positions the runtime
keeps on character boundaries: insertion pushes cursors at or after the
point, removal gathers cursors inside the range, and a failed event returns
every text draft and cursor to where it was. The verifier types a cursor by
the text it belongs to and rejects editing one text with another's cursor.
Operations cover constants, concatenation, shortest round-trip number text,
character, line and byte counts, character and column-keeping line moves,
insert, remove, line views, whole-text replacement and UTF-8 checked
conversion from bytes. Replies of edited documents or texts are copied before
they are finished. pure-run gains text input and text output.
test-module covers typing Korean and emoji, moves that stop at the ends,
line moves, views, rollback, invalid UTF-8 and replacement, text-specific
verifier rules, and 20,000 damaged text modules whose cursors always stay
on character boundaries under ASan/UBSan.
Diffstat (limited to 'prototypes/connections/Makefile')
| -rw-r--r-- | prototypes/connections/Makefile | 16 |
1 files changed, 10 insertions, 6 deletions
diff --git a/prototypes/connections/Makefile b/prototypes/connections/Makefile index 7d955f3..34c789d 100644 --- a/prototypes/connections/Makefile +++ b/prototypes/connections/Makefile @@ -116,15 +116,19 @@ $(BUILD)/test-splice: test-splice.c program.c $(CORE) $(HOST) $(HEADERS) | $(BUI $(CC) $(CPPFLAGS) $(CFLAGS) -DPURE_RUNTIME_METRICS -DPURE_STORE_TEST test-splice.c program.c $(CORE) $(HOST) $(LDFLAGS) $(LDLIBS) -o $@ # Pure module format v1: loader/verifier/executor, its tests and a test host. -$(BUILD)/test-module: test-module.c module.c module.h state.h result.h | $(BUILD) - $(CC) $(CPPFLAGS) $(CFLAGS) test-module.c module.c $(LDFLAGS) -lm $(LDLIBS) -o $@ +# Text states are runtime-owned drafts, so the executor links the tree engine. +MODULE = module.c module-text.c store-tree.c +MODULE_HEADERS = module.h module-text.h $(HEADERS) -$(BUILD)/pure-run: pure-run.c module.c module.h result.h | $(BUILD) - $(CC) $(CPPFLAGS) $(CFLAGS) pure-run.c module.c $(LDFLAGS) -lm $(LDLIBS) -o $@ +$(BUILD)/test-module: test-module.c $(MODULE) $(MODULE_HEADERS) | $(BUILD) + $(CC) $(CPPFLAGS) $(CFLAGS) test-module.c $(MODULE) $(LDFLAGS) -lm $(LDLIBS) -o $@ + +$(BUILD)/pure-run: pure-run.c $(MODULE) $(MODULE_HEADERS) | $(BUILD) + $(CC) $(CPPFLAGS) $(CFLAGS) pure-run.c $(MODULE) $(LDFLAGS) -lm $(LDLIBS) -o $@ # The document CLI contract driven by a module on the tree store. -$(BUILD)/pure-edit-module: edit-module.c module.c module-store.c store-tree.c module.h module-store.h $(HEADERS) | $(BUILD) - $(CC) $(CPPFLAGS) $(CFLAGS) edit-module.c module.c module-store.c store-tree.c $(LDFLAGS) -lm $(LDLIBS) -o $@ +$(BUILD)/pure-edit-module: edit-module.c module-store.c $(MODULE) module-store.h $(MODULE_HEADERS) | $(BUILD) + $(CC) $(CPPFLAGS) $(CFLAGS) edit-module.c module-store.c $(MODULE) $(LDFLAGS) -lm $(LDLIBS) -o $@ check-module: $(BUILD)/test-module $(BUILD)/pure-run $(BUILD)/pure-edit-module $(BUILD)/test-module |
