leptris 1.9.363.1-ppc64le-linux → 1.9.364.2-ppc64le-linux

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: 3d9d5d0051d2c4ed455c165adafcc9962ee4229d5d199f4aaccf48896f330807
4
- data.tar.gz: 0b79be7b9b78454b2a620466679f45aed50c2cd51d2ffa96f17170a4c08929ad
3
+ metadata.gz: e2c79516f723853cd202c616deb744eca3839f60b68e30711aa14ce52b53b9f6
4
+ data.tar.gz: 10656c0ce3b208b6a381ee957e91834aa6624954de13a7ac66633b10db7b0b2c
5
5
  SHA512:
6
- metadata.gz: 25447b4d774577562e5bfea9f5331670b8a91ea5ca98077136eb5b596af6490bf9fd4d68f502cca6d2a2e64820809070ed1e4e177b9eb57391161fbe4aa1755d
7
- data.tar.gz: b77e4ed95392b6f3fb2b7c256ffccfe91611480e72171da2f62d78345c1dcfe6f51f9e35549d32f15e2f571481b1dceb2b13ec65577c1a4acaa38d3f92e1c96a
6
+ metadata.gz: 81371536e281b37774bea50f0c3613b1bef2ce0314d9e41db4f9635aceb9ebd8b1a6d64836567669408f328cf7d272686b77a611f71eeb39859d7b287dde5761
7
+ data.tar.gz: f3ff87de44d91b278554802ebe32f220313b6c0688b7c257a46a98db8406d5bd003130ec0cb31512f6c50951b8fe6966450bef4f2d931e79df44d3eb420b31dc
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.363"
11
+ LIBLEPTRIS_VERSION = "1.9.364"
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.363.1"
4
+ VERSION = "1.9.364.2"
5
5
  end
@@ -864,6 +864,16 @@ class Leptris::XML::Document
864
864
  node
865
865
  end
866
866
 
867
+ # #1749: engine diag kind -> SyntaxError severity. FATAL = the
868
+ # classes the strict lane raises on (element still open at EOF;
869
+ # unescaped '<' in text, engine >= 1.9.364); the recover-class
870
+ # records (stray close dropped/implicit close, duplicate attribute,
871
+ # ...) and any future kind read :recoverable.
872
+ DIAG_SEVERITY = {
873
+ Leptris::XML::FFI::DIAG_KIND_UNCLOSED_ELEMENT => :fatal,
874
+ Leptris::XML::FFI::DIAG_KIND_UNESCAPED_LT => :fatal
875
+ }.freeze
876
+
867
877
  # Recovered-parse diagnostics (leptris-ruby#465): nokogiri parity
868
878
  # for the recover lane — the engine's parse diagnostics as
869
879
  # SyntaxError entries, empty for a clean parse. The engine
@@ -878,7 +888,9 @@ class Leptris::XML::Document
878
888
  ok = Leptris::XML::FFI.leptris_document_parse_diag(
879
889
  c_ptr, i, kind_buf, msg_buf, 512)
880
890
  next nil if ok.zero?
881
- Leptris::XML::SyntaxError.new(msg_buf.read_string.force_encoding(Encoding::UTF_8))
891
+ Leptris::XML::SyntaxError.new(
892
+ msg_buf.read_string.force_encoding(Encoding::UTF_8),
893
+ severity: DIAG_SEVERITY.fetch(kind_buf.read_int, :recoverable))
882
894
  end.compact
883
895
  end
884
896
 
@@ -1520,6 +1520,13 @@ attach_function :leptris_parse_string,
1520
1520
  [:leptris_document], :leptris_status
1521
1521
  attach_function :leptris_document_remove_doctype,
1522
1522
  [:leptris_document], :leptris_status
1523
+ # LeptrisDiagKind (engine types.h, append-only): the values the
1524
+ # DOM parse channel records. Document#errors maps these to
1525
+ # SyntaxError severity (#1749) — FATAL kinds are the classes the
1526
+ # strict lane raises on; everything else reads :recoverable.
1527
+ DIAG_KIND_UNCLOSED_ELEMENT = 11
1528
+ DIAG_KIND_UNESCAPED_LT = 12 # engine >= 1.9.364 (#1748/#1749)
1529
+
1523
1530
  attach_function :leptris_document_parse_diag_count,
