yeptris 0.6.64.0-riscv64-linux-gnu
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 +7 -0
- data/README.adoc +150 -0
- data/ext/build_windows_native.rb +60 -0
- data/ext/libyeptris/extconf.rb +57 -0
- data/ext/yeptris_native/cbor_ruby.c +198 -0
- data/ext/yeptris_native/extconf.rb +99 -0
- data/ext/yeptris_native/json_ruby.c +414 -0
- data/ext/yeptris_native/version.h +29 -0
- data/ext/yeptris_native/yeptris_native.c +507 -0
- data/lib/yeptris/3.3/native.so +0 -0
- data/lib/yeptris/cbor.rb +169 -0
- data/lib/yeptris/document.rb +319 -0
- data/lib/yeptris/ffi.rb +572 -0
- data/lib/yeptris/json/descriptor.rb +266 -0
- data/lib/yeptris/json.rb +502 -0
- data/lib/yeptris/materializer.rb +389 -0
- data/lib/yeptris/node.rb +482 -0
- data/lib/yeptris/psych/class_loader.rb +24 -0
- data/lib/yeptris/psych/coder_shim.rb +55 -0
- data/lib/yeptris/psych/drop_in.rb +63 -0
- data/lib/yeptris/psych/encodable.rb +14 -0
- data/lib/yeptris/psych/handler.rb +95 -0
- data/lib/yeptris/psych/parser.rb +114 -0
- data/lib/yeptris/psych/scalar_scanner.rb +149 -0
- data/lib/yeptris/psych/tree_builder.rb +119 -0
- data/lib/yeptris/psych/visitors.rb +670 -0
- data/lib/yeptris/psych.rb +796 -0
- data/lib/yeptris/schema.rb +253 -0
- data/lib/yeptris/validation.rb +320 -0
- data/lib/yeptris/valueml.rb +477 -0
- data/lib/yeptris/yaml/descriptor.rb +56 -0
- data/lib/yeptris/yaml.rb +668 -0
- data/lib/yeptris.rb +130 -0
- data/libyeptris.so +0 -0
- data/vendor/libyeptris/CMakeLists.txt +280 -0
- data/vendor/libyeptris/cmake/yeptris-config.cmake.in +5 -0
- data/vendor/libyeptris/cmake/yeptris.pc.in +11 -0
- data/vendor/libyeptris/src/CMakeLists.txt +183 -0
- data/vendor/libyeptris/src/include/yeptris/api.h +32 -0
- data/vendor/libyeptris/src/include/yeptris/cbor.h +174 -0
- data/vendor/libyeptris/src/include/yeptris/dom.h +196 -0
- data/vendor/libyeptris/src/include/yeptris/emit.h +128 -0
- data/vendor/libyeptris/src/include/yeptris/error.h +42 -0
- data/vendor/libyeptris/src/include/yeptris/events.h +171 -0
- data/vendor/libyeptris/src/include/yeptris/json.h +57 -0
- data/vendor/libyeptris/src/include/yeptris/json.hpp +258 -0
- data/vendor/libyeptris/src/include/yeptris/jsonc_compat.h +115 -0
- data/vendor/libyeptris/src/include/yeptris/marshal.h +75 -0
- data/vendor/libyeptris/src/include/yeptris/parse.h +121 -0
- data/vendor/libyeptris/src/include/yeptris/plan.h +100 -0
- data/vendor/libyeptris/src/include/yeptris/resolve.h +81 -0
- data/vendor/libyeptris/src/include/yeptris/schema.h +121 -0
- data/vendor/libyeptris/src/include/yeptris/tape.h +128 -0
- data/vendor/libyeptris/src/include/yeptris/types.h +38 -0
- data/vendor/libyeptris/src/include/yeptris/validate.h +401 -0
- data/vendor/libyeptris/src/include/yeptris/values.h +108 -0
- data/vendor/libyeptris/src/include/yeptris/version.h.in +29 -0
- data/vendor/libyeptris/src/include/yeptris/visit.h +77 -0
- data/vendor/libyeptris/src/include/yeptris/yajl_compat.h +135 -0
- data/vendor/libyeptris/src/include/yeptris.h +24 -0
- data/vendor/libyeptris/src/yeptris/build.c +393 -0
- data/vendor/libyeptris/src/yeptris/cbor/cbor.h +35 -0
- data/vendor/libyeptris/src/yeptris/cbor/decode.c +1054 -0
- data/vendor/libyeptris/src/yeptris/cbor/encode.c +836 -0
- data/vendor/libyeptris/src/yeptris/cbor/encode_priv.h +32 -0
- data/vendor/libyeptris/src/yeptris/cbor/from_marshal.c +982 -0
- data/vendor/libyeptris/src/yeptris/cbor/sink.h +36 -0
- data/vendor/libyeptris/src/yeptris/common/chartype.c +41 -0
- data/vendor/libyeptris/src/yeptris/common/chartype.h +77 -0
- data/vendor/libyeptris/src/yeptris/common/cpu.c +81 -0
- data/vendor/libyeptris/src/yeptris/common/cpu.h +40 -0
- data/vendor/libyeptris/src/yeptris/common/error.c +65 -0
- data/vendor/libyeptris/src/yeptris/common/error.h +81 -0
- data/vendor/libyeptris/src/yeptris/common/mutex.h +45 -0
- data/vendor/libyeptris/src/yeptris/common/nametab.c +275 -0
- data/vendor/libyeptris/src/yeptris/common/nametab.h +68 -0
- data/vendor/libyeptris/src/yeptris/common/port.h +74 -0
- data/vendor/libyeptris/src/yeptris/common/simd_text.c +49 -0
- data/vendor/libyeptris/src/yeptris/common/simd_text.h +342 -0
- data/vendor/libyeptris/src/yeptris/common/simd_text_avx2.c +672 -0
- data/vendor/libyeptris/src/yeptris/common/simd_text_neon.c +793 -0
- data/vendor/libyeptris/src/yeptris/common/simd_text_scalar.c +324 -0
- data/vendor/libyeptris/src/yeptris/common/string_view.c +34 -0
- data/vendor/libyeptris/src/yeptris/common/string_view.h +93 -0
- data/vendor/libyeptris/src/yeptris/doc.h +86 -0
- data/vendor/libyeptris/src/yeptris/dom/dom.c +1312 -0
- data/vendor/libyeptris/src/yeptris/dom/dom.h +332 -0
- data/vendor/libyeptris/src/yeptris/dom/hpool.c +107 -0
- data/vendor/libyeptris/src/yeptris/dom/mapindex.c +173 -0
- data/vendor/libyeptris/src/yeptris/dom/mapindex.h +61 -0
- data/vendor/libyeptris/src/yeptris/dom/mutate.c +431 -0
- data/vendor/libyeptris/src/yeptris/dom/ytape.c +2323 -0
- data/vendor/libyeptris/src/yeptris/dom/ytape.h +96 -0
- data/vendor/libyeptris/src/yeptris/emit/emit.c +670 -0
- data/vendor/libyeptris/src/yeptris/emit/float/api.h +43 -0
- data/vendor/libyeptris/src/yeptris/emit/float/dragon.c +405 -0
- data/vendor/libyeptris/src/yeptris/emit/float/floatint.h +231 -0
- data/vendor/libyeptris/src/yeptris/emit/float/fpconv.c +428 -0
- data/vendor/libyeptris/src/yeptris/emit/float/print.c +396 -0
- data/vendor/libyeptris/src/yeptris/emit/style.c +21 -0
- data/vendor/libyeptris/src/yeptris/emit/style.h +32 -0
- data/vendor/libyeptris/src/yeptris/emit/writer.c +1951 -0
- data/vendor/libyeptris/src/yeptris/emit/writer.h +111 -0
- data/vendor/libyeptris/src/yeptris/encoding/bom.c +31 -0
- data/vendor/libyeptris/src/yeptris/encoding/encoding.h +63 -0
- data/vendor/libyeptris/src/yeptris/encoding/transcode.c +157 -0
- data/vendor/libyeptris/src/yeptris/encoding/utf8_validate.c +178 -0
- data/vendor/libyeptris/src/yeptris/events/capture.c +166 -0
- data/vendor/libyeptris/src/yeptris/events/capture.h +39 -0
- data/vendor/libyeptris/src/yeptris/events/iterparse.c +298 -0
- data/vendor/libyeptris/src/yeptris/events/pull.c +117 -0
- data/vendor/libyeptris/src/yeptris/events/push.c +151 -0
- data/vendor/libyeptris/src/yeptris/events/recorder.c +144 -0
- data/vendor/libyeptris/src/yeptris/events/values.c +630 -0
- data/vendor/libyeptris/src/yeptris/events/values_priv.h +53 -0
- data/vendor/libyeptris/src/yeptris/events/yaml_compat.c +86 -0
- data/vendor/libyeptris/src/yeptris/events/yaml_compat.h +90 -0
- data/vendor/libyeptris/src/yeptris/jsonapi/jsonc_compat.c +687 -0
- data/vendor/libyeptris/src/yeptris/jsonapi/yajl_compat.c +728 -0
- data/vendor/libyeptris/src/yeptris/marshal/to_json.c +650 -0
- data/vendor/libyeptris/src/yeptris/marshal.c +988 -0
- data/vendor/libyeptris/src/yeptris/memory/allocator.c +20 -0
- data/vendor/libyeptris/src/yeptris/memory/allocator.h +43 -0
- data/vendor/libyeptris/src/yeptris/memory/arena.c +150 -0
- data/vendor/libyeptris/src/yeptris/memory/arena.h +52 -0
- data/vendor/libyeptris/src/yeptris/memory/pool.c +133 -0
- data/vendor/libyeptris/src/yeptris/memory/pool.h +36 -0
- data/vendor/libyeptris/src/yeptris/parse/engine.c +6528 -0
- data/vendor/libyeptris/src/yeptris/parse/engine.h +96 -0
- data/vendor/libyeptris/src/yeptris/parse/events.h +137 -0
- data/vendor/libyeptris/src/yeptris/parse/numbers.c +374 -0
- data/vendor/libyeptris/src/yeptris/parse/numbers.h +33 -0
- data/vendor/libyeptris/src/yeptris/parse/scalars.c +435 -0
- data/vendor/libyeptris/src/yeptris/parse/scalars.h +87 -0
- data/vendor/libyeptris/src/yeptris/parse/stream_iter.c +358 -0
- data/vendor/libyeptris/src/yeptris/parse.c +1074 -0
- data/vendor/libyeptris/src/yeptris/plan.c +824 -0
- data/vendor/libyeptris/src/yeptris/resolve/compat11.c +339 -0
- data/vendor/libyeptris/src/yeptris/resolve/core12.c +153 -0
- data/vendor/libyeptris/src/yeptris/resolve/full12.c +201 -0
- data/vendor/libyeptris/src/yeptris/resolve/json12.c +109 -0
- data/vendor/libyeptris/src/yeptris/resolve/resolver.h +103 -0
- data/vendor/libyeptris/src/yeptris/resolve/tags.c +250 -0
- data/vendor/libyeptris/src/yeptris/scan/json.c +839 -0
- data/vendor/libyeptris/src/yeptris/scan/json.h +116 -0
- data/vendor/libyeptris/src/yeptris/scan/scan.c +862 -0
- data/vendor/libyeptris/src/yeptris/scan/scan.h +177 -0
- data/vendor/libyeptris/src/yeptris/schema.c +309 -0
- data/vendor/libyeptris/src/yeptris/tape.c +2375 -0
- data/vendor/libyeptris/src/yeptris/tape_in.h +39 -0
- data/vendor/libyeptris/src/yeptris/validate/compile.c +306 -0
- data/vendor/libyeptris/src/yeptris/validate/internal.h +347 -0
- data/vendor/libyeptris/src/yeptris/validate/jsonschema.c +1922 -0
- data/vendor/libyeptris/src/yeptris/validate/output.c +246 -0
- data/vendor/libyeptris/src/yeptris/validate/regexp.c +1600 -0
- data/vendor/libyeptris/src/yeptris/validate/registry.c +118 -0
- data/vendor/libyeptris/src/yeptris/validate/resources.c +601 -0
- data/vendor/libyeptris/src/yeptris/validate/stream.c +1155 -0
- data/vendor/libyeptris/src/yeptris/validate/validate.c +1043 -0
- data/vendor/libyeptris/src/yeptris/version.c +7 -0
- data/vendor/libyeptris/src/yeptris/visit/dom_visit.c +115 -0
- data/vendor/libyeptris/src/yeptris/visit/json_visit.c +293 -0
- data/vendor/libyeptris/src/yeptris/visit/yaml_visit.c +127 -0
- metadata +221 -0
|
@@ -0,0 +1,116 @@
|
|
|
1
|
+
/* json.h — the strict-JSON grammar interface (TODO.impl/08C/21).
|
|
2
|
+
*
|
|
3
|
+
* Kernels are exported (YEPTRIS_API) so host materializers (the Ruby
|
|
4
|
+
* native extension's fused JSON→VALUE path) can call them without
|
|
5
|
+
* pulling the whole static archive. */
|
|
6
|
+
#ifndef YEP_JSON_H
|
|
7
|
+
#define YEP_JSON_H
|
|
8
|
+
|
|
9
|
+
#include <stddef.h>
|
|
10
|
+
#include <yeptris/api.h>
|
|
11
|
+
|
|
12
|
+
#ifdef __cplusplus
|
|
13
|
+
extern "C" {
|
|
14
|
+
#endif
|
|
15
|
+
|
|
16
|
+
YEPTRIS_API int yep_json_ws(const char* p, size_t len, size_t* i, int* saw_tab);
|
|
17
|
+
|
|
18
|
+
/* Token-stream walker over a JSON-class flow span (TODO.restructure/53):
|
|
19
|
+
* the ONE grammar walk, shared by the engine's validator and the DOM's
|
|
20
|
+
* fused builder — validate and build ride the same state machine. */
|
|
21
|
+
#define YEP_JSON_WALK_DEPTH 256
|
|
22
|
+
|
|
23
|
+
typedef enum {
|
|
24
|
+
YEP_JW_OK = 0, /* token delivered in *t */
|
|
25
|
+
YEP_JW_DONE = 1, /* the span's matching close was consumed */
|
|
26
|
+
YEP_JW_REJECT = 2, /* not JSON-class: the general kernel judges */
|
|
27
|
+
} yep_jw_status;
|
|
28
|
+
|
|
29
|
+
typedef struct yep_json_tok {
|
|
30
|
+
size_t at; /* token start (the quote/opener/digit) */
|
|
31
|
+
size_t end; /* token end (past the closing quote for strings) */
|
|
32
|
+
char cls; /* '"' string, '#' number, 'a' literal, '[', '{', ']', '}' */
|
|
33
|
+
int has_escape; /* strings: a backslash escape is present */
|
|
34
|
+
int is_float; /* numbers (cls '#'): the text has '.' or an exponent */
|
|
35
|
+
/* numbers: the ONE conversion (the walker's number arm runs
|
|
36
|
+
* yep_json_number_scan — validate, advance, convert in a single
|
|
37
|
+
* pass; consumers read the values instead of rescanning). nshape:
|
|
38
|
+
* 0 int (ival exact), 1 float text (dval), 2 integer text beyond
|
|
39
|
+
* int64 (dval approximate — the number-kernel contract). */
|
|
40
|
+
int nshape;
|
|
41
|
+
int64_t ival;
|
|
42
|
+
double dval;
|
|
43
|
+
} yep_json_tok;
|
|
44
|
+
|
|
45
|
+
/* Walker states (the reference machine in scan/json.c and the tape's
|
|
46
|
+
* fused specialization share one set — same grammar, same rejects). */
|
|
47
|
+
enum {
|
|
48
|
+
JW_VALUE_OR_CLOSE = 0,
|
|
49
|
+
JW_VALUE,
|
|
50
|
+
JW_KEY_OR_CLOSE,
|
|
51
|
+
JW_KEY,
|
|
52
|
+
JW_COLON,
|
|
53
|
+
JW_COMMA_OR_CLOSE,
|
|
54
|
+
};
|
|
55
|
+
|
|
56
|
+
typedef struct yep_json_walk {
|
|
57
|
+
const char* p;
|
|
58
|
+
size_t len;
|
|
59
|
+
int max_depth; /* the engine's runtime nesting limit */
|
|
60
|
+
size_t i; /* cursor: one past the opener */
|
|
61
|
+
size_t close; /* valid once DONE */
|
|
62
|
+
int long_key; /* a map key over the 1024-char simple-key limit */
|
|
63
|
+
int saw_tab;
|
|
64
|
+
/* strict JSON (RFC 8259): map keys are STRINGS only, including
|
|
65
|
+
* the first entry — the lenient flow class accepts YAML keys
|
|
66
|
+
* (TODO.restructure/81 stage 2: the strict build's walk IS the
|
|
67
|
+
* validator; reject falls to yep_json_document's error path). */
|
|
68
|
+
int strict;
|
|
69
|
+
uint8_t kind[YEP_JSON_WALK_DEPTH]; /* 0 seq, 1 map */
|
|
70
|
+
uint8_t expect[YEP_JSON_WALK_DEPTH]; /* walker states */
|
|
71
|
+
int depth;
|
|
72
|
+
} yep_json_walk;
|
|
73
|
+
|
|
74
|
+
/* Opens over p[open] ('[' or '{'); call _next until DONE/REJECT. */
|
|
75
|
+
void yep_json_walk_init(yep_json_walk* w, const char* p, size_t len, size_t open, int max_depth);
|
|
76
|
+
yep_jw_status yep_json_walk_next(yep_json_walk* w, yep_json_tok* t);
|
|
77
|
+
YEPTRIS_API int yep_json_number(const char* p, size_t len, size_t* i);
|
|
78
|
+
/* The grammar walk fused with conversion (TODO.restructure/26): one
|
|
79
|
+
* scan validates and converts. *is_float reports the TEXT shape:
|
|
80
|
+
* 0 = integer (*iv exact, INT64_MIN included), 1 = float text
|
|
81
|
+
* (*dv converted via the number-kernel SSOT), 2 = integer text
|
|
82
|
+
* beyond int64 (*dv approximate; exact hosts rebuild from the span
|
|
83
|
+
* start..*i). Out params may be NULL. */
|
|
84
|
+
YEPTRIS_API int yep_json_number_scan(const char* p, size_t len, size_t* i, int* is_float,
|
|
85
|
+
int64_t* iv, double* dv);
|
|
86
|
+
/* Same grammar, same rejects, same advance — NO conversion: reports
|
|
87
|
+
* the text shape only (0 int / 1 float). The lazy tape's arm. */
|
|
88
|
+
YEPTRIS_API int yep_json_number_shape(const char* p, size_t len, size_t* i, int* is_float);
|
|
89
|
+
YEPTRIS_API int yep_json_literal(const char* p, size_t len, size_t* i, const char* word);
|
|
90
|
+
YEPTRIS_API int yep_json_string(const char* p, size_t len, size_t* i, size_t* close_out,
|
|
91
|
+
int* has_esc);
|
|
92
|
+
/* Stage 1 of the token-contract tape front: the structural indexer
|
|
93
|
+
* (scalar reference; the kernels table's json_stage1 slot carries the
|
|
94
|
+
* ISA twins). Writes the token positions stage 2 dispatches on —
|
|
95
|
+
* operators, string OPEN quotes, scalar-run starts — and returns 0
|
|
96
|
+
* only for an unterminated string. idx holds len+2 entries. flags
|
|
97
|
+
* (never NULL) accumulates the YEP_S1_* doc-level facts. */
|
|
98
|
+
YEPTRIS_API int yep_json_stage1_scalar(const char* p, size_t len, uint32_t* idx, size_t* nidx,
|
|
99
|
+
unsigned* flags);
|
|
100
|
+
/* The classification half (no emission) — the kernels table's
|
|
101
|
+
* json_stage1_masks slot carries the ISA twins. */
|
|
102
|
+
struct yep_s1_block; /* defined in scan/json.c (the span blocks) */
|
|
103
|
+
YEPTRIS_API int yep_json_stage1_masks_scalar(const char* p, size_t len, struct yep_s1_block* blocks,
|
|
104
|
+
size_t* nblocks, unsigned* flags);
|
|
105
|
+
|
|
106
|
+
/* The per-chunk byte-class classifier behind the flow kernels: the
|
|
107
|
+
* kernels table's json_chunk slot (common/simd_text.h) — yep_chunk_masks
|
|
108
|
+
* is defined there; the differential suite pins the ISAs to it. */
|
|
109
|
+
|
|
110
|
+
YEPTRIS_API int yep_json_document(const char* p, size_t len, size_t* err);
|
|
111
|
+
|
|
112
|
+
#ifdef __cplusplus
|
|
113
|
+
}
|
|
114
|
+
#endif
|
|
115
|
+
|
|
116
|
+
#endif /* YEP_JSON_H */
|