yeptris 0.6.62.1-arm-linux-eabihf → 0.6.63.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 +4 -4
- data/ext/yeptris_native/version.h +2 -2
- data/lib/yeptris/psych/visitors.rb +13 -1
- data/lib/yeptris/yaml.rb +12 -6
- data/lib/yeptris.rb +1 -1
- data/libyeptris.so +0 -0
- data/vendor/libyeptris/CMakeLists.txt +1 -1
- data/vendor/libyeptris/src/yeptris/emit/writer.c +94 -8
- 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: 7bdc4f9439e1cd5786ba939362279a1325f3508f1f91604658dc6d2c17aa5ac1
|
|
4
|
+
data.tar.gz: a797f2cdae6c07d91b4f39ae6742fd326529b1c3b8b06c2082fb9b8e40b9a6c4
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 7376c18621a948acd18e08c193c370dc35bd4293ff1804c6dcf12d02f596197ad8410fe4c2b7bc5c7fe3e14a05da10ed7e2b0e5e6d0c13de2c059e186454d26e
|
|
7
|
+
data.tar.gz: a27a6a32e9219d2d39b33a76fcde8863a49afb663fd8dd6bfaaee4698dc1c112f7900eeb8af85db22d5159a702fa1a54f453b0d49088ca48e2e5a340d1ded36c
|
|
@@ -11,8 +11,8 @@
|
|
|
11
11
|
|
|
12
12
|
#define YEPTRIS_VERSION_MAJOR 0
|
|
13
13
|
#define YEPTRIS_VERSION_MINOR 6
|
|
14
|
-
#define YEPTRIS_VERSION_PATCH
|
|
15
|
-
#define YEPTRIS_VERSION_STRING "0.6.
|
|
14
|
+
#define YEPTRIS_VERSION_PATCH 63
|
|
15
|
+
#define YEPTRIS_VERSION_STRING "0.6.63"
|
|
16
16
|
|
|
17
17
|
#ifdef __cplusplus
|
|
18
18
|
extern "C" {
|
|
@@ -229,7 +229,19 @@ module Yeptris
|
|
|
229
229
|
key_node.set_tag("tag:yaml.org,2002:str")
|
|
230
230
|
m.map_add_node(key_node, visit(v))
|
|
231
231
|
else
|
|
232
|
-
|
|
232
|
+
# String keys ride psych's ONE visit_String law (the
|
|
233
|
+
# reshape words quote in key position too: "n": 1,
|
|
234
|
+
# 'yes': ... — #1264's premise had the psych side
|
|
235
|
+
# inverted; stdlib quotes these keys on every version
|
|
236
|
+
# since 4.0.2). Symbols stay :sym text (never through
|
|
237
|
+
# visit_String), matching stdlib.
|
|
238
|
+
key_node =
|
|
239
|
+
if k.is_a?(::String)
|
|
240
|
+
::Yeptris::YAML::Builder.build_string(@tree, k)
|
|
241
|
+
else
|
|
242
|
+
@tree.new_scalar(key_text(k), :plain)
|
|
243
|
+
end
|
|
244
|
+
m.map_add_node(key_node, visit(v))
|
|
233
245
|
end
|
|
234
246
|
end
|
|
235
247
|
m
|
data/lib/yeptris/yaml.rb
CHANGED
|
@@ -414,7 +414,14 @@ module Yeptris
|
|
|
414
414
|
blob << "!!str"
|
|
415
415
|
off[0] += 5
|
|
416
416
|
elsif k.is_a?(String)
|
|
417
|
-
|
|
417
|
+
# keys ride psych's ONE visit_String law — stdlib applies
|
|
418
|
+
# it to keys and values alike, so the reshape words quote
|
|
419
|
+
# in BOTH positions ("n": 1, 'yes': ...; #1264's premise
|
|
420
|
+
# had the psych side inverted: stdlib quotes these keys
|
|
421
|
+
# on every version since 4.0.2). The engine's own
|
|
422
|
+
# plain-key-safety re-check still guards the position.
|
|
423
|
+
style = STYLE_BY_NAME[string_style(k)]
|
|
424
|
+
scalar(k, style, emit, blob, off)
|
|
418
425
|
else
|
|
419
426
|
scalar(k.to_s, STYLE_PLAIN, emit, blob, off)
|
|
420
427
|
end
|
|
@@ -537,11 +544,10 @@ module Yeptris
|
|
|
537
544
|
return :double if !s.empty? && !s.include?('"') && s.match?(/\A[^[:word:]]/)
|
|
538
545
|
return :single if s.match?(/\A0[0-7]*[89]/)
|
|
539
546
|
return :plain if plain_string?(s)
|
|
540
|
-
#
|
|
541
|
-
#
|
|
542
|
-
#
|
|
543
|
-
#
|
|
544
|
-
return :double if s.each_byte.any? { |b| b < 0x20 || b == 0x7f }
|
|
547
|
+
# \n and \r are BREAKS in libyaml, not specials - the emitter's
|
|
548
|
+
# single-quoted law carries them ('x y z\n\n ': single_quoted_
|
|
549
|
+
# allowed survives line breaks, #1264's family A); other C0
|
|
550
|
+
# bytes and DEL need the escapes
|
|
545
551
|
return :double if s.match?(/[\u0085\u2028\u2029\uFEFF]/)
|
|
546
552
|
:single
|
|
547
553
|
end
|
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.63.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
|
|
@@ -372,8 +372,11 @@ static void emit_sq(yep_writer* w, const char* p, uint32_t n) {
|
|
|
372
372
|
* indent to parent_indent + best_indent for the scalar's own lines).
|
|
373
373
|
* The folded bodies carry no breaks by construction: sc_route sends
|
|
374
374
|
* multiline content to DQ/literal, so the walk only decides on ' '
|
|
375
|
-
* (IS_SPACE — a tab is content).
|
|
376
|
-
*
|
|
375
|
+
* (IS_SPACE — a tab is content). EXCEPTION (#1268): single-quoted
|
|
376
|
+
* bodies may carry breaks when the value is single-able (no
|
|
377
|
+
* space_break/break_space/specials) — emit_sq_folded renders those
|
|
378
|
+
* breaks per libyaml's write_single_quoted. Columns are BYTES, matching
|
|
379
|
+
* the engine's existing 13B flow fold; libyaml counts characters, so
|
|
377
380
|
* multi-byte content folds at slightly different points (documented
|
|
378
381
|
* divergence, ASCII input folds byte-identically). */
|
|
379
382
|
|
|
@@ -410,14 +413,64 @@ static void emit_plain_folded(yep_writer* w, const char* p, uint32_t n, int fold
|
|
|
410
413
|
}
|
|
411
414
|
}
|
|
412
415
|
|
|
416
|
+
/* libyaml's single_quoted_allowed predicate (emitter.c analyze):
|
|
417
|
+
* disabled ONLY by special characters, a space immediately before a
|
|
418
|
+
* break (space_break), or a break immediately followed by a space
|
|
419
|
+
* (break_space). line_breaks and trailing_space do NOT kill it — so a
|
|
420
|
+
* trailing-newline scalar like "x y z\n" rides single-quoted in
|
|
421
|
+
* libyaml/psych ('x y z\n\n '), not double-quoted. */
|
|
422
|
+
static int writer_sq_allowed(const char* p, uint32_t n) {
|
|
423
|
+
uint32_t i;
|
|
424
|
+
for (i = 0; i < n; i++) {
|
|
425
|
+
unsigned char c = (unsigned char)p[i];
|
|
426
|
+
if (c < 0x20 && c != '\n' && c != '\r') {
|
|
427
|
+
return 0; /* special characters (the breaks ride the two
|
|
428
|
+
adjacency checks below) */
|
|
429
|
+
}
|
|
430
|
+
if (c == 0x7f) {
|
|
431
|
+
return 0;
|
|
432
|
+
}
|
|
433
|
+
if (c == ' ' && i + 1 < n && (p[i + 1] == '\n' || p[i + 1] == '\r')) {
|
|
434
|
+
return 0; /* space_break */
|
|
435
|
+
}
|
|
436
|
+
if ((c == '\n' || c == '\r') && i + 1 < n && p[i + 1] == ' ') {
|
|
437
|
+
return 0; /* break_space */
|
|
438
|
+
}
|
|
439
|
+
}
|
|
440
|
+
return 1;
|
|
441
|
+
}
|
|
442
|
+
|
|
413
443
|
/* The single-quoted twin: '' doubling rides the same walk (a doubled
|
|
414
444
|
* apostrophe is two written bytes; the column tracking through wr_put
|
|
415
|
-
* prices it in automatically).
|
|
445
|
+
* prices it in automatically). Content breaks render libyaml's
|
|
446
|
+
* write_single_quoted law: the first '\n' of a run writes an extra
|
|
447
|
+
* break (single-quoted clips one raw newline per content newline on
|
|
448
|
+
* re-parse), each break byte writes as-is, the byte after a break run
|
|
449
|
+
* re-indents to the fold column, and a trailing break re-indents
|
|
450
|
+
* before the closing quote (#1268: 'x y z\n\n '). */
|
|
416
451
|
static void emit_sq_folded(yep_writer* w, const char* p, uint32_t n, int fold_col) {
|
|
417
452
|
wr_byte(w, '\'');
|
|
418
453
|
uint32_t run = 0;
|
|
419
454
|
uint32_t i = 0;
|
|
455
|
+
int breaks = 0;
|
|
420
456
|
while (i < n) {
|
|
457
|
+
if (p[i] == '\n' || p[i] == '\r') {
|
|
458
|
+
if (run) {
|
|
459
|
+
wr_put(w, p + i - run, run);
|
|
460
|
+
run = 0;
|
|
461
|
+
}
|
|
462
|
+
if (!breaks && p[i] == '\n') {
|
|
463
|
+
wr_byte(w, '\n');
|
|
464
|
+
}
|
|
465
|
+
wr_byte(w, p[i]);
|
|
466
|
+
breaks = 1;
|
|
467
|
+
i++;
|
|
468
|
+
continue;
|
|
469
|
+
}
|
|
470
|
+
if (breaks) {
|
|
471
|
+
wr_indent(w, fold_col);
|
|
472
|
+
breaks = 0;
|
|
473
|
+
}
|
|
421
474
|
if (p[i] == '\'') {
|
|
422
475
|
if (run) {
|
|
423
476
|
wr_put(w, p + i - run, run);
|
|
@@ -440,7 +493,9 @@ static void emit_sq_folded(yep_writer* w, const char* p, uint32_t n, int fold_co
|
|
|
440
493
|
i++;
|
|
441
494
|
run++;
|
|
442
495
|
}
|
|
443
|
-
if (
|
|
496
|
+
if (breaks) {
|
|
497
|
+
wr_indent(w, fold_col);
|
|
498
|
+
} else if (run) {
|
|
444
499
|
wr_put(w, p + n - run, run);
|
|
445
500
|
}
|
|
446
501
|
wr_byte(w, '\'');
|
|
@@ -732,17 +787,33 @@ static uint8_t sc_route(yep_writer* w, const char* p, uint32_t len, int as_key,
|
|
|
732
787
|
int multiline = (len > 0 && memchr(p, '\n', len) != NULL);
|
|
733
788
|
int blockable = 0;
|
|
734
789
|
if (multiline && !as_key) {
|
|
790
|
+
/* libyaml's block_allowed law: trailing_space (a trailing
|
|
791
|
+
* blank), space_break (a blank immediately before a break) and
|
|
792
|
+
* special characters kill the block forms (#1264's family-A
|
|
793
|
+
* control: "x \ny" stays DQ, not `|-` with a trailing-space
|
|
794
|
+
* line); the all-whitespace and CR exclusions are the
|
|
795
|
+
* engine's established law */
|
|
735
796
|
int allws = 1;
|
|
736
797
|
int has_cr = 0;
|
|
798
|
+
int space_break = 0;
|
|
799
|
+
int trailing_blank = 0;
|
|
737
800
|
for (uint32_t i = 0; i < len; i++) {
|
|
738
|
-
|
|
801
|
+
unsigned char c = (unsigned char)p[i];
|
|
802
|
+
if (c != ' ' && c != '\t' && c != '\n' && c != '\r') {
|
|
739
803
|
allws = 0;
|
|
740
804
|
}
|
|
741
|
-
if (
|
|
805
|
+
if (c == '\r') {
|
|
742
806
|
has_cr = 1;
|
|
743
807
|
}
|
|
808
|
+
if ((c == ' ' || c == '\t') && i + 1 < len && (p[i + 1] == '\n' || p[i + 1] == '\r')) {
|
|
809
|
+
space_break = 1;
|
|
810
|
+
}
|
|
811
|
+
}
|
|
812
|
+
if (len > 0) {
|
|
813
|
+
unsigned char last = (unsigned char)p[len - 1];
|
|
814
|
+
trailing_blank = last == ' ' || last == '\t';
|
|
744
815
|
}
|
|
745
|
-
blockable = !allws && !has_cr;
|
|
816
|
+
blockable = !allws && !has_cr && !space_break && !trailing_blank;
|
|
746
817
|
}
|
|
747
818
|
uint8_t sty = sty_in;
|
|
748
819
|
if (sty == 4 || sty == 5) {
|
|
@@ -799,9 +870,24 @@ static uint8_t sc_route(yep_writer* w, const char* p, uint32_t len, int as_key,
|
|
|
799
870
|
}
|
|
800
871
|
return YEP_SC_SQ;
|
|
801
872
|
}
|
|
873
|
+
/* libyaml's analyze keeps single_quoted_allowed through plain
|
|
874
|
+
* line breaks (only special_characters/space_break/break_space
|
|
875
|
+
* kill it), so a multiline plain-unsafe VALUE rides
|
|
876
|
+
* single-quoted — psych's 'x y z\n\n ' shape (#1268). Keys
|
|
877
|
+
* never go multiline-simple, and flow bodies ride the
|
|
878
|
+
* breakless emit_sq, so both stay DQ. */
|
|
879
|
+
if (!as_key && !w->in_flow && writer_sq_allowed(p, len)) {
|
|
880
|
+
return YEP_SC_SQ;
|
|
881
|
+
}
|
|
802
882
|
return YEP_SC_DQ;
|
|
803
883
|
case 2:
|
|
804
|
-
|
|
884
|
+
if (!multiline) {
|
|
885
|
+
return YEP_SC_SQ;
|
|
886
|
+
}
|
|
887
|
+
if (!as_key && !w->in_flow && writer_sq_allowed(p, len)) {
|
|
888
|
+
return YEP_SC_SQ;
|
|
889
|
+
}
|
|
890
|
+
return YEP_SC_DQ;
|
|
805
891
|
default:
|
|
806
892
|
return YEP_SC_DQ;
|
|
807
893
|
}
|