-
Notifications
You must be signed in to change notification settings - Fork 75
Comparing changes
Open a pull request
base repository: purescript/purescript-strings
base: master
head repository: purescript-lua/purescript-lua-strings
compare: master
- 19 commits
- 44 files changed
- 3 contributors
Commits on Mar 31, 2024
-
Configuration menu - View commit details
-
Copy full SHA for d6ff26a - Browse repository at this point
Copy the full SHA d6ff26aView commit details
Commits on Jun 12, 2026
-
The repo never had the spago-test.dhall that scripts/test refers to, and the package set pins (psc-0.15.15-2024*) predate prelude v7.2.0 (unit = {}) and the assert override. Bump the sets, define the test build on top of spago.dhall, and drop the Regex test wiring: the fork has no Data.String.Regex implementation (tracked separately). The flake inputs were two years stale as well: the pinned pslua predates several codegen fixes; nixpkgs/easyps now match the pins of the main pslua repo (purs-tidy is dropped from the shell - it does not evaluate against the current nixpkgs and nothing in this repo uses it). The prelude package is temporarily overridden with a local clone until the Lua 5.1 compat fixes land in a released package set.Configuration menu - View commit details
-
Copy full SHA for 2edd0e6 - Browse repository at this point
Copy the full SHA 2edd0e6View commit details -
test: split each suite into per-section functions
A single do-block with a hundred statements compiles to Lua nested beyond the parser limit of stock Lua 5.1 interpreters ("chunk has too many syntax levels", purescript-lua/purescript-lua#46). One function per log section keeps the nesting flat. Assertions are unchanged except two byte-semantics adaptations in NonEmpty.CodeUnits: charAt over "5 €" yields the first UTF-8 byte of the euro sign, and the toCharArray case uses an ASCII string because a multi-byte Char literal is not expressible when Char is a byte.Configuration menu - View commit details
-
Copy full SHA for 12679df - Browse repository at this point
Copy the full SHA 12679dfView commit details -
feat: implement Data.String.CodePoints for UTF-8 strings
Closes purescript-lua/purescript-lua#36. In pslua a String is a Lua byte string holding UTF-8, so all seven foreign functions decode/encode UTF-8 directly with plain Lua 5.1 arithmetic (no utf8 library, no bitops). The PureScript fallback arguments are UTF-16 surrogate-pair logic and are ignored: under the byte representation they would produce garbage. The pure uncons carried the same surrogate logic (charAt 0/1 yields bytes here, never in the surrogate range, so it silently returned the first byte as a code point); its tail now starts after the UTF-8 width of the head. The test suite replaces the upstream lone-surrogate string (not representable in UTF-8) with well-formed Unicode of widths 1-4 and keeps its structure; lone-surrogate-specific probes are dropped and toCodePointArray/fromCodePointArray roundtrips are added.
Configuration menu - View commit details
-
Copy full SHA for 644ae9f - Browse repository at this point
Copy the full SHA 644ae9fView commit details -
fix: 0-based indices and literal patterns in CodeUnits and Common
CodeUnits returned 1-based Lua positions where PureScript expects 0-based indices (charAt answered Nothing for index 0, indexOf was off by one, lastIndexOf also ignored the pattern width), and take/slice/ splitAt passed negative indices straight to string.sub, which counts from the end instead of clamping. Index handling now mirrors the upstream JS (indexOf guard, lastIndexOf clamp, slice wrapping). Common.replace/replaceAll/split treated Pattern as a Lua pattern and even applied gsub to the Replacement; PureScript semantics are literal matching, so the rewrite uses string.find in plain mode. replaceAll also no longer leaks gsub's second return value, and split keeps empty fields and multi-character separators.
Configuration menu - View commit details
-
Copy full SHA for f49e9dc - Browse repository at this point
Copy the full SHA f49e9dcView commit details
Commits on Jun 13, 2026
-
fix: byte-accurate uncons tail; cover decode/encode edges
Review follow-up on #1. uncons recomputed the tail offset from the head code point value (utf8Width), but the decoder consumes a single byte for a malformed leading byte (a lone continuation or a truncated multi-byte lead). For those inputs the width disagreed with what was actually read and uncons skipped extra bytes, desynchronising the rest of the string. The tail is now `drop 1`, which is defined via the same native decoder that produces the head, so the two can never disagree; utf8Width is gone. Add direct coverage of the encoder/decoder: round-trips at every UTF-8 width boundary (0x7F/0x80, 0x7FF/0x800, 0xFFFF/0x10000, 0x10FFFF) and malformed input (lone continuation byte between ASCII anchors, and truncated two- and three-byte leads), where the raw bytes are built with CodeUnits.singleton since a string literal would be re-encoded as valid UTF-8.
Configuration menu - View commit details
-
Copy full SHA for 9cd49b8 - Browse repository at this point
Copy the full SHA 9cd49b8View commit details -
chore: build against the released set; nix CI; fix uncons binding cycle
Switch packages.dhall from the local prelude override to the released package set (psc-0.15.15-20260613, which carries prelude v7.2.1), so a fresh clone and CI can build without a sibling checkout. Bump the flake pin of pslua to the merged Char-literal-escaping fix. Replace the inherited bower CI (no bower.json in this fork) with one that runs scripts/test and luacheck in the nix dev shell, and make scripts/test exit non-zero on failure so red tests fail CI. uncons now reaches take (via drop), closing a recursive group with the point-free `take = _take takeFallback`; eta-expand take so every member of the group is a function and purs accepts it.
Configuration menu - View commit details
-
Copy full SHA for 056b535 - Browse repository at this point
Copy the full SHA 056b535View commit details -
Merge pull request #1 from Unisay/issue/codepoints-ffi
Implement Data.String.CodePoints, repair the test suite
Configuration menu - View commit details
-
Copy full SHA for 395c4b6 - Browse repository at this point
Copy the full SHA 395c4b6View commit details
Commits on Jun 14, 2026
-
chore: normalize build tooling
Replace the inherited bower CI (no bower.json in this fork) with a nix-based one that runs scripts/build, scripts/test (if present) and luacheck; make the scripts fail-fast; refresh stale flake inputs.
Configuration menu - View commit details
-
Copy full SHA for 6d46b2d - Browse repository at this point
Copy the full SHA 6d46b2dView commit details -
Configuration menu - View commit details
-
Copy full SHA for e63561b - Browse repository at this point
Copy the full SHA e63561bView commit details -
Merge pull request #2 from Unisay/chore/normalize-tooling
chore: normalize build tooling (nix CI, fail-fast scripts, fresh flake)
Configuration menu - View commit details
-
Copy full SHA for 39f7ebb - Browse repository at this point
Copy the full SHA 39f7ebbView commit details -
chore: align CI to hardened canon, add AGENTS.md + CLAUDE.md
CI: drop accept-flake-config (supply-chain risk; caches already pinned), run luacheck with --std lua51 --no-unused-args (matches the Lua 5.1 target and the curried-FFI idiom), invoke the test step via bash so it no longer needs the execute bit. AGENTS.md is the single instruction file the coding agents read natively; CLAUDE.md is a one-line @AGENTS.md import so Claude Code shares it. Also removes dead JavaScript-era package files. Tooling and docs only, no src/.
Configuration menu - View commit details
-
Copy full SHA for bebcf0a - Browse repository at this point
Copy the full SHA bebcf0aView commit details -
Merge pull request #3 from Unisay/chore/agents-md-and-canon-ci
chore: align CI to the hardened canon, add AGENTS.md
Configuration menu - View commit details
-
Copy full SHA for e55cf13 - Browse repository at this point
Copy the full SHA e55cf13View commit details -
chore: point pslua + package-set links at purescript-lua org
Repos moved from Unisay/* to the purescript-lua org. Update the pslua flake input and lockfile owner (same rev 94c13ce), the packages.dhall upstream-lua release URL, and the doc/comment links, so nothing relies on the old-owner redirect.
Configuration menu - View commit details
-
Copy full SHA for d6ceb3a - Browse repository at this point
Copy the full SHA d6ceb3aView commit details -
Merge pull request #4 from purescript-lua/chore/migrate-org-links
chore: point pslua + package-set links at purescript-lua org
Configuration menu - View commit details
-
Copy full SHA for 3962837 - Browse repository at this point
Copy the full SHA 3962837View commit details -
chore: add treefmt formatting (nix fmt) and format the tree
Wire treefmt via treefmt-nix: nixfmt, dhall format, purs-tidy (.tidyrc.json) and LuaFormatter for the FFI (.lua-format, kept over StyLua because it preserves the parentheses pslua's parser needs). `nix fmt` formats; the dev shell installs a content-based pre-commit hook and CI runs `nix fmt && git diff --exit-code` (content-based, since the in-place formatters bump mtime and would trip treefmt --fail-on-change). Lua lines budget 130 cols, matching the raised `luacheck --max-line-length`. The bulk of the diff is the first format pass.
Configuration menu - View commit details
-
Copy full SHA for b078fe6 - Browse repository at this point
Copy the full SHA b078fe6View commit details
Commits on Jun 15, 2026
-
Merge pull request #5 from purescript-lua/chore/treefmt
chore: add treefmt formatting (nix fmt + pre-commit + CI check)
Configuration menu - View commit details
-
Copy full SHA for 10838df - Browse repository at this point
Copy the full SHA 10838dfView commit details -
chore: harden pre-commit hook (tracked .githooks/ + core.hooksPath)
Replace the dev-shell installer that wrote .git/hooks/pre-commit with a tracked .githooks/pre-commit wired via `git config core.hooksPath .githooks`. Fixes three issues with the old hook: it gated on `[ -d .git ]` (false in worktrees/submodules where .git is a file), it clobbered any existing .git/hooks/pre-commit on every `nix develop`, and `nix fmt … || exit 0` swallowed real formatter failures. The new hook skips only when `nix` is absent (CI is the authoritative gate) and otherwise blocks on a `nix fmt` failure or reformat.
Configuration menu - View commit details
-
Copy full SHA for ee679e7 - Browse repository at this point
Copy the full SHA ee679e7View commit details -
chore: bump pslua dev input to 62e3653
Toolchain consistency: pin the pslua dev flake input to the current compiler main across the ecosystem. flake.lock only; the package set consumes sources + FFI, not this dev input, so no re-tag is needed.
Configuration menu - View commit details
-
Copy full SHA for 458a7ac - Browse repository at this point
Copy the full SHA 458a7acView commit details
This comparison is taking too long to generate.
Unfortunately it looks like we can’t render this comparison for you right now. It might be too big, or there might be something weird with your repository.
You can try running this command locally to see the comparison on your machine:
git diff master...master