Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ nix fmt # format Nix sources (treefmt)
Tests live in `t/` and run under
[cl-weave](https://github.com/nerima-lisp/cl-weave), the org's test framework;
parser-table invariants are additionally checked as executable
[cl-prolog](https://github.com/nerima-lisp/cl-prolog) queries. The suite also
[cl-prolog-kit](https://github.com/nerima-lisp/cl-prolog-kit) queries. The suite also
runs from a raw checkout without Nix:

```sh
Expand Down
4 changes: 2 additions & 2 deletions cl-parser-kit.asd
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
:source-control (:git "https://github.com/nerima-lisp/cl-parser-kit.git")
;; DEPENDENCY_POLICY.md places this package at L1 (general-purpose
;; utility): the runtime system depends on nothing outside the standard.
;; cl-weave and cl-prolog are test-only and belong to cl-parser-kit/test.
;; cl-weave and cl-prolog-kit are test-only and belong to cl-parser-kit/test.
:depends-on ()
:pathname "src"
:serial t
Expand Down Expand Up @@ -67,7 +67,7 @@
:homepage "https://github.com/nerima-lisp/cl-parser-kit"
:bug-tracker "https://github.com/nerima-lisp/cl-parser-kit/issues"
:source-control (:git "https://github.com/nerima-lisp/cl-parser-kit.git")
:depends-on ("cl-parser-kit" "cl-weave" "cl-prolog/weave")
:depends-on ("cl-parser-kit" "cl-weave" "cl-prolog-kit/weave")
:pathname "t"
:serial t
:components
Expand Down
8 changes: 4 additions & 4 deletions docs/src/getting-started.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# Getting Started

The library system (`cl-parser-kit`) has **no runtime dependencies** — only
the test system (`cl-parser-kit-test`) pulls in `cl-weave` and `cl-prolog`.
the test system (`cl-parser-kit-test`) pulls in `cl-weave` and `cl-prolog-kit`.
Loading it into an application never drags in the test tooling.

## ASDF
Expand Down Expand Up @@ -56,11 +56,11 @@ To load the repository test system explicitly:
(asdf:load-system :cl-parser-kit-test)
```

The test system depends on `cl-weave` and `cl-prolog`, which are not
The test system depends on `cl-weave` and `cl-prolog-kit`, which are not
distributed through Quicklisp/Ultralisp; the Nix dev shell (`nix develop`)
and `nix flake check` resolve the pinned versions automatically. Outside
Nix, make matching checkouts of [`cl-weave`](https://github.com/nerima-lisp/cl-weave)
and [`cl-prolog`](https://github.com/nerima-lisp/cl-prolog) discoverable by
and [`cl-prolog-kit`](https://github.com/nerima-lisp/cl-prolog-kit) discoverable by
ASDF (see [`scripts/bootstrap.lisp`](https://github.com/nerima-lisp/cl-parser-kit/blob/main/scripts/bootstrap.lisp)
for the exact roots it expects). Running the library itself never requires
these.
Expand All @@ -73,7 +73,7 @@ From a repository checkout on a supported system, run the full suite with:
nix flake check
```

This resolves the pinned `cl-weave` and `cl-prolog` test dependencies, runs
This resolves the pinned `cl-weave` and `cl-prolog-kit` test dependencies, runs
the full suite, generates the coverage report, and checks Lisp structure
with `paredit-cli`.

Expand Down
6 changes: 3 additions & 3 deletions docs/src/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ usable. The current codebase includes:
- exported resource-limit specials so hostile input fails gracefully instead
of exhausting memory or the control stack
- a test system wired into `asdf:test-system`, with parser-table invariants
additionally checked as executable `cl-prolog/weave` queries
additionally checked as executable `cl-prolog-kit/weave` queries
- runnable examples under `examples/`, regression-tested as user-facing
workflows

Expand Down Expand Up @@ -137,11 +137,11 @@ The [flake.nix](https://github.com/nerima-lisp/cl-parser-kit/blob/main/flake.nix
at the repository root packages `cl-parser-kit` as a Nix flake:

- `nix develop` — a devShell with SBCL and Perl, with `CL_PARSER_KIT_CL_WEAVE_ROOT`
and `CL_PARSER_KIT_CL_PROLOG_ROOT` pre-wired to the pinned test dependencies,
and `CL_PARSER_KIT_CL_PROLOG_KIT_ROOT` pre-wired to the pinned test dependencies,
and [`paredit-cli`](https://github.com/nerima-lisp/paredit-cli) for structural
S-expression lint checks.
- `nix flake check` — the full reproducible CI gate: the library package
build, the `cl-weave`/`cl-prolog` test suite, the 90%/80% coverage gate,
build, the `cl-weave`/`cl-prolog-kit` test suite, the 90%/80% coverage gate,
`paredit-lint`, the `nixfmt` formatting gate, and the `--strict` docs
build, for `x86_64-linux`, `aarch64-linux`, and `aarch64-darwin`.
- `nix build .#docs` — builds this documentation site with MkDocs (Material)
Expand Down
4 changes: 2 additions & 2 deletions docs/src/project/development.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,11 +45,11 @@ Tests live in `t/` and run under
`scripts/bootstrap.lisp` loads the project and its two test dependencies by
reading the `.asd` forms directly, so the suite runs from a raw checkout
without an ASDF source registry. Point it at the dependencies either by placing
`cl-weave` and `cl-prolog` next to this checkout, or by setting:
`cl-weave` and `cl-prolog-kit` next to this checkout, or by setting:

```sh
export CL_PARSER_KIT_CL_WEAVE_ROOT=/path/to/cl-weave
export CL_PARSER_KIT_CL_PROLOG_ROOT=/path/to/cl-prolog
export CL_PARSER_KIT_CL_PROLOG_KIT_ROOT=/path/to/cl-prolog-kit

sbcl --script run-tests.lisp
```
Expand Down
2 changes: 1 addition & 1 deletion docs/src/reference/api.md
Original file line number Diff line number Diff line change
Expand Up @@ -627,7 +627,7 @@ AST and CST helpers keep tree-shaped output simple and explicit.

## Testing

The repository test system runs on `cl-weave`, with `cl-prolog/weave`
The repository test system runs on `cl-weave`, with `cl-prolog-kit/weave`
providing declarative contract checks for parser behavior.

- primary entry point: `asdf:test-system "cl-parser-kit-test"`
Expand Down
20 changes: 10 additions & 10 deletions flake.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

30 changes: 15 additions & 15 deletions flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
inputs.nixpkgs.follows = "nixpkgs";
};

# cl-weave and cl-prolog are the test-only dependencies of the
# cl-weave and cl-prolog-kit are the test-only dependencies of the
# `cl-parser-kit/test` system (see cl-parser-kit.asd `:depends-on`).
#
# Both are full flakes now, where they used to be `flake = false` source
Expand All @@ -49,8 +49,8 @@
inputs.paredit-cli.follows = "paredit-cli";
inputs.treefmt-nix.follows = "treefmt-nix";
};
cl-prolog = {
url = "github:nerima-lisp/cl-prolog/v1.4.3";
cl-prolog-kit = {
url = "github:nerima-lisp/cl-prolog-kit/v1.5.0";
inputs.nixpkgs.follows = "nixpkgs";
inputs.cl-weave.follows = "cl-weave";
inputs.paredit-cli.follows = "paredit-cli";
Expand Down Expand Up @@ -82,7 +82,7 @@
nixpkgs,
cl-nix-forge,
cl-weave,
cl-prolog,
cl-prolog-kit,
paredit-cli,
treefmt-nix,
}:
Expand All @@ -105,32 +105,32 @@
# cl-weave as an ASDF SYSTEM, for `lispCheckDependencies`.
#
# Taken straight off the flake rather than rebuilt from its source with
# `lispDerivation`, which is what cl-json-kit and cl-prolog still do:
# `lispDerivation`, which is what cl-json-kit and cl-prolog-kit still do:
# v1.1.0 is migrated, so `packages.<system>.cl-weave` IS the
# registry-composable ASDF system. (`packages.default` is a different
# thing -- the delivered CLI binary -- and is not what belongs here.)
clWeaveSystem = ctx: cl-weave.packages.${ctx.system}.cl-weave;

# cl-prolog as an ASDF SYSTEM. Built from the input's source because
# cl-prolog-kit as an ASDF SYSTEM. Built from the input's source because
# v1.1.0 predates its own migration: it has no `cl-nix-forge` input at
# all, so there is no `packages.cl-prolog` attribute to consume.
# all, so there is no `packages.cl-prolog-kit` attribute to consume.
#
# `cl-prolog/weave` and not `cl-prolog`: that is the system
# `cl-prolog-kit/weave` and not `cl-prolog-kit`: that is the system
# cl-parser-kit.asd names, so building it is what validates the thing
# actually needed. The derivation still carries the whole source tree,
# so the other systems in the same .asd stay resolvable.
clPrologSystem =
ctx:
ctx.cl.lispDerivation {
pname = "cl-prolog";
version = ctx.cl.fromAsdSystem "${cl-prolog}/cl-prolog.asd";
src = cl-prolog;
lispSystem = "cl-prolog/weave";
pname = "cl-prolog-kit";
version = ctx.cl.fromAsdSystem "${cl-prolog-kit}/cl-prolog-kit.asd";
src = cl-prolog-kit;
lispSystem = "cl-prolog-kit/weave";
lispDependencies = [ (clWeaveSystem ctx) ];
};

# scripts/bootstrap.lisp does NOT use `asdf:load-system` for cl-weave
# and cl-prolog: it reads their `.asd` `defsystem` forms and `load`s the
# and cl-prolog-kit: it reads their `.asd` `defsystem` forms and `load`s the
# listed source files itself. So it never consults CL_SOURCE_REGISTRY,
# and cl-nix-forge composing that registry transitively -- correct as it
# is, and what makes `lispCheckDependencies` above worth declaring --
Expand All @@ -147,7 +147,7 @@
# gain -- bootstrap loads `.lisp` files, never fasls.
dependencyRoots = {
CL_PARSER_KIT_CL_WEAVE_ROOT = "${cl-weave}";
CL_PARSER_KIT_CL_PROLOG_ROOT = "${cl-prolog}";
CL_PARSER_KIT_CL_PROLOG_KIT_ROOT = "${cl-prolog-kit}";
};

# `nix run .#test`, and through `apps.default` the README's headline
Expand Down Expand Up @@ -320,7 +320,7 @@
treefmt.evalModule = treefmt-nix.lib.evalModule;

# The interactive-only extras, and only those. sbcl, cl-weave and
# cl-prolog all arrive through `inputsFrom` on the derivation the preset
# cl-prolog-kit all arrive through `inputsFrom` on the derivation the preset
# builds this shell from -- the CHECK-ENABLED one, whose `registryPath`
# carries `lispCheckDependencies` -- so naming any of them again here
# would be a second source of truth. Verified with
Expand Down
4 changes: 2 additions & 2 deletions scripts/bootstrap.lisp
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@

(defparameter *test-dependency-specs*
'(("CL_PARSER_KIT_CL_WEAVE_ROOT" "cl-weave" "cl-weave.asd" ("cl-weave"))
("CL_PARSER_KIT_CL_PROLOG_ROOT" "cl-prolog" "cl-prolog.asd"
("cl-prolog" "cl-prolog/weave"))))
("CL_PARSER_KIT_CL_PROLOG_KIT_ROOT" "cl-prolog-kit" "cl-prolog-kit.asd"
("cl-prolog-kit" "cl-prolog-kit/weave"))))

(defun current-project-root ()
*project-root*)
Expand Down
20 changes: 10 additions & 10 deletions t/prolog-contract-test.lisp
Original file line number Diff line number Diff line change
Expand Up @@ -18,21 +18,21 @@
(ecase fixity
(:prefix
(let ((entry (gethash key (pratt-table-prefixes table))))
(cl-prolog:make-clause
(cl-prolog-kit:make-clause
`(operator ,key :prefix
,(cl-parser-kit::pratt-prefix-entry-binding-power entry)
,(cl-parser-kit::pratt-prefix-entry-binding-power entry))
nil)))
(:infix
(let ((entry (gethash key (pratt-table-infixes table))))
(cl-prolog:make-clause
(cl-prolog-kit:make-clause
`(operator ,key :infix
,(cl-parser-kit::pratt-infix-entry-left-binding-power entry)
,(cl-parser-kit::pratt-infix-entry-right-binding-power entry))
nil)))
(:postfix
(let ((entry (gethash key (pratt-table-postfixes table))))
(cl-prolog:make-clause
(cl-prolog-kit:make-clause
`(operator ,key :postfix
,(cl-parser-kit::pratt-postfix-entry-binding-power entry)
,(cl-parser-kit::pratt-postfix-entry-binding-power entry))
Expand All @@ -47,12 +47,12 @@
(%pratt-operator-clause table :bang :postfix)))
(contract-clauses
(list
(cl-prolog:make-clause '(associativity :plus :left) nil)
(cl-prolog:make-clause '(associativity :star :left) nil)
(cl-prolog:make-clause '(precedence-edge :bang :star) nil)
(cl-prolog:make-clause '(precedence-edge :star :plus) nil))))
(cl-prolog-kit:make-clause '(associativity :plus :left) nil)
(cl-prolog-kit:make-clause '(associativity :star :left) nil)
(cl-prolog-kit:make-clause '(precedence-edge :bang :star) nil)
(cl-prolog-kit:make-clause '(precedence-edge :star :plus) nil))))
(let ((rulebase
(cl-prolog:prolog
(cl-prolog-kit:prolog
((higher-priority ?higher ?lower)
(precedence-edge ?higher ?lower))
((higher-priority ?higher ?lower)
Expand All @@ -62,9 +62,9 @@
(operator ?operator :infix ?left-binding ?right-binding)
(associativity ?operator :left)))))
(dolist (clause (append operator-clauses contract-clauses) rulebase)
(cl-prolog:rulebase-insert-clause! rulebase clause)))))
(cl-prolog-kit:rulebase-insert-clause! rulebase clause)))))

(cl-prolog/weave:deftest-queries pratt-relational-contracts
(cl-prolog-kit/weave:deftest-queries pratt-relational-contracts
((%make-pratt-contract-rulebase))
("projects the registered Pratt table as relational data"
(operator ?operator ?fixity ?left ?right)
Expand Down