teptris 0.3.11.1-s390x-linux → 0.3.12.1-s390x-linux
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/teptris_ext/engine/README.md +1 -1
- data/ext/teptris_ext/engine/src/include/teptris/version.h +1 -1
- data/ext/teptris_ext/engine/src/teptris/parse/keys.c +9 -0
- data/ext/teptris_ext/engine/src/teptris/parse/scalars.c +4 -2
- data/ext/teptris_ext/materialize.c +14 -6
- data/lib/teptris/3.3/teptris_ext.so +0 -0
- data/lib/teptris/3.4/teptris_ext.so +0 -0
- data/lib/teptris/4.0/teptris_ext.so +0 -0
- data/lib/teptris/error.rb +3 -0
- data/lib/teptris/toml.rb +17 -4
- data/lib/teptris/version.rb +1 -1
- data/sig/teptris.rbs +5 -0
- metadata +2 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 173d8f6ff382784dc094a76f0106395d0f27e8c0879679f26f70c4bb41482285
|
|
4
|
+
data.tar.gz: 856538b1fb98fdd07f37288e468ea88d34ce670073e4d10581b90c24a4895059
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 79241aa7ae4a05447e4669c44ad28e43affd03285b3c93ee6b06412fa5ccf3d0f3e315bd5e329e44ac59e448efb9d61191c4089367b49438dbd820f8abc06238
|
|
7
|
+
data.tar.gz: 253a29b49f45d670ec058ddd78b5811bbd0402794ef0aceb59f0d4ab5c9bc4eeab9fc2ab2f2102f86d6235fd850823cc773c750deab6ee1c9c3fa06393061fa0
|
|
@@ -104,6 +104,15 @@ teptris_status teptris_parse_key_path(teptris_parser *ps,
|
|
|
104
104
|
}
|
|
105
105
|
v[n++] = key;
|
|
106
106
|
|
|
107
|
+
/* each dotted component is one table level in the DOM - cap it
|
|
108
|
+
* against the same ceiling as '['/'{' nesting, or a hostile
|
|
109
|
+
* a.b.b.b...=1 line builds an uncapped-depth tree that blows
|
|
110
|
+
* the recursive emit/free passes */
|
|
111
|
+
if (n > ps->max_depth) {
|
|
112
|
+
return tep_fail_at(ps, NULL, TEPTRIS_ERR_DEPTH,
|
|
113
|
+
"key path too deep");
|
|
114
|
+
}
|
|
115
|
+
|
|
107
116
|
st = tep_skip_ws(ps);
|
|
108
117
|
if (st != TEPTRIS_OK) {
|
|
109
118
|
return st;
|
|
@@ -201,7 +201,8 @@ teptris_status tep_scan_basic(teptris_parser *ps, bool ml, char *out,
|
|
|
201
201
|
}
|
|
202
202
|
if (c == '\r') {
|
|
203
203
|
if (ml && ps->p + 1 < ps->end && ps->p[1] == '\n') {
|
|
204
|
-
PUTCH(out, n, '\
|
|
204
|
+
PUTCH(out, n, '\n'); /* CRLF normalizes to LF inside multi-line
|
|
205
|
+
strings (tomllib reference) */
|
|
205
206
|
tep_adv(ps, 2);
|
|
206
207
|
continue;
|
|
207
208
|
}
|
|
@@ -267,7 +268,8 @@ teptris_status tep_scan_literal(teptris_parser *ps, bool ml, char *out,
|
|
|
267
268
|
}
|
|
268
269
|
if (c == '\r') {
|
|
269
270
|
if (ml && ps->p + 1 < ps->end && ps->p[1] == '\n') {
|
|
270
|
-
PUTCH(out, n, '\
|
|
271
|
+
PUTCH(out, n, '\n'); /* CRLF normalizes to LF inside multi-line
|
|
272
|
+
strings (tomllib reference) */
|
|
271
273
|
tep_adv(ps, 2);
|
|
272
274
|
continue;
|
|
273
275
|
}
|
|
@@ -1132,10 +1132,13 @@ static VALUE ext_load_lazy_batch(VALUE self, VALUE strings) {
|
|
|
1132
1132
|
}
|
|
1133
1133
|
if (first_fail != -1) {
|
|
1134
1134
|
const teptris_error *e = teptris_document_error(s->docs[first_fail]);
|
|
1135
|
-
|
|
1136
|
-
|
|
1135
|
+
char msg[192];
|
|
1136
|
+
snprintf(msg, sizeof msg, "document %ld: %s", first_fail,
|
|
1137
|
+
e->message);
|
|
1138
|
+
VALUE ex = rb_exc_new(eParseError, msg, (long)strlen(msg));
|
|
1137
1139
|
rb_iv_set(ex, "@line", SIZET2NUM(e->line));
|
|
1138
1140
|
rb_iv_set(ex, "@column", SIZET2NUM(e->column));
|
|
1141
|
+
rb_iv_set(ex, "@index", LONG2NUM(first_fail));
|
|
1139
1142
|
for (long i = 0; i < n; i++) teptris_document_free(s->docs[i]);
|
|
1140
1143
|
batch_scratch_free(s);
|
|
1141
1144
|
rb_exc_raise(ex);
|
|
@@ -1224,10 +1227,12 @@ static VALUE ext_load_slice(int argc, VALUE *argv, VALUE self) {
|
|
|
1224
1227
|
}
|
|
1225
1228
|
const teptris_error *e = teptris_document_error(docs[i]);
|
|
1226
1229
|
if (stats[i] != TEPTRIS_OK) {
|
|
1227
|
-
|
|
1228
|
-
|
|
1230
|
+
char msg[192];
|
|
1231
|
+
snprintf(msg, sizeof msg, "document %ld: %s", i, e->message);
|
|
1232
|
+
VALUE ex = rb_exc_new(eParseError, msg, (long)strlen(msg));
|
|
1229
1233
|
rb_iv_set(ex, "@line", SIZET2NUM(e->line));
|
|
1230
1234
|
rb_iv_set(ex, "@column", SIZET2NUM(e->column));
|
|
1235
|
+
rb_iv_set(ex, "@index", LONG2NUM(i));
|
|
1231
1236
|
long j;
|
|
1232
1237
|
for (j = i; j < n; j++) teptris_document_free(docs[j]);
|
|
1233
1238
|
kc_free(&kc);
|
|
@@ -1281,10 +1286,13 @@ static VALUE ext_load_batch(int argc, VALUE *argv, VALUE self) {
|
|
|
1281
1286
|
}
|
|
1282
1287
|
if (first_fail != -1) {
|
|
1283
1288
|
const teptris_error *e = teptris_document_error(s->docs[first_fail]);
|
|
1284
|
-
|
|
1285
|
-
|
|
1289
|
+
char msg[192];
|
|
1290
|
+
snprintf(msg, sizeof msg, "document %ld: %s", first_fail,
|
|
1291
|
+
e->message);
|
|
1292
|
+
VALUE ex = rb_exc_new(eParseError, msg, (long)strlen(msg));
|
|
1286
1293
|
rb_iv_set(ex, "@line", SIZET2NUM(e->line));
|
|
1287
1294
|
rb_iv_set(ex, "@column", SIZET2NUM(e->column));
|
|
1295
|
+
rb_iv_set(ex, "@index", LONG2NUM(first_fail));
|
|
1288
1296
|
for (long i = 0; i < n; i++) teptris_document_free(s->docs[i]);
|
|
1289
1297
|
batch_scratch_free(s);
|
|
1290
1298
|
rb_exc_raise(ex);
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
data/lib/teptris/error.rb
CHANGED
|
@@ -5,6 +5,9 @@ module Teptris
|
|
|
5
5
|
|
|
6
6
|
class ParseError < Error
|
|
7
7
|
attr_reader :line, :column
|
|
8
|
+
# batch context: load_batch/load_slice set this to the 0-based
|
|
9
|
+
# position of the failing document in the batch
|
|
10
|
+
attr_accessor :index
|
|
8
11
|
|
|
9
12
|
def initialize(message, line = 0, column = 0)
|
|
10
13
|
@line = line
|
data/lib/teptris/toml.rb
CHANGED
|
@@ -121,13 +121,26 @@ module Teptris::TOML
|
|
|
121
121
|
end
|
|
122
122
|
end
|
|
123
123
|
end.each(&:join)
|
|
124
|
-
if first_error
|
|
125
|
-
_, err = first_error
|
|
126
|
-
raise err
|
|
127
|
-
end
|
|
124
|
+
raise_batch_error!(first_error) if first_error
|
|
128
125
|
results
|
|
129
126
|
end
|
|
130
127
|
|
|
128
|
+
# the slice's error is slice-local (its message and @index count
|
|
129
|
+
# from the slice's first document); translate both to batch-global
|
|
130
|
+
def raise_batch_error!(first_error)
|
|
131
|
+
return unless first_error
|
|
132
|
+
|
|
133
|
+
base, err = first_error
|
|
134
|
+
return unless err
|
|
135
|
+
|
|
136
|
+
global = (base || 0) + (err.index || 0)
|
|
137
|
+
text = err.message.sub(/\Adocument \d+: /, "")
|
|
138
|
+
wrapped = Teptris::ParseError.new("document #{global}: #{text}",
|
|
139
|
+
err.line, err.column)
|
|
140
|
+
wrapped.index = global
|
|
141
|
+
raise wrapped
|
|
142
|
+
end
|
|
143
|
+
|
|
131
144
|
# Lazy twin of load_batch: parse N inputs eagerly, hand back an
|
|
132
145
|
# Array of Lazy wrappers — materialization happens only on access.
|
|
133
146
|
# Same per-doc error semantics as load_lazy (first failure raises).
|
data/lib/teptris/version.rb
CHANGED
data/sig/teptris.rbs
CHANGED
|
@@ -10,6 +10,9 @@ module Teptris
|
|
|
10
10
|
class ParseError < Error
|
|
11
11
|
attr_reader line: Integer
|
|
12
12
|
attr_reader column: Integer
|
|
13
|
+
# batch context: set by load_batch/load_slice on batch failures -
|
|
14
|
+
# the 0-based position of the failing document in the batch
|
|
15
|
+
attr_accessor index: Integer?
|
|
13
16
|
|
|
14
17
|
def initialize: (String message, ?Integer line, ?Integer column) -> void
|
|
15
18
|
end
|
|
@@ -39,6 +42,8 @@ module Teptris
|
|
|
39
42
|
?threads: Integer)
|
|
40
43
|
-> Array[Hash[String, untyped]]
|
|
41
44
|
|
|
45
|
+
def self.raise_batch_error!: ([Integer, ParseError]?) -> void
|
|
46
|
+
|
|
42
47
|
def self.load_lazy_batch: (Array[String] tomls)
|
|
43
48
|
-> Array[TeptrisExt::LazyValue]
|
|
44
49
|
|
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: teptris
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.3.
|
|
4
|
+
version: 0.3.12.1
|
|
5
5
|
platform: s390x-linux
|
|
6
6
|
authors:
|
|
7
7
|
- teptris contributors
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: bin
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2026-10-
|
|
11
|
+
date: 2026-10-31 00:00:00.000000000 Z
|
|
12
12
|
dependencies: []
|
|
13
13
|
description: A native C extension over libteptris, a C99 TOML 1.1 parser/emitter.
|
|
14
14
|
API shape mirrors the tomlib gem.
|