1524
1531
  [:leptris_document], :size_t
1525
1532
  attach_function :leptris_document_parse_diag,
data/lib/leptris/xml.rb CHANGED
@@ -111,14 +111,22 @@ module Leptris
111
111
  # SyntaxError shape — a message plus optional position — served
112
112
  # by Document#errors.
113
113
  class SyntaxError < Error
114
- attr_reader :message, :line, :column
114
+ attr_reader :message, :line, :column, :severity
115
115
 
116
- def initialize(message, line: nil, column: nil)
116
+ # severity: :fatal (the strict lane raises on this class) or
117
+ # :recoverable (leptris-ruby#1749) — raise-on-fatal /
118
+ # recover-on-recoverable without string matching.
119
+ def initialize(message, line: nil, column: nil, severity: :recoverable)
117
120
  @message = message
118
121
  @line = line
119
122
  @column = column
123
+ @severity = severity
120
124
  super(message)
121
125
  end
126
+
127
+ def fatal?
128
+ @severity == :fatal
129
+ end
122
130
  end
123
131
  class ReadOnlyError < Error; end
124
132
  class XPathError < Error; end
data/lib/libleptris.so CHANGED
Binary file
data/vendor-src/README.md CHANGED
@@ -1,7 +1,7 @@
1
1
  Sources vendored in this gem (recompile rights; the ruby
2
2
  variant builds them at install via extconf.rb):
3
3
 
4
- - libleptris v1.9.363
4
+ - libleptris v1.9.364
5
5
  - utf8proc v2.11.0
6
6
 
7
7
  Rebuild by hand:
@@ -1,5 +1,21 @@
1
1
  ## [Unreleased]
2
2
 
3
+ ## [1.9.364] - 2026-10-16
4
+
5
+ ### Added
6
+
7
+ - **parse diagnostics carry severity classification (#1749, PR #1752).**
8
+ Two append-only `LeptrisDiagKind` refinements so embedders can implement
9
+ raise-on-fatal / recover-on-recoverable without string matching:
10
+ `LEPTRIS_DIAG_UNESCAPED_LT` — the #1748 unescaped-`<` recovery is a
11
+ strict-fatal class and now records its own kind instead of the generic
12
+ RECOVER bucket; and the ancestor-implicit-close recovery records
13
+ `LEPTRIS_DIAG_MISMATCHED_TAG` (libxml2 reports the same shape as a tag
14
+ mismatch), reserving `LEPTRIS_DIAG_UNCLOSED_ELEMENT` for the
15
+ still-open-at-EOF fatal class. Record messages unchanged; enum is
16
+ append-only.
17
+
18
+
3
19
  ## [1.9.363] - 2026-10-16
4
20
 
5
21
  ### Fixed
@@ -3,7 +3,7 @@
3
3
  cmake_minimum_required(VERSION 3.20)
4
4
 
5
5
  project(leptris
6
- VERSION 1.9.363
6
+ VERSION 1.9.364
7
7
  DESCRIPTION "Fast XML parser and XPath evaluator in pure C"
8
8
  LANGUAGES C CXX
9
9
  )
@@ -290,6 +290,10 @@ typedef enum {
290
290
  * implicitly), and an element still open at EOF. Append-only. */
291
291
  LEPTRIS_DIAG_MISMATCHED_TAG,
292
292
  LEPTRIS_DIAG_UNCLOSED_ELEMENT,
293
+ /* leptris#1748: an unescaped '<' in text folded into the run —
294
+ * RECOVERABLE-lane record of a STRICT-FATAL class (the strict
295
+ * path fails the parse; severity mapping: fatal). Append-only. */
296
+ LEPTRIS_DIAG_UNESCAPED_LT,
293
297
  LEPTRIS_DIAG_COUNT_
294
298
  } LeptrisDiagKind;
295
299
 
