yeptris 0.6.24.1-powerpc64le-linux → 0.6.26.1-powerpc64le-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/lib/yeptris.rb +1 -1
- data/libyeptris.so +0 -0
- data/vendor/libyeptris/CMakeLists.txt +1 -1
- data/vendor/libyeptris/src/yeptris/events/recorder.c +6 -0
- data/vendor/libyeptris/src/yeptris/parse/engine.c +42 -4
- data/vendor/libyeptris/src/yeptris/parse/engine.h +11 -0
- data/vendor/libyeptris/src/yeptris/parse.c +20 -0
- metadata +1 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: c59efedaae6f0032e4760b264b53e7b5e7e86e534c98aa92cf9a651a74495ec1
|
|
4
|
+
data.tar.gz: '042820ce831e8a9b7e5a28ce1bd6c5a134f2fefd44e3fb893a1e724c2d8ff6cb'
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 5fed3be9dd11edd390a928c71e46ec4b974269a5bf9f77f0c03f4e5073446615b60680f1d4e4a91a0b5f377f0c84200335198e372862894f8827704d107773d7
|
|
7
|
+
data.tar.gz: 9df3205d7ee5f20c51e1593001fc92bc224f27af65495ac368e775e390b7d4c4b68fcb8b0bbeb065165623aee58cc021b3f6be4f5cbdd7f2aea20c3ce484882a
|
data/lib/yeptris.rb
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
module Yeptris
|
|
4
4
|
# The gem's version lives in the parent namespace's file — the last
|
|
5
5
|
# internal require (yeptris/version) retired with it.
|
|
6
|
-
VERSION = "0.6.
|
|
6
|
+
VERSION = "0.6.26.1".freeze
|
|
7
7
|
|
|
8
8
|
# Informational notices are OPT-IN (yeptris-ruby#217): consumers
|
|
9
9
|
# embed yeptris inside CLIs that assert clean stderr, and a
|
data/libyeptris.so
CHANGED
|
Binary file
|
|
@@ -52,6 +52,12 @@ YEPTRIS_API YeptrisStatus yeptris_recorder_feed(YeptrisRecorder rec, const char*
|
|
|
52
52
|
}
|
|
53
53
|
yep_engine_set_resolver(rec->eng,
|
|
54
54
|
rec->compat11 ? yep_resolver_compat11() : yep_resolver_core12());
|
|
55
|
+
/* the compat schema is the psych/libyaml surface: its grammar
|
|
56
|
+
* must accept what libyaml accepts (the flow indent floor is
|
|
57
|
+
* suite-strict, not libyaml — see yep_engine_set_compat_grammar;
|
|
58
|
+
* the recorder is the py safe_load path, which rode the floor
|
|
59
|
+
* and rejected multi-line flows #431 fixed everywhere else) */
|
|
60
|
+
yep_engine_set_compat_grammar(rec->eng, rec->compat11);
|
|
55
61
|
}
|
|
56
62
|
if (final) {
|
|
57
63
|
rec->final_fed = 1;
|
|
@@ -3179,10 +3179,46 @@ yep_engine* yep_engine_create(const yep_allocator* sys) {
|
|
|
3179
3179
|
* input is copied with each normalized to a single '\n' (libyaml reader
|
|
3180
3180
|
* behavior); inputs without them keep the zero-copy path. */
|
|
3181
3181
|
static const char* e_normalize_breaks(yep_engine* e, const char* p, size_t len) {
|
|
3182
|
+
char* out = yep_engine_normalize_breaks(e->sys, p, len, NULL);
|
|
3183
|
+
if (out == NULL) {
|
|
3184
|
+
return p;
|
|
3185
|
+
}
|
|
3186
|
+
e->norm_buf = out;
|
|
3187
|
+
return out;
|
|
3188
|
+
}
|
|
3189
|
+
|
|
3190
|
+
/* The NEL/LS/PS -> '\n' copy (the one-shot path rides this BEFORE the
|
|
3191
|
+
* engine so the normalized bytes own the document's `transcoded` slot;
|
|
3192
|
+
* the engine's per-feed copy stays for the streaming feeds). Returns
|
|
3193
|
+
* NULL when the input has no exotic break. */
|
|
3194
|
+
/* The two possible LEAD bytes of a Unicode break (NEL = C2 85; LS/PS =
|
|
3195
|
+
* E2 80 A8/A9). The whole-document probe rides the SIMD stopset kernel
|
|
3196
|
+
* and only candidates get the byte check — the per-byte walk was 11%
|
|
3197
|
+
* of every parse (exclusive profile, block-heavy DOM, 2026-09-27).
|
|
3198
|
+
* Pinned against yep_stopset_init by Parse.NormBreakLeadsMatchRuntimeBuild. */
|
|
3199
|
+
const yep_stopset yep_norm_break_leads = {
|
|
3200
|
+
.bitmap = {0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
|
3201
|
+
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
|
3202
|
+
0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00},
|
|
3203
|
+
.groups = 1,
|
|
3204
|
+
.lo = {{0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
|
3205
|
+
0x00, 0x00}},
|
|
3206
|
+
.hi = {{0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00,
|
|
3207
|
+
0x02, 0x00}},
|
|
3208
|
+
};
|
|
3209
|
+
|
|
3210
|
+
char* yep_engine_normalize_breaks(const yep_allocator* sys, const char* p, size_t len,
|
|
3211
|
+
size_t* out_len) {
|
|
3182
3212
|
const unsigned char* q = (const unsigned char*)p;
|
|
3213
|
+
const yep_text_kernels* k = yep_text_active();
|
|
3183
3214
|
size_t i = 0;
|
|
3184
3215
|
int found = 0;
|
|
3185
3216
|
while (i < len) {
|
|
3217
|
+
ptrdiff_t hit = k->stopset_find(&yep_norm_break_leads, (const char*)q + i, len - i);
|
|
3218
|
+
if (hit < 0) {
|
|
3219
|
+
break;
|
|
3220
|
+
}
|
|
3221
|
+
i += (size_t)hit;
|
|
3186
3222
|
if (q[i] == 0xC2 && i + 1 < len && q[i + 1] == 0x85) {
|
|
3187
3223
|
found = 1;
|
|
3188
3224
|
break;
|
|
@@ -3195,11 +3231,11 @@ static const char* e_normalize_breaks(yep_engine* e, const char* p, size_t len)
|
|
|
3195
3231
|
i++;
|
|
3196
3232
|
}
|
|
3197
3233
|
if (!found) {
|
|
3198
|
-
return
|
|
3234
|
+
return NULL;
|
|
3199
3235
|
}
|
|
3200
|
-
char* out = yep_alloc(
|
|
3236
|
+
char* out = yep_alloc(sys, len + 1);
|
|
3201
3237
|
if (out == NULL) {
|
|
3202
|
-
return
|
|
3238
|
+
return NULL;
|
|
3203
3239
|
}
|
|
3204
3240
|
size_t o = 0;
|
|
3205
3241
|
for (size_t j = 0; j < len;) {
|
|
@@ -3215,7 +3251,9 @@ static const char* e_normalize_breaks(yep_engine* e, const char* p, size_t len)
|
|
|
3215
3251
|
}
|
|
3216
3252
|
}
|
|
3217
3253
|
out[o] = '\0';
|
|
3218
|
-
|
|
3254
|
+
if (out_len != NULL) {
|
|
3255
|
+
*out_len = o;
|
|
3256
|
+
}
|
|
3219
3257
|
return out;
|
|
3220
3258
|
}
|
|
3221
3259
|
|
|
@@ -11,6 +11,7 @@
|
|
|
11
11
|
|
|
12
12
|
#include "common/error.h"
|
|
13
13
|
#include "common/simd_text.h"
|
|
14
|
+
|
|
14
15
|
#include "memory/allocator.h"
|
|
15
16
|
#include "memory/pool.h"
|
|
16
17
|
#include "parse/events.h"
|
|
@@ -19,6 +20,9 @@
|
|
|
19
20
|
extern "C" {
|
|
20
21
|
#endif
|
|
21
22
|
|
|
23
|
+
/* Pinned by Parse.NormBreakLeadsMatchRuntimeBuild (test_parse.cpp). */
|
|
24
|
+
extern const yep_stopset yep_norm_break_leads;
|
|
25
|
+
|
|
22
26
|
typedef struct yep_engine yep_engine;
|
|
23
27
|
|
|
24
28
|
yep_engine* yep_engine_create(const yep_allocator* sys);
|
|
@@ -65,6 +69,13 @@ size_t yep_engine_pos(const yep_engine* e);
|
|
|
65
69
|
|
|
66
70
|
const yep_error* yep_engine_error(const yep_engine* e);
|
|
67
71
|
|
|
72
|
+
/* The NEL/LS/PS -> '\n' copy; NULL when the input is clean (probe rides
|
|
73
|
+
* the stopset kernel). One-shot parse runs this BEFORE the engine so
|
|
74
|
+
* the copy owns the document's transcoded slot; the engine's per-feed
|
|
75
|
+
* copy (norm_buf) stays for the streaming feeds. */
|
|
76
|
+
char* yep_engine_normalize_breaks(const yep_allocator* sys, const char* p, size_t len,
|
|
77
|
+
size_t* out_len);
|
|
78
|
+
|
|
68
79
|
#ifdef __cplusplus
|
|
69
80
|
}
|
|
70
81
|
#endif
|
|
@@ -293,6 +293,26 @@ static YeptrisDocument parse_impl(const char* buf, size_t len, const YeptrisPars
|
|
|
293
293
|
}
|
|
294
294
|
}
|
|
295
295
|
|
|
296
|
+
/* Unicode breaks (NEL/LS/PS) normalize to '\n' BEFORE the engine:
|
|
297
|
+
* the copy rides `transcoded`, whose ownership plumbing (input_base
|
|
298
|
+
* views, doc free, fail paths) already exists. Letting the engine's
|
|
299
|
+
* per-feed copy fire here returned views into ENGINE-owned memory
|
|
300
|
+
* that dies at yeptris_parse teardown — every one-shot NEL document
|
|
301
|
+
* dangled (no test ever covered one; found by the NormBreakLeads
|
|
302
|
+
* slice, 2026-09-27). JSON mode skips this: the JSON reader keeps
|
|
303
|
+
* U+0085 raw inside strings, only the YAML reader normalizes. */
|
|
304
|
+
{
|
|
305
|
+
size_t nlen = 0;
|
|
306
|
+
char* norm = yep_engine_normalize_breaks(sys, data, data_len, &nlen);
|
|
307
|
+
if (norm != NULL) {
|
|
308
|
+
yep_free(sys, transcoded);
|
|
309
|
+
transcoded = (unsigned char*)norm;
|
|
310
|
+
transcoded_len = nlen;
|
|
311
|
+
data = norm;
|
|
312
|
+
data_len = nlen;
|
|
313
|
+
}
|
|
314
|
+
}
|
|
315
|
+
|
|
296
316
|
/* Engine → DOM. */
|
|
297
317
|
yep_engine* eng = NULL;
|
|
298
318
|
engine_enter:
|