yeptris 0.6.23.1-arm-linux-eabihf → 0.6.24.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 +4 -4
- data/lib/yeptris/document.rb +10 -0
- data/lib/yeptris.rb +1 -1
- data/libyeptris.so +0 -0
- data/vendor/libyeptris/CMakeLists.txt +1 -1
- data/vendor/libyeptris/src/yeptris/events/values.c +5 -0
- data/vendor/libyeptris/src/yeptris/parse/engine.c +16 -3
- data/vendor/libyeptris/src/yeptris/parse/engine.h +7 -0
- data/vendor/libyeptris/src/yeptris/parse.c +6 -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: be7b901a161d066e748826fe3ac972c9983a52b55582fa7c89eb4331c05f49ef
|
|
4
|
+
data.tar.gz: 3ccd1a2643b5318cfcfbbeb61181d1a8cbe44ac8d8a27e7263e8cc058fb6490f
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 8db0c59bdaf18260418098039c3e0d4d2475eb0fffb912dc7f799eb2dbe56541751bb7c74c5148bb92d263074475aeea48bfae636313fe502a255e083cf247f9
|
|
7
|
+
data.tar.gz: f6a6f98cdc40ae6a040769839e6ff24458c5053a02cdae66a4e5c728755b41b4724bec6ca5f5f076b9ff395eb91acf7de220a902c4bd3ca8a9fd22d2d320691b
|
data/lib/yeptris/document.rb
CHANGED
|
@@ -17,6 +17,16 @@ class Yeptris::Document
|
|
|
17
17
|
attr_reader :parse_schema
|
|
18
18
|
|
|
19
19
|
def initialize(c_ptr = nil, freed = Freed.new(:alive), parse_schema = :core_12)
|
|
20
|
+
# The pointer is produced by the FFI parse/create calls; a nil (or
|
|
21
|
+
# non-pointer) argument is an API misuse — Document.parse and
|
|
22
|
+
# Document.create are the entry points. Fail with that guidance
|
|
23
|
+
# instead of a NoMethodError from the finalizer guard below (the
|
|
24
|
+
# FFI::Pointer#null? probe does not exist on nil).
|
|
25
|
+
unless c_ptr.is_a?(::FFI::Pointer)
|
|
26
|
+
raise ArgumentError,
|
|
27
|
+
"a document FFI pointer is required — build documents with " \
|
|
28
|
+
"Yeptris::Document.parse or Yeptris::Document.create"
|
|
29
|
+
end
|
|
20
30
|
@c_ptr = c_ptr
|
|
21
31
|
@freed = freed
|
|
22
32
|
@parse_schema = parse_schema
|
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.24.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
|
|
@@ -389,6 +389,11 @@ int yep_values_from_input(const char* yaml, size_t len, int schema_compat, yep_v
|
|
|
389
389
|
return -1;
|
|
390
390
|
}
|
|
391
391
|
yep_engine_set_resolver(eng, schema_compat ? yep_resolver_compat11() : yep_resolver_core12());
|
|
392
|
+
if (schema_compat) {
|
|
393
|
+
yep_engine_set_compat_grammar(eng, 1); /* libyaml grammar parity
|
|
394
|
+
* (the value drains ride the
|
|
395
|
+
* same compat contract) */
|
|
396
|
+
}
|
|
392
397
|
|
|
393
398
|
yep_value_ctx* c = ctx_create();
|
|
394
399
|
if (c == NULL) {
|
|
@@ -124,6 +124,13 @@ struct yep_engine {
|
|
|
124
124
|
int doc_inline; /* content node opened on the --- line */
|
|
125
125
|
uint16_t flow_floor; /* parent column of the current block-level flow */
|
|
126
126
|
int flow_enforce; /* flow continuation lines must out-indent it */
|
|
127
|
+
int compat_grammar; /* 11-COMPAT: libyaml/psych grammar parity —
|
|
128
|
+
* the flow indent floor (9C9N/VJP3) is a
|
|
129
|
+
* yaml-test-suite rule libyaml never
|
|
130
|
+
* enforced, and real-world locale files
|
|
131
|
+
* close multi-line flows at the parent's
|
|
132
|
+
* column; the floor stays on for the
|
|
133
|
+
* strict 1.2 engine the suite runs */
|
|
127
134
|
};
|
|
128
135
|
|
|
129
136
|
/* ------------------------------------------------------------ forwards */
|
|
@@ -2308,7 +2315,7 @@ static int e_shape_flow_value(yep_engine* e, const yep_line_shape* sh, uint16_t
|
|
|
2308
2315
|
yep_view none = {NULL, 0};
|
|
2309
2316
|
e->pos = sh->val_start;
|
|
2310
2317
|
e->flow_floor = floor;
|
|
2311
|
-
e->flow_enforce = (e->depth > 0);
|
|
2318
|
+
e->flow_enforce = (e->depth > 0) && !e->compat_grammar;
|
|
2312
2319
|
int fast = e_flow_json(e, none, none, 0);
|
|
2313
2320
|
e->flow_enforce = 0;
|
|
2314
2321
|
if (fast == -2) {
|
|
@@ -2735,7 +2742,7 @@ static int e_node(yep_engine* e, yep_ctx ctx, uint16_t floor_col) {
|
|
|
2735
2742
|
/* JSON fast path first: its validating scan already finds the
|
|
2736
2743
|
* close, replacing e_skip_flow's pre-scan when it applies. */
|
|
2737
2744
|
e->flow_floor = floor_col;
|
|
2738
|
-
e->flow_enforce = (e->depth > 0);
|
|
2745
|
+
e->flow_enforce = (e->depth > 0) && !e->compat_grammar;
|
|
2739
2746
|
int fast = e_flow_json(e, node_a, node_t, anchor_ordinal);
|
|
2740
2747
|
e->flow_enforce = 0;
|
|
2741
2748
|
if (fast == 1) {
|
|
@@ -2780,7 +2787,7 @@ static int e_node(yep_engine* e, yep_ctx ctx, uint16_t floor_col) {
|
|
|
2780
2787
|
}
|
|
2781
2788
|
{
|
|
2782
2789
|
e->flow_floor = floor_col;
|
|
2783
|
-
e->flow_enforce = (e->depth > 0);
|
|
2790
|
+
e->flow_enforce = (e->depth > 0) && !e->compat_grammar;
|
|
2784
2791
|
int rc = e_flow(e, node_a, node_t, node_aid);
|
|
2785
2792
|
e->flow_enforce = 0;
|
|
2786
2793
|
if (rc != 0) {
|
|
@@ -3112,6 +3119,12 @@ void yep_engine_set_resolver(yep_engine* e, const yep_resolver* r) {
|
|
|
3112
3119
|
}
|
|
3113
3120
|
}
|
|
3114
3121
|
|
|
3122
|
+
void yep_engine_set_compat_grammar(yep_engine* e, int on) {
|
|
3123
|
+
if (e != NULL) {
|
|
3124
|
+
e->compat_grammar = on != 0;
|
|
3125
|
+
}
|
|
3126
|
+
}
|
|
3127
|
+
|
|
3115
3128
|
void yep_engine_set_max_depth(yep_engine* e, int depth) {
|
|
3116
3129
|
if (e != NULL && depth > 0) {
|
|
3117
3130
|
e->max_depth = depth > YEP_MAX_DEPTH ? YEP_MAX_DEPTH : depth;
|
|
@@ -52,6 +52,13 @@ struct yep_resolver;
|
|
|
52
52
|
void yep_engine_set_resolver(yep_engine* e, const struct yep_resolver* r);
|
|
53
53
|
void yep_engine_set_max_depth(yep_engine* e, int depth);
|
|
54
54
|
|
|
55
|
+
/* The 1.1-compat grammar (libyaml/psych parity): the block-level flow
|
|
56
|
+
* indent floor (9C9N, VJP3) is a yaml-test-suite rule libyaml never
|
|
57
|
+
* enforced — real-world locale files close multi-line flow collections
|
|
58
|
+
* at their parent's column ("k: {\n a: b\n}"). Off by default (the
|
|
59
|
+
* strict 1.2 engine the conformance suite runs keeps the floor). */
|
|
60
|
+
void yep_engine_set_compat_grammar(yep_engine* e, int on);
|
|
61
|
+
|
|
55
62
|
/* Byte offset the last run reached (into that run's buffer); used by
|
|
56
63
|
* consumers that stop the engine at a boundary and resume. */
|
|
57
64
|
size_t yep_engine_pos(const yep_engine* e);
|
|
@@ -301,6 +301,12 @@ engine_enter:
|
|
|
301
301
|
yep_engine_set_resolver(eng, opts->schema == YEPTRIS_SCHEMA_11_COMPAT
|
|
302
302
|
? yep_resolver_compat11()
|
|
303
303
|
: yep_resolver_core12());
|
|
304
|
+
if (opts->schema == YEPTRIS_SCHEMA_11_COMPAT) {
|
|
305
|
+
/* the compat schema is the psych/libyaml surface: its grammar
|
|
306
|
+
* must accept what libyaml accepts (the flow floor is suite-
|
|
307
|
+
* strict, not libyaml — see yep_engine_set_compat_grammar) */
|
|
308
|
+
yep_engine_set_compat_grammar(eng, 1);
|
|
309
|
+
}
|
|
304
310
|
if (opts->max_depth > 0) {
|
|
305
311
|
yep_engine_set_max_depth(eng, opts->max_depth);
|
|
306
312
|
}
|