@@ -1755,7 +1755,7 @@ static struct leptris_document* direct_parse_internal(char* buf, size_t len,
1755
1755
  leptris_diag_emit(
1756
1756
  &p.doc->parse_diags, &p.doc->parse_diag_count,
1757
1757
  &p.doc->parse_diag_cap,
1758
- LEPTRIS_DIAG_RECOVER, NULL,
1758
+ LEPTRIS_DIAG_UNESCAPED_LT, NULL,
1759
1759
  "Unescaped < not allowed in a text node");
1760
1760
  const char* nq = lt + 1;
1761
1761
  const char* nlt =
@@ -2142,11 +2142,17 @@ static struct leptris_document* direct_parse_internal(char* buf, size_t len,
2142
2142
  while ((int)p.depth - 1 > anc) {
2143
2143
  LeptrisElement ce =
2144
2144
  p.open_stack[p.depth - 1];
2145
+ /* #1749 severity: the implicit close
2146
+ * is the MISMATCH recovery (libxml2
2147
+ * reports a tag mismatch; recoverable
2148
+ * class) — UNCLOSED_ELEMENT stays
2149
+ * reserved for the still-open-at-EOF
2150
+ * fatal class. */
2145
2151
  leptris_diag_emit(
2146
2152
  &p.doc->parse_diags,
2147
2153
  &p.doc->parse_diag_count,
2148
2154
  &p.doc->parse_diag_cap,
2149
- LEPTRIS_DIAG_UNCLOSED_ELEMENT, NULL,
2155
+ LEPTRIS_DIAG_MISMATCHED_TAG, NULL,
2150
2156
  "Element %s closed implicitly by </%.*s>",
2151
2157
  elem_name(ce),
2152
2158
  (int)close_local_len, close_local);
@@ -799,8 +799,17 @@ TEST(ParseRecover, MismatchedCloseKeepsTreeAndDropsStray) {
799
799
  EXPECT_STREQ(leptris_element_text(a), "x");
800
800
  /* Two recoveries: the stray </b> drops, and <a> closes
801
801
  * implicitly when </root> names the ancestor (libxml2 reports
802
- * both as well). */
802
+ * both as well). Both are MISMATCHED_TAG — the #1749 severity
803
+ * contract keeps UNCLOSED_ELEMENT for the EOF class only. */
803
804
  EXPECT_EQ(leptris_document_parse_diag_count(doc), 2u);
805
+ LeptrisDiagKind kind = (LeptrisDiagKind)-1;
806
+ char msg[128] = {0};
807
+ ASSERT_EQ(leptris_document_parse_diag(doc, 0, &kind, msg,
808
+ sizeof(msg)), 1);
809
+ EXPECT_EQ(kind, LEPTRIS_DIAG_MISMATCHED_TAG);
810
+ ASSERT_EQ(leptris_document_parse_diag(doc, 1, &kind, msg,
811
+ sizeof(msg)), 1);
812
+ EXPECT_EQ(kind, LEPTRIS_DIAG_MISMATCHED_TAG);
804
813
  leptris_document_free(doc);
805
814
  }
806
815
 
@@ -867,7 +876,10 @@ TEST(ParseRecover, BareLtInTextKeepsTreeAndRecords) {
867
876
  char msg[128] = {0};
868
877
  ASSERT_EQ(leptris_document_parse_diag(doc, 0, &kind, msg,
869
878
  sizeof(msg)), 1);
870
- EXPECT_EQ(kind, LEPTRIS_DIAG_RECOVER);
879
+ /* #1749: the kind carries the severity — unescaped '<' is a
880
+ * STRICT-FATAL class recovered on the lenient lane, its own
881
+ * kind, not the generic RECOVER bucket. */
882
+ EXPECT_EQ(kind, LEPTRIS_DIAG_UNESCAPED_LT);
871
883
  leptris_document_free(doc);
872
884
  }
873
885
 
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "$schema": "https://raw.githubusercontent.com/microsoft/vcpkg/master/scripts/vcpkg.schema.json",
3
3
  "name": "leptris",
4
- "version": "1.9.363",
4
+ "version": "1.9.364",
5
5
  "description": "High-performance XML parser and XPath 1.0 engine in C (libleptris)",
6
6
  "homepage": "https://github.com/leptris/leptris",
7
7
  "license": "MIT",
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.363.1
4
+ version: 1.9.364.2
5
5
  platform: ppc64le-linux
6
6
  authors:
7
7
  - Ribose Inc.