leptris 1.9.178.1 → 1.9.186.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 31fb6e532087705ab9eb346db9cca66be9ed84c774eac9329a5c41ebdfedbb9d
4
- data.tar.gz: 9f5006330eb3bf32e3beca44b2d14924b547bf54d8ddbc0a4054e90ca4a2e373
3
+ metadata.gz: 4c702e5d445cbabe1892ea5aa261caf972a9ada194bb5abdb0a90afe5f249fa5
4
+ data.tar.gz: c9f55612f94575433e996905aeb06c5716b6fe2c7bb2fb1acde277f7f53e7746
5
5
  SHA512:
6
- metadata.gz: bf50f65f973b9e05b8304d90a6f8f731c53450cc0967157214e8ae80b33ce02ba3a8f550c5359a16fe095cc34af4e3020829e7d8d9abf71c537840da1bea8526
7
- data.tar.gz: 0ddbca8bf4a8064a2a956c0344d70a22e04884c6724b2ed2b9e73c7d78b58c527f1f13b930f530775e31aed1442e5a1f46bf6a2930c5a6a678890528f491a07c
6
+ metadata.gz: 44009c3f0160ec11265c21fa17e3d54dfd89f4629ef8d8bae8934c5063e08e1579a4e20f1de42dc18dc0f94ca427c30e2c6785251ccfc9f5ff88e65ef088bc4e
7
+ data.tar.gz: cfe692871915a7dd8788ec8e2762c71b025e8e88df5eadf2bbe6c5b9203b875e91e28fd0ca53acf08cf61da6c3a8de8211c185e3a6d82a297effb77079096143
data/CHANGELOG.md CHANGED
@@ -5,6 +5,50 @@ All notable changes to Leptris will be documented in this file.
5
5
  The format is based on [Keep a Changelog](https://keepachangelog.com/1.0.0/),
6
6
  and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
7
7
 
8
+ ## [1.9.186.0] - 2026-09-17
9
+
10
+ ### Changed — libleptris 1.9.181 → 1.9.186 (lockstep)
11
+
12
+ - **RNG regression fix (upstream #1137)**: documents omitting an
13
+ `<optional>` element failed validation since 1.9.179 — the #1121
14
+ name-mismatch diagnostics engaged the matcher's short-circuit
15
+ during backtracking probes. Verdict probes are side-effect-free
16
+ again; spec-pinned here (omitted + present forms, and error
17
+ accumulation still works).
18
+ - **Immutable parse buffer (upstream #1125, then the 1.9.185
19
+ scratch-copy scanner)**: `leptris_parse_string_inplace` never
20
+ writes the caller's buffer (attached-only in this binding; the
21
+ parse faces use the copying variant). Attr-heavy parse
22
+ allocations stay pool-backed — 39,684 mallocs for one 48 KB
23
+ document in the 1.9.182 log-replay design, now 8.
24
+ - **One arena per document (upstream #1127)**:
25
+ `leptris_document_create` routes through the arena-backed pool —
26
+ the same allocation path as the parser (the fresh-document
27
+ build lane); the dead `compact_allocator` is deleted.
28
+ - **Parse perf (upstream 1.9.185/1.9.186)**: scratch-copy scanner
29
+ (attr-heavy 472 → 70 µs vs pugixml) and chunked element-block
30
+ zeroing (tag-dense text parse −8%).
31
+ - No public-symbol changes: audit 322/322.
32
+
33
+ ## [1.9.181.0] - 2026-09-16
34
+
35
+ ### Changed — libleptris 1.9.178 → 1.9.181 (lockstep)
36
+
37
+ - **RNG error accumulation (upstream #878)**: `RelaxNG#validate`
38
+ now returns ALL errors, not just the first. The new
39
+ `leptris_rng_error_count/_message/_line/_column` surface is
40
+ attached, and each message is composed Jing-style as
41
+ `line:col: error: message` (the raw accumulated messages carry
42
+ no prefix; `leptris_rng_error` remains the back-compat
43
+ first-error accessor).
44
+ - **Parser-recorded source positions (upstream #1124)**:
45
+ `Node#source_position` returns `{ line:, col_start:, col_end }`
46
+ via the new `leptris_node_source_position` (column spans follow
47
+ the Jing convention; created nodes report zeros).
48
+ - 1.9.179/1.9.180 engine fixes ride along: ASAN use-after-free on
49
+ the line-break table, a leak on the parse-failure path, and a
50
+ leak of the in-place document.
51
+
8
52
  ## [1.9.178.1] - 2026-09-16
9
53
 
10
54
  ### Changed
data/Rakefile CHANGED
@@ -8,7 +8,7 @@ RSpec::Core::RakeTask.new(:spec)
8
8
  # Pin for `rake compile` and the platform-gem builds. Keep in lockstep
9
9
  # with .github/workflows/build.yml (which calls `rake compile`) and the
10
10
  # CHANGELOG when libleptris releases.
11
- LIBLEPTRIS_VERSION = "1.9.178"
11
+ LIBLEPTRIS_VERSION = "1.9.186"
12
12
  # Vendored alongside libleptris for fn:normalize-unicode (TODO
13
13
  # .restructure/20): built per platform with a RELOCATABLE @rpath
14
14
  # install name, loaded by ffi.rb before libleptris so the
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Leptris
4
- VERSION = "1.9.178.1"
4
+ VERSION = "1.9.186.0"
5
5
  end
@@ -473,6 +473,17 @@ attach_function :leptris_parse_string,
473
473
  [:leptris_node_ref], :leptris_status
474
474
  attach_function :leptris_node_line,
475
475
  [:leptris_node_ref], :int
476
+ # Parser-recorded source position (libleptris 1.9.180,
477
+ # #1124): {line, col_start, col_end} — Jing's diagnostic
478
+ # convention (column after the start tag's '>' / the
479
+ # element's final '>').
480
+ class SourcePosition < ::FFI::Struct
481
+ layout :line, :int,
482
+ :col_start, :int,
483
+ :col_end, :int
484
+ end
485
+ attach_function :leptris_node_source_position,
486
+ [:leptris_node_ref, :pointer], :void
476
487
  attach_function :leptris_node_compare,
477
488
  [:leptris_node_ref, :leptris_node_ref], :int
478
489
  attach_function :leptris_node_traverse,
@@ -1004,6 +1015,17 @@ attach_function :leptris_parse_string,
1004
1015
  [:leptris_relaxng, :leptris_document], :int
1005
1016
  attach_function :leptris_rng_error,
1006
1017
  [:leptris_relaxng], :string
1018
+ # Accumulated validation errors (libleptris 1.9.179, #878):
1019
+ # the validator no longer stops at the first failure;
1020
+ # leptris_rng_error keeps returning the first (back-compat).
1021
+ attach_function :leptris_rng_error_count,
1022
+ [:leptris_relaxng], :size_t
1023
+ attach_function :leptris_rng_error_message,
1024
+ [:leptris_relaxng, :size_t], :string
1025
+ attach_function :leptris_rng_error_line,
1026
+ [:leptris_relaxng, :size_t], :int
1027
+ attach_function :leptris_rng_error_column,
1028
+ [:leptris_relaxng, :size_t], :int
1007
1029
 
1008
1030
  attach_function :leptris_xslt_parse,
1009
1031
  [:string, :size_t], :leptris_xslt
@@ -309,6 +309,19 @@ class Leptris::XML::Node
309
309
  @line = Leptris::XML::FFI.leptris_node_line(c_ptr)
310
310
  end
311
311
 
312
+ # Full parser-recorded position (libleptris 1.9.180, #1124):
313
+ # {line:, col_start:, col_end:} in Jing's diagnostic
314
+ # convention; zeros for programmatically-created nodes. First
315
+ # read wins (positions never change).
316
+ def source_position
317
+ return @source_position if defined?(@source_position)
318
+ ensure_alive!
319
+ out = Leptris::XML::FFI::SourcePosition.new
320
+ Leptris::XML::FFI.leptris_node_source_position(c_ptr, out)
321
+ @source_position = { line: out[:line], col_start: out[:col_start],
322
+ col_end: out[:col_end] }
323
+ end
324
+
312
325
  # Byte offset of the node's markup in its parse source (the '<'
313
326
  # of the tag; libleptris 1.9.162, #1039 — the position descriptor
314
327
  # CALLBACK rows echo). 0 when unknown: mutation-created nodes, or
@@ -60,11 +60,23 @@ module Leptris::XML::RelaxNG
60
60
 
61
61
  # Nokogiri shape: an array of error strings (the engine emits
62
62
  # Jing's "line:col: error: message" form), empty when valid.
63
+ # libleptris 1.9.179 (#878): errors accumulate — every failure
64
+ # from the validate call is returned, not just the first.
63
65
  def validate(document)
64
66
  ok = Leptris::XML::FFI.leptris_rng_validate(@handle,
65
67
  document.c_ptr)
66
68
  return [] if ok != 0
67
- [Leptris::XML::FFI.leptris_rng_error(@handle)].compact
69
+ count = Leptris::XML::FFI.leptris_rng_error_count(@handle)
70
+ return [Leptris::XML::FFI.leptris_rng_error(@handle)].compact if count.zero?
71
+ # Jing's rendering for every accumulated error, matching the
72
+ # single-error accessor's format ("line:col: error: msg").
73
+ Array.new(count) do |i|
74
+ msg = Leptris::XML::FFI.leptris_rng_error_message(@handle, i)
75
+ next nil if msg.nil?
76
+ line = Leptris::XML::FFI.leptris_rng_error_line(@handle, i)
77
+ col = Leptris::XML::FFI.leptris_rng_error_column(@handle, i)
78
+ line > 0 ? "#{line}:#{col}: error: #{msg}" : msg
79
+ end.compact
68
80
  end
69
81
 
70
82
  def valid?(document)
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: leptris
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.9.178.1
4
+ version: 1.9.186.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ribose Inc.