yeptris 0.6.24.1-arm-linux-eabihf → 0.6.26.1-arm-linux-eabihf

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: be7b901a161d066e748826fe3ac972c9983a52b55582fa7c89eb4331c05f49ef
4
- data.tar.gz: 3ccd1a2643b5318cfcfbbeb61181d1a8cbe44ac8d8a27e7263e8cc058fb6490f
3
+ metadata.gz: e47e094203051044900e0b675f67289e3b86c751c0ad2762751f57fae9f21f65
4
+ data.tar.gz: ae6b25e84793e88d8d86698df20fc17e3fd5ad19d8a52f79e7b44c36ff5a358a
5
5
  SHA512:
6
- metadata.gz: 8db0c59bdaf18260418098039c3e0d4d2475eb0fffb912dc7f799eb2dbe56541751bb7c74c5148bb92d263074475aeea48bfae636313fe502a255e083cf247f9
7
- data.tar.gz: f6a6f98cdc40ae6a040769839e6ff24458c5053a02cdae66a4e5c728755b41b4724bec6ca5f5f076b9ff395eb91acf7de220a902c4bd3ca8a9fd22d2d320691b
6
+ metadata.gz: eec0297f6dd573f5d9fd3bc1ad4bc78d553197b7b9c7129b2bf8259d47feebe72c8f2a3b130926412cbb38130fb881dba4c46695597c1f19768320b6e6287354
7
+ data.tar.gz: 800c7a3984dc1ffac1c7d61be602f6d3890ccdf595601c220bf26a66bf6b931eaccfabfa4fa030454a0ecaeb23bf7549ca4ea7c77458d824759f76a0e222b95b
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.24.1".freeze
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
@@ -3,7 +3,7 @@
3
3
  cmake_minimum_required(VERSION 3.20)
4
4
 
5
5
  project(yeptris
6
- VERSION 0.6.24
6
+ VERSION 0.6.26
7
7
  DESCRIPTION "Ultra-fast YAML 1.2 parser, emitter and streamer in C"
8
8
  LANGUAGES C CXX
9
9
  )
@@ -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 p;
3234
+ return NULL;
3199
3235
  }
3200
- char* out = yep_alloc(e->sys, len + 1);
3236
+ char* out = yep_alloc(sys, len + 1);
3201
3237
  if (out == NULL) {
3202
- return p; /* fall back: parse as-is */
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
- e->norm_buf = out;
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:
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: yeptris
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.6.24.1
4
+ version: 0.6.26.1
5
5
  platform: arm-linux-eabihf
6
6
  authors:
7
7
  - Ribose Inc.