leptris 1.9.178.1 → 1.9.181.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: 35e0cd2470e2f0e12a01424ec1ca0fe753d5835fc07d67ec54c2fd5ba257afcc
4
+ data.tar.gz: 69a9520e7bb23117005fa8695c353f75aed6da034ca0f70e79a556c47c3df78c
5
5
  SHA512:
6
- metadata.gz: bf50f65f973b9e05b8304d90a6f8f731c53450cc0967157214e8ae80b33ce02ba3a8f550c5359a16fe095cc34af4e3020829e7d8d9abf71c537840da1bea8526
7
- data.tar.gz: 0ddbca8bf4a8064a2a956c0344d70a22e04884c6724b2ed2b9e73c7d78b58c527f1f13b930f530775e31aed1442e5a1f46bf6a2930c5a6a678890528f491a07c
6
+ metadata.gz: 7579134233ffb721e9ef41955b47389fd71ba327ca1d00d28a34bb8e72454ce23bf823ca3572b94054edb44eef68563f67a2510f6544394f36379ecc9e2f7613
7
+ data.tar.gz: d23c31c7c660c429d0d05ee158028cc72adeb7b48c2917f07387e4e1a63a608c304dea736614da99c7d906bf6091d26cbac833618a0bb47b75896729ce69cf69
data/CHANGELOG.md CHANGED
@@ -5,6 +5,25 @@ 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.181.0] - 2026-09-16
9
+
10
+ ### Changed — libleptris 1.9.178 → 1.9.181 (lockstep)
11
+
12
+ - **RNG error accumulation (upstream #878)**: `RelaxNG#validate`
13
+ now returns ALL errors, not just the first. The new
14
+ `leptris_rng_error_count/_message/_line/_column` surface is
15
+ attached, and each message is composed Jing-style as
16
+ `line:col: error: message` (the raw accumulated messages carry
17
+ no prefix; `leptris_rng_error` remains the back-compat
18
+ first-error accessor).
19
+ - **Parser-recorded source positions (upstream #1124)**:
20
+ `Node#source_position` returns `{ line:, col_start:, col_end }`
21
+ via the new `leptris_node_source_position` (column spans follow
22
+ the Jing convention; created nodes report zeros).
23
+ - 1.9.179/1.9.180 engine fixes ride along: ASAN use-after-free on
24
+ the line-break table, a leak on the parse-failure path, and a
25
+ leak of the in-place document.
26
+
8
27
  ## [1.9.178.1] - 2026-09-16
9
28
 
10
29
  ### 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.181"
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.181.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.181.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ribose Inc.