yeptris 0.6.59.1-arm-linux-eabihf → 0.6.60.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.
Files changed (44) hide show
  1. checksums.yaml +4 -4
  2. data/ext/yeptris_native/version.h +2 -2
  3. data/lib/yeptris/3.4/native.so +0 -0
  4. data/lib/yeptris/ffi.rb +19 -0
  5. data/lib/yeptris/yaml.rb +61 -0
  6. data/lib/yeptris.rb +1 -1
  7. data/libyeptris.so +0 -0
  8. data/vendor/libyeptris/CMakeLists.txt +1 -1
  9. data/vendor/libyeptris/src/CMakeLists.txt +7 -0
  10. data/vendor/libyeptris/src/include/yeptris/emit.h +30 -2
  11. data/vendor/libyeptris/src/include/yeptris/parse.h +52 -0
  12. data/vendor/libyeptris/src/include/yeptris/resolve.h +8 -0
  13. data/vendor/libyeptris/src/include/yeptris/validate.h +222 -21
  14. data/vendor/libyeptris/src/include/yeptris/values.h +8 -2
  15. data/vendor/libyeptris/src/yeptris/cbor/cbor.h +10 -0
  16. data/vendor/libyeptris/src/yeptris/cbor/decode.c +5 -7
  17. data/vendor/libyeptris/src/yeptris/cbor/encode.c +9 -9
  18. data/vendor/libyeptris/src/yeptris/cbor/from_marshal.c +1 -1
  19. data/vendor/libyeptris/src/yeptris/common/error.h +2 -0
  20. data/vendor/libyeptris/src/yeptris/doc.h +20 -0
  21. data/vendor/libyeptris/src/yeptris/emit/emit.c +85 -13
  22. data/vendor/libyeptris/src/yeptris/emit/writer.c +158 -642
  23. data/vendor/libyeptris/src/yeptris/emit/writer.h +15 -1
  24. data/vendor/libyeptris/src/yeptris/events/push.c +28 -3
  25. data/vendor/libyeptris/src/yeptris/events/values.c +24 -0
  26. data/vendor/libyeptris/src/yeptris/marshal/to_json.c +650 -0
  27. data/vendor/libyeptris/src/yeptris/parse/engine.c +121 -40
  28. data/vendor/libyeptris/src/yeptris/parse/stream_iter.c +326 -0
  29. data/vendor/libyeptris/src/yeptris/parse.c +173 -43
  30. data/vendor/libyeptris/src/yeptris/resolve/compat11.c +1 -1
  31. data/vendor/libyeptris/src/yeptris/resolve/core12.c +11 -3
  32. data/vendor/libyeptris/src/yeptris/resolve/full12.c +201 -0
  33. data/vendor/libyeptris/src/yeptris/resolve/json12.c +12 -6
  34. data/vendor/libyeptris/src/yeptris/resolve/resolver.h +20 -0
  35. data/vendor/libyeptris/src/yeptris/validate/compile.c +39 -3
  36. data/vendor/libyeptris/src/yeptris/validate/internal.h +223 -7
  37. data/vendor/libyeptris/src/yeptris/validate/jsonschema.c +645 -115
  38. data/vendor/libyeptris/src/yeptris/validate/output.c +246 -0
  39. data/vendor/libyeptris/src/yeptris/validate/regexp.c +623 -157
  40. data/vendor/libyeptris/src/yeptris/validate/registry.c +118 -0
  41. data/vendor/libyeptris/src/yeptris/validate/resources.c +601 -0
  42. data/vendor/libyeptris/src/yeptris/validate/stream.c +1155 -0
  43. data/vendor/libyeptris/src/yeptris/validate/validate.c +288 -145
  44. metadata +8 -1
