yeptris 0.6.36.0-arm-linux-eabihf → 0.6.38.0-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: f66c1643edcda6eba3086c332c967a59ce9b04175d2fb7f98f468cf4326319f4
4
- data.tar.gz: 5ecef3fe6e04298e507ffdee8762ab02cc95752f366ca25adea27f3d56246086
3
+ metadata.gz: fd9a7587fab7e1d0fe6a3839608cacbad5f5d13af7a04717cb87df72e57057ca
4
+ data.tar.gz: 803d91d2ad6487880f97c7921fb534fa46baa12392f157f749b50e6d92a6c53d
5
5
  SHA512:
6
- metadata.gz: e03bca368d020c5358c7f870b792b584982bfde46f20cf1efa37327c8e8c0f19cbbd2047b6fe0aa9f06aca6bfa5984065ab049c21d38438ef09848a35d16a361
7
- data.tar.gz: b61301d36a1743bd89c0210468994e4e280b9a1d2b25031f4db96d0c0caa6d10c72694528ef64a596e3b2686538695bf514e5632a778bd2938c51171e671b645
6
+ metadata.gz: 21b4b4cde8992df2336c4166b9f0e7e08adbd3922c16e882087e78e59a27bda4286fe869cc030176428936b7c4be688a3e471517e4a95eb42330444ccbb78528
7
+ data.tar.gz: e3ab0a67aff29b1f585c7f86f5c3309228028407bcfdd15376381fdefbd454b9652af13b889f3f6c9a59eea63d9f5fbfed036b5102c9aecc91a986b5cf890d73
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.36.0".freeze
6
+ VERSION = "0.6.38.0".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.36
6
+ VERSION 0.6.38
7
7
  DESCRIPTION "Ultra-fast YAML 1.2 parser, emitter and streamer in C"
8
8
  LANGUAGES C CXX
9
9
  )
@@ -346,7 +346,37 @@ static void emit_literal(yep_writer* w, const yep_dnode* n, int parent_col) {
346
346
  wr_indent(w, pad);
347
347
  }
348
348
  }
349
- for (uint32_t i = 0; i < trail; i++) {
349
+ /* The reader swallows the own break of a WHITESPACE-ONLY
350
+ * more-indented last line ("|+\n:\n \t\n\n\n" reads trail=2), so
351
+ * the spelling needs one extra break there -- written N reads N-1
352
+ * (the nightly's round 32, crash-90c98918: pass1
353
+ * "|+\n :\n \t\n\n" re-parsed one break short and the second
354
+ * pass emitted clip). A regular last line reads 1:1. */
355
+ uint32_t ls = body;
356
+ while (ls > 0 && p[ls - 1] != '\n') {
357
+ ls--;
358
+ }
359
+ int tab_last = 0;
360
+ int ws_last = 1;
361
+ for (uint32_t i = ls; i < body; i++) {
362
+ if (p[i] == '\t') {
363
+ tab_last = 1;
364
+ } else if (p[i] != ' ') {
365
+ ws_last = 0;
366
+ break;
367
+ }
368
+ }
369
+ /* the reader swallows the own break of a whitespace-only last line
370
+ * that carries a TAB (the tab-indent law shifts the line's content
371
+ * start): "|+\n:\n \t\n\n\n" reads trail=2 where a spaces-only
372
+ * line reads 1:1 (the nightly's round 32, crash-90c98918: pass1
373
+ * "|+\n :\n \t\n\n" re-parsed one break short and the second
374
+ * pass emitted clip). One extra break spells the tab case — and
375
+ * ONLY that case: a CONTENT last line that merely carries a tab
376
+ * ("|+\n \t:\n..." — the round-33 composite, crash-306b67eb)
377
+ * reads its own break 1:1, and the extra break made the value
378
+ * GROW one break per pass. */
379
+ for (uint32_t i = 0; i < trail + ((tab_last && ws_last) ? 1 : 0); i++) {
350
380
  wr_byte(w, '\n');
351
381
  }
352
382
  }
