leptris 1.9.400.0-aarch64-linux → 1.9.402.0-aarch64-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 +4 -4
- data/Rakefile +1 -1
- data/lib/leptris/version.rb +1 -1
- data/lib/libleptris.so +0 -0
- data/vendor-src/README.md +1 -1
- data/vendor-src/libleptris/CHANGELOG.md +45 -0
- data/vendor-src/libleptris/CMakeLists.txt +1 -1
- data/vendor-src/libleptris/src/leptris/rng/rng_regex.c +36 -2
- data/vendor-src/libleptris/src/leptris/xsd/compile.c +6 -0
- data/vendor-src/libleptris/src/leptris/xsd/datatypes.c +35 -1
- data/vendor-src/libleptris/src/leptris/xsd/validate.c +6 -2
- data/vendor-src/libleptris/test/xsd/test_xsd_compile.cpp +52 -0
- data/vendor-src/libleptris/vcpkg.json +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 7b1b31c0bfe703486e2a44d908e62e9ba697a56c4680a6242fca206c878c1cec
|
|
4
|
+
data.tar.gz: a66f83a71c92648ee45d72f815995e42f609a6b93dfdb0b9a091737529cc9c4c
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 9855a4bcf55ce0818b580e75faade58d55423cad2aeeeab1e7aad0e37d154c1f6767bbfefcea7a4e762fbb3ea132c64be7e4cb0de15d50cf1733d38427b5527c
|
|
7
|
+
data.tar.gz: 83a0333523e1217e32ce381a3f4f094b658a70eb74af76d83d5a9ddd2a866508b9d8f92a159cd81f8c23999c21fc77cdd3b90e88f81f51e5a30c47ba7a9729dc
|
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.
|
|
11
|
+
LIBLEPTRIS_VERSION = "1.9.402"
|
|
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
|
data/lib/leptris/version.rb
CHANGED
data/lib/libleptris.so
CHANGED
|
Binary file
|
data/vendor-src/README.md
CHANGED
|
@@ -1,5 +1,50 @@
|
|
|
1
1
|
## [Unreleased]
|
|
2
2
|
|
|
3
|
+
## [1.9.402] - 2026-11-02
|
|
4
|
+
|
|
5
|
+
### Fixed
|
|
6
|
+
|
|
7
|
+
- **`\\w` is the complement of punctuation/separators/controls
|
|
8
|
+
(leptris#1936 reV family, 39 rows, PR #1948).** XSD Part 2
|
|
9
|
+
App. F defines wordChar as NOT in `\\p{P}\\p{Z}\\p{C}` —
|
|
10
|
+
Sm/Sc/No/Mn/Me are all word chars. The engine's `\\w` was
|
|
11
|
+
ASCII-only, so `\\W` accepted every non-ASCII letter, mark,
|
|
12
|
+
superscript, fraction slash and currency sign (reV6-43). A
|
|
13
|
+
`cat_neg` flag on the regex class node expresses the category
|
|
14
|
+
complement; `\\W` inherits through its negation. reV 42/42
|
|
15
|
+
oracle agreement against the real suite documents.
|
|
16
|
+
- **Global elements with inline anonymous types get their
|
|
17
|
+
declaration (leptris#1936 stE, 15 rows, PR #1948).** The
|
|
18
|
+
global-element capture required both `name` and `type`
|
|
19
|
+
attributes — a global element whose type is an inline
|
|
20
|
+
`<xs:simpleType>` child never produced a declaration, so the
|
|
21
|
+
element's `fixed` value constraint and the type both vanished
|
|
22
|
+
and every instance validated. The `nm`-only branch now records
|
|
23
|
+
`fixed` alongside the #1592 synthesized-slot type.
|
|
24
|
+
- **The element `fixed` VALUE constraint fires regardless of type
|
|
25
|
+
resolution (PR #1948).** The check sat after the type
|
|
26
|
+
resolution's anyType early-return and its `*text` guard let
|
|
27
|
+
empty content pass a non-empty fixed value.
|
|
28
|
+
|
|
29
|
+
|
|
30
|
+
|
|
31
|
+
## [1.9.401] - 2026-11-01
|
|
32
|
+
|
|
33
|
+
### Fixed
|
|
34
|
+
|
|
35
|
+
- **List value spaces collapse whitespace before the facets
|
|
36
|
+
(leptris#1936 stG010/stH005, PR #1945).** Caught by running the
|
|
37
|
+
REAL W3C suite documents (vendored in lutaml-xsd) through the
|
|
38
|
+
xmllint-arbiter harness: a list-derived restriction's
|
|
39
|
+
enumeration facet compared the RAW element content — stG010's
|
|
40
|
+
value arrives as newline-tab-CA-newline-spaces and never matched
|
|
41
|
+
enum "CA" — and a whole-list pattern had the same hole (stH005).
|
|
42
|
+
List value spaces are whitespace=collapse (Part 2): the value is
|
|
43
|
+
normalized before the pattern/enumeration/length family runs.
|
|
44
|
+
Suite 142/142; both documents validate. (xsd)
|
|
45
|
+
|
|
46
|
+
|
|
47
|
+
|
|
3
48
|
## [1.9.400] - 2026-11-01
|
|
4
49
|
|
|
5
50
|
### Fixed
|
|
@@ -55,6 +55,11 @@ typedef struct RreNode {
|
|
|
55
55
|
* LEPTRIS_HAS_UTF8PROC (without it the escapes fail loudly). */
|
|
56
56
|
unsigned cat_set;
|
|
57
57
|
unsigned cat_mask;
|
|
58
|
+
/* cat_neg (#1936 reV33-43): the class matches when the codepoint
|
|
59
|
+
* is NOT in the masked categories — XSD \w is defined as the
|
|
60
|
+
* complement of punctuation/separators/controls, not the union
|
|
61
|
+
* of letters (Sm/Sc/Sk are word chars per the suite). */
|
|
62
|
+
unsigned cat_neg;
|
|
58
63
|
/* cat_strict (moxml#464): a class-internal COMPLEMENT builtin
|
|
59
64
|
* ([\I], [\D]) needs bitmap AND cats to agree — the normal
|
|
60
65
|
* union can't express "not in the set" once the bitmap holds
|
|
@@ -125,10 +130,36 @@ static void cls_add_builtin(RreNode* n, char c) {
|
|
|
125
130
|
}
|
|
126
131
|
break;
|
|
127
132
|
case 'w':
|
|
128
|
-
|
|
133
|
+
/* XSD 1.0 Part 2 App. F: wordChar is the COMPLEMENT of
|
|
134
|
+
* punctuation, separators and controls — Sm/Sc/No/Mn/
|
|
135
|
+
* Me are all word chars (the suite's reV rows: U+2044,
|
|
136
|
+
* U+20A0, U+00B2, U+20DD never match \W). The ASCII-only
|
|
137
|
+
* form made \W accept every non-ASCII non-punct char
|
|
138
|
+
* (#1936 reV family). */
|
|
129
139
|
for (int i = 'a'; i <= 'z'; i++) cls_add(n, (unsigned char)i);
|
|
130
140
|
for (int i = 'A'; i <= 'Z'; i++) cls_add(n, (unsigned char)i);
|
|
141
|
+
for (int i = '0'; i <= '9'; i++) cls_add(n, (unsigned char)i);
|
|
131
142
|
cls_add(n, '_');
|
|
143
|
+
#if defined(LEPTRIS_HAS_UTF8PROC)
|
|
144
|
+
n->cat_set = 1;
|
|
145
|
+
n->cat_neg = 1;
|
|
146
|
+
n->cat_mask =
|
|
147
|
+
(1u << UTF8PROC_CATEGORY_PC) |
|
|
148
|
+
(1u << UTF8PROC_CATEGORY_PD) |
|
|
149
|
+
(1u << UTF8PROC_CATEGORY_PS) |
|
|
150
|
+
(1u << UTF8PROC_CATEGORY_PE) |
|
|
151
|
+
(1u << UTF8PROC_CATEGORY_PI) |
|
|
152
|
+
(1u << UTF8PROC_CATEGORY_PF) |
|
|
153
|
+
(1u << UTF8PROC_CATEGORY_PO) |
|
|
154
|
+
(1u << UTF8PROC_CATEGORY_ZL) |
|
|
155
|
+
(1u << UTF8PROC_CATEGORY_ZP) |
|
|
156
|
+
(1u << UTF8PROC_CATEGORY_ZS) |
|
|
157
|
+
(1u << UTF8PROC_CATEGORY_CC) |
|
|
158
|
+
(1u << UTF8PROC_CATEGORY_CF) |
|
|
159
|
+
(1u << UTF8PROC_CATEGORY_CN) |
|
|
160
|
+
(1u << UTF8PROC_CATEGORY_CO) |
|
|
161
|
+
(1u << UTF8PROC_CATEGORY_CS);
|
|
162
|
+
#endif
|
|
132
163
|
break;
|
|
133
164
|
case 's':
|
|
134
165
|
cls_add(n, ' ');
|
|
@@ -175,7 +206,9 @@ static void cls_add_builtin(RreNode* n, char c) {
|
|
|
175
206
|
(1u << UTF8PROC_CATEGORY_NL) |
|
|
176
207
|
(1u << UTF8PROC_CATEGORY_ND) |
|
|
177
208
|
(1u << UTF8PROC_CATEGORY_MN) |
|
|
178
|
-
(1u << UTF8PROC_CATEGORY_MC)
|
|
209
|
+
(1u << UTF8PROC_CATEGORY_MC) |
|
|
210
|
+
(1u << UTF8PROC_CATEGORY_ME) |
|
|
211
|
+
(1u << UTF8PROC_CATEGORY_NO);
|
|
179
212
|
#else
|
|
180
213
|
for (int i = 0x80; i < 0x100; i++) cls_add(n, (unsigned char)i);
|
|
181
214
|
#endif
|
|
@@ -256,6 +289,7 @@ static int cls_has_cp(const RreNode* n, unsigned cp) {
|
|
|
256
289
|
int c = (n->cat_mask &
|
|
257
290
|
(1u << utf8proc_get_property((utf8proc_int32_t)cp)
|
|
258
291
|
->category)) != 0;
|
|
292
|
+
if (n->cat_neg) c = !c;
|
|
259
293
|
hit = n->cat_strict ? (hit && c) : (hit || c);
|
|
260
294
|
}
|
|
261
295
|
#else
|
|
@@ -2462,6 +2462,12 @@ static void xsd_capture_root(struct leptris_xsd_schema* s,
|
|
|
2462
2462
|
if (s->target_ns) d->ns = xsd_strdup(s->target_ns);
|
|
2463
2463
|
if (has_inline)
|
|
2464
2464
|
d->type = xsd_strdup(synth);
|
|
2465
|
+
/* #1936 (stE): the fixed VALUE constraint rides
|
|
2466
|
+
* the decl whatever the type shape — inline
|
|
2467
|
+
* anonymous types used to lose it entirely. */
|
|
2468
|
+
d->fixed = xsd_strdup(
|
|
2469
|
+
leptris_element_attribute((LeptrisElement)n,
|
|
2470
|
+
"fixed"));
|
|
2465
2471
|
const char* sg = leptris_element_attribute(
|
|
2466
2472
|
(LeptrisElement)n, "substitutionGroup");
|
|
2467
2473
|
if (sg) {
|
|
@@ -510,7 +510,41 @@ static int facet_check_body(const XsdSimple* s, const char* v,
|
|
|
510
510
|
const char* terminal_base, int chain_is_list);
|
|
511
511
|
static int facet_check(const XsdSimple* s, const char* v,
|
|
512
512
|
const char* terminal_base, int chain_is_list) {
|
|
513
|
-
|
|
513
|
+
/* #1936 (stG010): a LIST value space is whitespace=collapse —
|
|
514
|
+
* element content arrives as "\n\tCA\n " and the enumeration
|
|
515
|
+
* /pattern facets must see the collapsed form ("CA"), not the
|
|
516
|
+
* raw text. */
|
|
517
|
+
int list_valued = chain_is_list || s->deriv == XSD_SIMPLE_LIST ||
|
|
518
|
+
(terminal_base &&
|
|
519
|
+
(strcmp(terminal_base, "xs:IDREFS") == 0 ||
|
|
520
|
+
strcmp(terminal_base, "xs:NMTOKENS") == 0 ||
|
|
521
|
+
strcmp(terminal_base, "xs:ENTITIES") == 0));
|
|
522
|
+
if (!list_valued)
|
|
523
|
+
return facet_check_body(s, v, terminal_base, chain_is_list);
|
|
524
|
+
while (*v == ' ' || *v == '\t' || *v == '\n' || *v == '\r') v++;
|
|
525
|
+
size_t n = strlen(v);
|
|
526
|
+
while (n > 0 && (v[n-1] == ' ' || v[n-1] == '\t' ||
|
|
527
|
+
v[n-1] == '\n' || v[n-1] == '\r'))
|
|
528
|
+
n--;
|
|
529
|
+
char* collapsed = (char*)malloc(n + 1);
|
|
530
|
+
if (!collapsed)
|
|
531
|
+
return facet_check_body(s, v, terminal_base, chain_is_list);
|
|
532
|
+
size_t o = 0;
|
|
533
|
+
int in_ws = 0;
|
|
534
|
+
for (size_t i = 0; i < n; i++) {
|
|
535
|
+
char ch = v[i];
|
|
536
|
+
if (ch == ' ' || ch == '\t' || ch == '\n' || ch == '\r') {
|
|
537
|
+
if (!in_ws && o) collapsed[o++] = ' ';
|
|
538
|
+
in_ws = 1;
|
|
539
|
+
} else {
|
|
540
|
+
collapsed[o++] = ch;
|
|
541
|
+
in_ws = 0;
|
|
542
|
+
}
|
|
543
|
+
}
|
|
544
|
+
if (o && collapsed[o-1] == ' ') o--;
|
|
545
|
+
collapsed[o] = 0;
|
|
546
|
+
int rc = facet_check_body(s, collapsed, terminal_base, chain_is_list);
|
|
547
|
+
free(collapsed);
|
|
514
548
|
return rc;
|
|
515
549
|
}
|
|
516
550
|
static int facet_check_body(const XsdSimple* s, const char* v,
|
|
@@ -797,13 +797,17 @@ static void validate_element(struct xsd_validator* v,
|
|
|
797
797
|
break;
|
|
798
798
|
}
|
|
799
799
|
}
|
|
800
|
-
|
|
800
|
+
/* #1936 (stE): the element's fixed VALUE constraint applies
|
|
801
|
+
* regardless of the type resolution — inline anonymous types
|
|
802
|
+
* leave eff_type NULL and used to skip the check entirely. An
|
|
803
|
+
* empty content also violates a non-empty fixed value. */
|
|
801
804
|
if (d->fixed) {
|
|
802
805
|
const char* text = leptris_element_text(elem);
|
|
803
|
-
if (text &&
|
|
806
|
+
if (text && strcmp(text, d->fixed) != 0)
|
|
804
807
|
verrfk(v, "content-model", "element", local,
|
|
805
808
|
"content does not match the fixed value");
|
|
806
809
|
}
|
|
810
|
+
if (!eff_type) return; /* anyType */
|
|
807
811
|
/* XSD 1.0 §2.6.2/§3.3.4 (moxml#433): xsi:type on the instance
|
|
808
812
|
* names the type definition this element is assessed against —
|
|
809
813
|
* it replaces the declared type and wins over XSD 1.1
|
|
@@ -394,6 +394,58 @@ TEST(XsdDatatypes, LengthFacetCountsOctetsForHexBinary) {
|
|
|
394
394
|
// an ANONYMOUS inline simpleType must validate the value against
|
|
395
395
|
// that base before its own facets — length on a list-with-length-2
|
|
396
396
|
// counts items, not characters of the whole lexical.
|
|
397
|
+
// leptris#1936 (stG010/stH005, the REAL suite documents): a list
|
|
398
|
+
// value space is whitespace=collapse — element content "\n\tCA\n "
|
|
399
|
+
// normalizes to "CA" before the enumeration/pattern facets run.
|
|
400
|
+
// leptris#1936 (the reV family, 39 rows): XSD \w is the COMPLEMENT
|
|
401
|
+
// of punctuation/separators/controls — letters (U+1D7C9 Lo), marks
|
|
402
|
+
// (U+20DD Me), No (U+00B2), Sm (U+2044), Sc (U+20A0) are all word
|
|
403
|
+
// chars, so \W must reject them; \W matches real punctuation.
|
|
404
|
+
TEST(XsdDatatypes, WComplementCoversUnicodeWordChars) {
|
|
405
|
+
const char xsd[] =
|
|
406
|
+
"<xs:schema xmlns:xs=\"http://www.w3.org/2001/XMLSchema\">"
|
|
407
|
+
"<xs:simpleType name=\"nonWord\"><xs:restriction base=\"xs:string\">"
|
|
408
|
+
"<xs:pattern value=\"\\W\"/></xs:restriction></xs:simpleType>"
|
|
409
|
+
"<xs:element name=\"r\" type=\"nonWord\"/></xs:schema>";
|
|
410
|
+
LeptrisStatus st = LEPTRIS_OK;
|
|
411
|
+
LeptrisXsdSchema s = leptris_xsd_compile(xsd, strlen(xsd), &st);
|
|
412
|
+
ASSERT_EQ(st, LEPTRIS_OK);
|
|
413
|
+
ASSERT_NE(s, (LeptrisXsdSchema)0);
|
|
414
|
+
#ifdef LEPTRIS_HAS_UTF8PROC
|
|
415
|
+
/* The complement runs over the utf8proc categories; builds
|
|
416
|
+
* without the tables keep the ASCII word set (documented
|
|
417
|
+
* degradation), so these rows are capability-pinned. */
|
|
418
|
+
EXPECT_EQ(leptris_xsd_simple_valid(s, "nonWord", "\xF0\x9D\x9F\x89"), 0); // U+1D7C9 Lo
|
|
419
|
+
EXPECT_EQ(leptris_xsd_simple_valid(s, "nonWord", "\xE2\x83\x9D"), 0); // U+20DD Me
|
|
420
|
+
EXPECT_EQ(leptris_xsd_simple_valid(s, "nonWord", "\xC2\xB2"), 0); // U+00B2 No
|
|
421
|
+
EXPECT_EQ(leptris_xsd_simple_valid(s, "nonWord", "\xE2\x81\x84"), 0); // U+2044 Sm
|
|
422
|
+
EXPECT_EQ(leptris_xsd_simple_valid(s, "nonWord", "\xE2\x82\xA0"), 0); // U+20A0 Sc
|
|
423
|
+
#endif
|
|
424
|
+
EXPECT_EQ(leptris_xsd_simple_valid(s, "nonWord", "#"), 1); // real punct
|
|
425
|
+
EXPECT_EQ(leptris_xsd_simple_valid(s, "nonWord", " "), 1); // separator
|
|
426
|
+
leptris_xsd_free(s);
|
|
427
|
+
}
|
|
428
|
+
|
|
429
|
+
TEST(XsdDatatypes, ListValueSpaceCollapsesBeforeFacets) {
|
|
430
|
+
const char xsd[] =
|
|
431
|
+
"<xs:schema xmlns:xs=\"http://www.w3.org/2001/XMLSchema\">"
|
|
432
|
+
"<xs:simpleType name=\"myToken\"><xs:list itemType=\"xs:NMTOKEN\"/>"
|
|
433
|
+
"</xs:simpleType>"
|
|
434
|
+
"<xs:simpleType name=\"fooType\"><xs:restriction base=\"myToken\">"
|
|
435
|
+
"<xs:enumeration value=\"CA\"/><xs:enumeration value=\"OR\"/>"
|
|
436
|
+
"</xs:restriction></xs:simpleType>"
|
|
437
|
+
"<xs:element name=\"r\" type=\"fooType\"/></xs:schema>";
|
|
438
|
+
LeptrisStatus st = LEPTRIS_OK;
|
|
439
|
+
LeptrisXsdSchema s = leptris_xsd_compile(xsd, strlen(xsd), &st);
|
|
440
|
+
ASSERT_EQ(st, LEPTRIS_OK);
|
|
441
|
+
ASSERT_NE(s, (LeptrisXsdSchema)0);
|
|
442
|
+
EXPECT_EQ(leptris_xsd_simple_valid(s, "fooType", "\n\tCA\n "), 1);
|
|
443
|
+
EXPECT_EQ(leptris_xsd_simple_valid(s, "fooType", "CA"), 1);
|
|
444
|
+
EXPECT_EQ(leptris_xsd_simple_valid(s, "fooType", " OR "), 1);
|
|
445
|
+
EXPECT_EQ(leptris_xsd_simple_valid(s, "fooType", "CA OR"), 0);
|
|
446
|
+
leptris_xsd_free(s);
|
|
447
|
+
}
|
|
448
|
+
|
|
397
449
|
TEST(XsdDatatypes, RestrictionInlineBaseDrivesFacets) {
|
|
398
450
|
const char xsd[] =
|
|
399
451
|
"<xs:schema xmlns:xs=\"http://www.w3.org/2001/XMLSchema\">"
|
|
@@ -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.
|
|
4
|
+
"version": "1.9.402",
|
|
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,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: leptris
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 1.9.
|
|
4
|
+
version: 1.9.402.0
|
|
5
5
|
platform: aarch64-linux
|
|
6
6
|
authors:
|
|
7
7
|
- Ribose Inc.
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: bin
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2026-11-
|
|
11
|
+
date: 2026-11-02 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: ffi
|