summaryrefslogtreecommitdiff
path: root/build.zig
diff options
context:
space:
mode:
authorGabriel Schneider <[email protected]>2026-11-20 04:42:01 -0300
committerGabriel Schneider <[email protected]>2026-11-20 04:42:01 -0300
commita403340ec5c90238b136ca85fc64d65809b29a65 (patch)
tree1e5311bd482462ed004157adf9e688a8768daba1 /build.zig
parent403b46922af6e4e2012cd15f5f3f5a5702eef7e7 (diff)
downloadpardes-a403340ec5c90238b136ca85fc64d65809b29a65.tar.gz
pardes-a403340ec5c90238b136ca85fc64d65809b29a65.zip
docs: the manual's library section is a consumer's build.zig lines and what each option selects, as build.zig's head comment says them, word for word (pardes-build-2 item 6): docs/typ/building.typ's "As a library" opens with the head comment's prose and its two shapes (`pardes-syntax` with `.grammars = .minimal`; `pardes-editor` with `.grammars = .none, .editor = true` and a grammar of the program's own), checked line by line against build.zig's `//!` lines; the syntax's table under its own heading, the paragraph after it no longer saying the option a second way; the editor's subsection no longer repeating a dependency line, saying instead what `.grammars = .none` means for it (a program links its grammar's parser and hands it in, as test/consumer does with C's); the head comment's dependency calls one field a line, as the manual's code blocks are, so a page's width holds them; `zig build book site cheatsheet` builds (138/138 steps)
Co-Authored-By: Claude Opus <[email protected]> Claude-Session: https://claude.ai/code/session_016Y9MNBECMWcJD5pdS4SR6T
Diffstat (limited to 'build.zig')
-rw-r--r--build.zig22
1 files changed, 16 insertions, 6 deletions
diff --git a/build.zig b/build.zig
index 7ea167ff..125f4dcc 100644
--- a/build.zig
+++ b/build.zig
@@ -3,15 +3,25 @@
//! builds the editor; docs/typ/building.typ has the rest.
//!
//! A package that depends on pardes is given its syntax, `pardes-syntax`
-//! (core/lib_syntax.zig):
+//! (`core/lib_syntax.zig`):
//!
-//! const pardes = b.dependency("pardes", .{ .target = target, .optimize = optimize, .grammars = .minimal });
+//! const pardes = b.dependency("pardes", .{
+//! .target = target,
+//! .optimize = optimize,
+//! .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:
+//! 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 });
+//! 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
@@ -22,7 +32,7 @@
//! 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
+//! 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.
const std = @import("std");