@@ -38,7 +38,12 @@ typedef struct yep_writer {
38
38
  const char* json_indent; /* json_pretty indent unit; NULL = 2 spaces */
39
39
  int json_indent_len; /* json_pretty unit byte length */
40
40
  int best_width; /* 13B: 0 = default 80; flow lines wrap after a
41
- * value past this width */
41
+ * value past this width; with block_fold it is
42
+ * also the block scalar fold column (#903) */
43
+ int indent; /* #903: block indent per level (2..9, default
44
+ * 2): nested map content and seq item columns */
45
+ int block_fold; /* #903: plain/quoted block scalars fold at
46
+ * best_width (libyaml's plain-fold walk) */
42
47
  int col; /* current output column (wr_* maintains) */
43
48
  const char* sv_input; /* compact-view decode bases (dom regions) */
44
49
  const char* sv_arena;
@@ -82,6 +87,15 @@ typedef struct yep_emitter {
82
87
  /* One pass over the document set. dry=1 counts exactly. */
83
88
  size_t yep_emit_run(yep_emitter* em, int dry);
84
89
 
90
+ /* The write primitives, shared with the marshal reader
91
+ * (marshal/to_json.c — the move keeps ONE writer engine; #904 item 5).
92
+ * Internal: never in a public header. */
93
+ void wr_col_update(yep_writer* w, const char* p, uint32_t n);
94
+ void wr_reserve(yep_writer* w, size_t need);
95
+ void wr_put(yep_writer* w, const char* p, uint32_t n);
96
+ void wr_byte(yep_writer* w, char c);
97
+ void emit_dq_json(yep_writer* w, const char* p, uint32_t n);
98
+
85
99
  /* Compact single-line JSON (internal entries for the json-c compat
86
100
  * layer's to_json_string forms). pretty selects json-c's
87
101
  * JSON_C_TO_STRING_PRETTY layout: newline + 2-space indent per
@@ -14,6 +14,10 @@
14
14
  typedef struct {
15
15
  yeptris_event_fn fn;
16
16
  void* ctx;
17
+ uint32_t abort_line; /* the mark of the event the callback aborted
18
+ * on: the abort-text law sets the channel AT
19
+ * the abort point, not at 0/0 */
20
+ uint32_t abort_col;
17
21
  } yep_push_ctx;
18
22
 
19
23
  static int push_on_event(void* ctx, const yep_event* ev) {
@@ -73,7 +77,14 @@ static int push_on_event(void* ctx, const yep_event* ev) {
73
77
  e.anchor_len = ev->anchor.len;
74
78
  e.tag = ev->tag.len > 0 ? (const char*)ev->tag.p : NULL;
75
79
  e.tag_len = ev->tag.len;
76
- return p->fn(p->ctx, &e);
80
+ int rc = p->fn(p->ctx, &e);
81
+ if (rc != 0) {
82
+ /* the abort point travels with the abort: the TLS slot's mark
83
+ * is where the walk stopped, not 0/0 (events.h's contract) */
84
+ p->abort_line = ev->line;
85
+ p->abort_col = ev->col;
86
+ }
87
+ return rc;
77
88
  }
78
89
 
79
90
  YEPTRIS_API YeptrisStatus yeptris_push_parse(const char* buf, size_t len, yeptris_event_fn on_event,
@@ -84,11 +95,17 @@ YEPTRIS_API YeptrisStatus yeptris_push_parse(const char* buf, size_t len, yeptri
84
95
  if (on_event == NULL) {
85
96
  return YEPTRIS_ERROR_ARG;
86
97
  }
98
+ /* the push run owns the channel for its duration: clearing at
99
+ * entry makes the abort-text law verifiable (the message a caller
100
+ * reads after a push is THIS run's verdict, never a stale one
101
+ * from an earlier operation on the thread — error.h promises ""
102
+ * after a success) */
103
+ yep_error_clear(yep_error_tls());
87
104
  yep_engine* eng = yep_engine_create(yep_system_allocator());
88
105
  if (eng == NULL) {
89
106
  return YEPTRIS_ERROR_MEMORY;
90
107
  }
91
- yep_push_ctx p = {on_event, ctx};
108
+ yep_push_ctx p = {on_event, ctx, 0, 0};
92
109
  yep_sink sink = {.on_event = push_on_event,
93
110
  .ctx = &p,
94
111
  .on_flow_build = NULL,
@@ -118,9 +135,17 @@ YEPTRIS_API YeptrisStatus yeptris_push_parse(const char* buf, size_t len, yeptri
118
135
  }
119
136
  /* the engine's own memory failures report MEMORY (the parse route's
120
137
  * law); the callback abort keeps its documented contract — a parse
121
- * stop, clean channel */
138
+ * stop with the last-error channel SET (#904 item 4, the
139
+ * abort-text law: the old code returned PARSE over a CLEAN slot,
140
+ * so yeptris_last_error served whatever stale message this thread's
141
+ * previous operation had left there). YEP_ERR_ABORTED carries the
142
+ * mark of the event the callback aborted on. */
122
143
  if (err_code == YEP_ERR_MEMORY) {
123
144
  return YEPTRIS_ERROR_MEMORY;
124
145
  }
146
+ if (err_code == YEP_ERR_NONE) {
147
+ yep_error_set(yep_error_tls(), YEP_ERR_ABORTED, p.abort_line, p.abort_col, 0,
148
+ "parse aborted by the event callback at %u:%u", p.abort_line, p.abort_col);
149
+ }
125
150
  return YEPTRIS_ERROR_PARSE;
126
151
  }
@@ -175,6 +175,15 @@ static int transform(yep_value_ctx* c, const yep_rec_store* store) {
175
175
  case YEPTRIS_EV_SEQUENCE_START:
176
176
  v.kind = YEP_V_SEQ_OPEN;
177
177
  v.tag_id = r->tag_id;
178
+ if (r->tag_len != 0) {
179
+ /* the collection's explicit tag text rides the opens'
180
+ * span fields (untagged containers keep off/len 0 —
181
+ * the arena is not touched on the hot path): a host
182
+ * constructor re-tags containers (!!set -> Python set,
183
+ * !!omap -> pairs) without a second drain */
184
+ v.off = yep_val_arena_put(c, ra + r->tag_off, r->tag_len);
185
+ v.len = r->tag_len;
186
+ }
178
187
  yep_val_slot(c, &v);
179
188
  yep_val_put(c, &v);
180
189
  if (c->depth < YEP_V_MAX_DEPTH) {
@@ -186,6 +195,11 @@ static int transform(yep_value_ctx* c, const yep_rec_store* store) {
186
195
  case YEPTRIS_EV_MAPPING_START:
187
196
  v.kind = YEP_V_MAP_OPEN;
188
197
  v.tag_id = r->tag_id;
198
+ if (r->tag_len != 0) {
199
+ /* the set/omap tag text, exactly as the SEQ arm above */
200
+ v.off = yep_val_arena_put(c, ra + r->tag_off, r->tag_len);
201
+ v.len = r->tag_len;
202
+ }
189
203
  yep_val_slot(c, &v);
190
204
  yep_val_put(c, &v);
191
205
  if (c->depth < YEP_V_MAX_DEPTH) {
@@ -293,6 +307,16 @@ static int lin_node(yep_value_ctx* c, const yep_dom* d, uint32_t id) {
293
307
  }
294
308
  v.kind = n->kind == YEP_DOM_SEQUENCE ? YEP_V_SEQ_OPEN : YEP_V_MAP_OPEN;
295
309
  v.tag_id = n->tag_id;
310
+ if (n->tag.len != 0) {
311
+ /* route parity with the engine transform: the opens' span
312
+ * fields carry the explicit tag text there, so the linearizer
313
+ * must too (the routes stay byte-identical — values_priv.h's
314
+ * law). Marshal bails on tagged subtrees before this matters
315
+ * (#178); strict JSON carries no tags. */
316
+ yep_view tv = yep_dom_view(d, n->tag);
317
+ v.off = yep_val_arena_put(c, tv.p, (uint32_t)tv.len);
318
+ v.len = (uint32_t)tv.len;
319
+ }
296
320
  yep_val_slot(c, &v);
297
321
  yep_val_put(c, &v);
298
322
  if (c->depth < YEP_V_MAX_DEPTH) {