summaryrefslogtreecommitdiff
path: root/docs/typ/building.typ
diff options
context:
space:
mode:
authorGabriel Schneider <[email protected]>2026-11-20 06:33:52 -0300
committerGabriel Schneider <[email protected]>2026-11-20 06:33:53 -0300
commitffe05cceb897b3ae6a6d36491f9318a8aa3426e7 (patch)
tree352414579559060b3e8486af34e29d49fd5df781 /docs/typ/building.typ
parent5b7124d10f9b2db8d1c5e99eacb9b6d2fffff0cc (diff)
parenta403340ec5c90238b136ca85fc64d65809b29a65 (diff)
downloadpardes-ffe05cceb897b3ae6a6d36491f9318a8aa3426e7.tar.gz
pardes-ffe05cceb897b3ae6a6d36491f9318a8aa3426e7.zip
integration: the build's second pass on the handle and the devices once: pardes-build-pass2 (pardes-isolate and the tree-sitter=disabled tier deleted; one option, grammars = none | minimal | full; build.zig with the consumer's lines as its head comment; test/lib -> test/consumer; the manual's library section) and pardes-merge31, merged without a textual conflict; one line follows a deletion: dev/file_watch.zig's end-to-end test of a session's watches (written since on the base) guarded on fs.platform_has_fs, which the first of these changes deleted: the guard reads as the file's other tests' (comptime !supported); tui core-test 857/1008 (151 skipped), shell-test 1048/1051, the window builds; the coordinator's gate in the ledger (reorg/merge32)
Co-Authored-By: Claude Fable 5.2 <[email protected]> Claude-Session: https://claude.ai/code/session_016Y9MNBECMWcJD5pdS4SR6T
Diffstat (limited to 'docs/typ/building.typ')
-rw-r--r--docs/typ/building.typ81
1 files changed, 47 insertions, 34 deletions
diff --git a/docs/typ/building.typ b/docs/typ/building.typ
index 8bfcb85b..d4732fa9 100644
--- a/docs/typ/building.typ
+++ b/docs/typ/building.typ
@@ -60,7 +60,7 @@ must share with its session; `pardes --help` lists every flag.
[`-Dplatform`], [`tui`, `gui`, `macos`; absent: the tui and SDL shells together, installed into `~/.local`],
[`-Dpdf`], [bool: build the pdf addon, fetching MuPDF the first time; default on once MuPDF is fetched, and off Linux],
[`-Djpx`], [bool, `true`: JPEG 2000, and with it scanned PDFs],
- [`-Dtree-sitter`], [`disabled`, `zig`, `minimal`, `full`; `full`],
+ [`-Dgrammars`], [the tree-sitter grammars compiled in: `none` (the runtime alone), `minimal` (C, C++ and Zig) or `full` (all of them; the default)],
[`-Dembed-sources`], [bool, `false`: serve the sources under #file("/src")],
[`-Dhome-install`], [bool: a bare `zig build` also copies the binaries into `~/.local/bin` and the addon steps theirs into `$XDG_DATA_HOME/pardes/addons`, default true; with `-Dplatform` only `true` copies, and the addons alone],
[`-Dstamp-commit`], [bool: the git commit in `--version` and crash records; on for release builds and the `~/.local` install],
@@ -92,23 +92,50 @@ moves an anchor fails that file's step. Each table says why, edit by edit.
== As a library <library>
-A Zig package that depends on pardes is given one module and nothing of
-the editor: `pardes-syntax` (`core/lib_syntax.zig`), for a program that
-draws source text itself and wants it parsed and coloured as pardes has
-it.
+As `build.zig`'s head comment says it, word for word:
+
+A package that depends on pardes is given its syntax, `pardes-syntax`
+(`core/lib_syntax.zig`):
```
-// build.zig.zon
-.pardes = .{ .path = "../pardes" },
-// build.zig
const pardes = b.dependency("pardes", .{
.target = target,
.optimize = optimize,
- .@"tree-sitter" = .minimal,
+ .grammars = .minimal,
});
exe.root_module.addImport("pardes-syntax", pardes.module("pardes-syntax"));
```
+and, when it asks, the text pane, `pardes-editor`
+(`core/lib_editor.zig`), here with a grammar of its own handed in at
+run time:
+
+```
+const pardes = b.dependency("pardes", .{
+ .target = target,
+ .optimize = optimize,
+ .grammars = .none,
+ .editor = true,
+});
+exe.root_module.addImport("pardes-editor", pardes.module("pardes-editor"));
+```
+
+`.grammars`: the tree-sitter grammars compiled in: `none` (the runtime
+alone), `minimal` (C, C++ and Zig) or `full` (all of them; the default).
+`.editor`: exports `pardes-editor` besides `pardes-syntax`, and with it
+fetches uucode, mvzr and vaxis.
+
+Every dependency but tree-sitter's runtime is lazy in the manifest, so
+such a package fetches what it asked for and nothing else.
+`pardes-editor` has `pardes-syntax` in it as `.syntax`: a file belongs
+to one module, so a package imports one of the two. `test/consumer` is
+such a package, with both shapes; `lib-test`, which `unit-test` runs,
+builds and runs it.
+
+`build.zig.zon` names pardes by its path: `.pardes = .{ .path = "../pardes" }`.
+
+=== The syntax
+
It is the editor's own code under the names it has there. A language is
told by a path's extension, as in the editor, and `pathFor` gives a path
for a language's name.
@@ -122,35 +149,21 @@ for a language's name.
[`start`, `stop`], [tree-sitter's allocator, and the end of the parsers kept per language],
)
-The `tree-sitter` option is the build's own: `zig`, `minimal` (C, C++
-and Zig) or `full`, the default. Every dependency but tree-sitter's
-runtime is lazy in the manifest, so the package fetches the runtime and
-its set's grammars and compiles those alone; pardes's own build asks for
-what it is missing in one round. Zig still unpacks a lazy package whose
-archive its global cache already holds; `--pkg-dir` (or `ZIG_LOCAL_PKG_DIR`)
-at pardes's `zig-pkg` shares the one copy. What a pane measures stays
-out: a cell's width is vaxis's and uucode's, and a tab is
-`config.tab_width` cells wherever it stands. `test/lib` is such a
-package, and `zig build lib-test` builds and runs it.
+pardes's own build takes `-Dgrammars` too, and asks for what it is
+missing in one round. Zig still unpacks a lazy package whose archive its
+global cache already holds; `--pkg-dir` (or `ZIG_LOCAL_PKG_DIR`) at
+pardes's `zig-pkg` shares the one copy. What a pane measures stays out: a
+cell's width is vaxis's and uucode's, and a tab is `config.tab_width`
+cells wherever it stands.
=== The editor
`pardes-editor` (`core/lib_editor.zig`) is the text pane as a library:
helix's keys on a text kept in memory, no files, commands, builtins,
-prompts or views. A package asks for it, and is then given uucode, mvzr
-and vaxis's grapheme width besides; one that does not fetches nothing more.
-It has `pardes-syntax` in it as `.syntax`: a file belongs to one module, so
-a package imports one of the two.
-
-```
-const pardes = b.dependency("pardes", .{
- .target = target,
- .optimize = optimize,
- .@"tree-sitter" = .minimal,
- .editor = true,
-});
-exe.root_module.addImport("pardes-editor", pardes.module("pardes-editor"));
-```
+prompts or views. Of vaxis it takes the grapheme width alone. With
+`.grammars = .none` it has no grammar of pardes's: a program hands its
+own in at run time (`Language`, below), linking the grammar's parser
+itself, as `test/consumer` does with C's.
The editor is a value of plain data, `Editor(capacity)`: no pointer, no
allocator, every capacity in its type, so a program keeps it where it
@@ -186,7 +199,7 @@ zig build kitty-harness kitty graphics through a pane end to end (a fake kitt
kitten icat and chafa too when installed)
zig build syntax-test tree-sitter tests without building the editor
zig build syntax deterministic per-byte highlighting snapshots
-zig build lib-test the library, from a package that depends on pardes (test/lib);
+zig build lib-test the library, from a package that depends on pardes (test/consumer);
unit-test runs it too
zig build hxlib helix's cases on the library's editor (-- --parity: against the file pane)
zig build behaviour-test behaviour through the 9P tree, in process (test/behaviour/),