@@ -663,6 +693,19 @@ static void emit_anchor_ex(yep_emitter* em, const yep_dnode* n) {
663
693
  if (n->anchor.len == 0) {
664
694
  return;
665
695
  }
696
+ /* A name ending in ':' rides or separates context-dependently
697
+ * (2SXE): spelled directly before a collection ("&: [[]]", the
698
+ * nightly's round 31, crash-66a513ea; "k: &: [[1]]" fails its own
699
+ * re-parse the same way) every spelling re-lexes differently --
700
+ * the riding/yield law reads the colon as the key indicator at
701
+ * the follower, so the tree changes or the parse dies. A scalar
702
+ * node keeps riding raw ("k: &n: v" round-trips byte-stably).
703
+ * There is no spell for the collection form: fail the serialize. */
704
+ yep_view chk = wv(w, n->anchor);
705
+ if (n->kind != 0 && chk.len > 0 && chk.p[chk.len - 1] == ':') {
706
+ w->unserializable = 1;
707
+ return;
708
+ }
666
709
  wr_byte(w, '&');
667
710
  yep_view adec = wv(w, n->anchor);
668
711
  if (w->canonical) {
@@ -1275,6 +1275,36 @@ static void e_props(yep_engine* e, yep_view* anchor, yep_view* tag) {
1275
1275
  e_fail(e, YEP_ERR_UNEXPECTED, e->pos);
1276
1276
  return;
1277
1277
  }
1278
+ /* The flow-follower colon law (the nightly's round 29,
1279
+ * crash-47eb4054; the block-header twin is round 31,
1280
+ * crash-4cbeede1): a name ending at a riding colon whose
1281
+ * follower is a FLOW collection or a BLOCK SCALAR HEADER
1282
+ * un-consumes the colon. libyaml ACCEPTS "&k2: [1,\n2]"
1283
+ * and "&kk: |\n x" — the anchor names the implicit-null
1284
+ * KEY and the collection/scalar is the value — so the
1285
+ * riding law (2SXE) must yield exactly where its result
1286
+ * is observable in the differential; the plain-led twins
1287
+ * keep it (libyaml rejects those: "&a: key: v", W5VH's
1288
+ * value position — suite-VALID, ledgered). The colon
1289
+ * re-lexes as the key indicator and the existing colon
1290
+ * arm builds the anchored null key. */
1291
+ if (e->p[e->pos - 1] == ':') {
1292
+ /* the follower scan crosses blanks AND breaks: the
1293
+ * pair separator at line end still opens the value on
1294
+ * the next line ("&k:\n {\n}" — the nightly's round
1295
+ * 31, crash-c2232e17 — rode the colon and DROPPED the
1296
+ * flow map outright) */
1297
+ size_t t = e->pos;
1298
+ while (t < e->len &&
1299
+ (e->p[t] == ' ' || e->p[t] == '\t' || e->p[t] == '\n' || e->p[t] == '\r')) {
1300
+ t++;
1301
+ }
1302
+ if (t < e->len &&
1303
+ (e->p[t] == '[' || e->p[t] == '{' || e->p[t] == '|' || e->p[t] == '>')) {
1304
+ anchor->len -= 1;
1305
+ e->pos -= 1;
1306
+ }
1307
+ }
1278
1308
  if (e->pos < e->len && e->p[e->pos] == '#') {
1279
1309
  /* the name ends at a blank or flow indicator; a glued
1280
1310
  * '#' is junk on the name (libyaml: "did not find
@@ -4942,7 +4972,26 @@ static size_t step_scan(yep_stepstate* st) {
4942
4972
  st->bs_indent = (uint32_t)-1; /* root rule: markers only */
4943
4973
  }
4944
4974
  }
4945
- if (st->saw_directive == 0 && i > 0 && !st->bs_open) {
4975
+ /* the line before a marker must not be a
4976
+ * directive-LOOKING line: the scan's quote
4977
+ * state can close a quote where the parser
4978
+ * reads content (or vice versa), so a %-led
4979
+ * line may ride an open quote the scan
4980
+ * believes in -- cutting then strands the
4981
+ * directive from its --- and the window
4982
+ * rejects it (the nightly's round 27,
4983
+ * crash-95bbd95f: "i\n\"\n...\n%TAG ! \"\n--- ").
4984
+ * The check is byte-level, independent of the
4985
+ * quote tracking's verdict. */
4986
+ int prev_pct = 0;
4987
+ if (i > 0) {
4988
+ size_t ls = i - 1; /* the break before the marker */
4989
+ while (ls > 0 && p[ls - 1] != '\n' && p[ls - 1] != '\r') {
4990
+ ls--;
4991
+ }
4992
+ prev_pct = p[ls] == '%';
4993
+ }
4994
+ if (st->saw_directive == 0 && i > 0 && !st->bs_open && !prev_pct) {
4946
4995
  last_cut = i; /* interior document boundary */
4947
4996
  }
4948
4997
  st->saw_directive = 0; /* this --- owns the directives */
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.36.0
4
+ version: 0.6.38.0
5
5
  platform: arm-linux-eabihf
6
6
  authors:
7
7
  - Ribose Inc.