teptris 0.3.9.1 → 0.3.11.1

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 6aab4a0ec303b2d9f7e8f297ee3f7b79e849918b899dc37b0211e9742f325020
4
- data.tar.gz: 8acbfc253780d95ea885bfd7010a1a3af72cd03379a271f24e37f08c5f1ea1aa
3
+ metadata.gz: 8ba3cfdb137875fc812f0d1224483c918fce49f90a37b122b8036913cbfb8c50
4
+ data.tar.gz: 4f3cda87a54cb382713b69a75ba1095c742371357a0fe406da795308c96ae4cd
5
5
  SHA512:
6
- metadata.gz: 36570eaedd6c8bd1308b82782f42340608537b7aec6ad05cf587a1ab0b32d022a7ea5e7d6be557ec89552fe2b43625d29d28a36b4a2df7182daa32b4be99bc71
7
- data.tar.gz: 4e830f00f488ccb9039bf842b90f09655f3ebf5824b2fbbf217b9243ce991748c2bfc9ebcb3cc48a34f1808106f693290a064e521cf4ede2771c92f3ba9536b8
6
+ metadata.gz: 994bdd97620ad9add904073a78b3d185754e5f8b899049f5461f26fd4d6ae97ed31bcdaa33e2d1f80c0e7eab319eb2b31cf8dab0b2dece0e7f18d953893ff413
7
+ data.tar.gz: f02f4a7e117cb152aaad6eafd4d511b296b0017e8dfe5ccc34b4c3a3cc639b3fc3faf955e52574457d5566ecc86e3e8c5da04617f36cabe8a31813be70bf0bd9
@@ -1,4 +1,4 @@
1
- # libteptris 0.3.9 — vendored source
1
+ # libteptris 0.3.11 — vendored source
2
2
 
3
3
  This directory carries the COMPLETE C source of the engine this
4
4
  gem's extension was built from (the packaging doctrine: compiled
@@ -4,6 +4,6 @@
4
4
  #define TEPTRIS_VERSION_MAJOR 0
5
5
  #define TEPTRIS_VERSION_MINOR 3
6
6
  #define TEPTRIS_VERSION_PATCH 0
7
- #define TEPTRIS_VERSION_STRING "0.3.9"
7
+ #define TEPTRIS_VERSION_STRING "0.3.11"
8
8
 
9
9
  #endif /* TEPTRIS_VERSION_H */
@@ -9,7 +9,11 @@
9
9
  *
10
10
  * Op grammar (little-endian, mirroring the flatten payload styles):
11
11
  * 0x00 END-OF-CHUNK
12
- * 0x01 KEY u8 klen <bytes> (klen 0 clears the pending key)
12
+ * 0x01 KEY u8 klen <bytes> (klen 0 = the EMPTY key '';
13
+ * array ELEMENTS carry no key op at all - the
14
+ * array-context prefix never consults the key,
15
+ * so a stale/stray key inside an array is a
16
+ * grammar violation, enforced ERR_ARG)
13
17
  * 0x02 STRING u32 len <bytes>
14
18
  * 0x03 INT i64
15
19
  * 0x04 FLOAT f64
@@ -111,16 +115,28 @@ void teptris_writer_free(teptris_writer *w)
111
115
  static void w_take_key(teptris_writer *w, const char *k, size_t klen)
112
116
  {
113
117
  free(w->key);
114
- w->key = NULL;
115
- w->key_len = 0;
116
118
  if (klen > 0) {
117
119
  w->key = malloc(klen);
118
120
  if (w->key == NULL) {
121
+ w->key = NULL;
122
+ w->key_len = 0;
119
123
  w->st = TEPTRIS_ERR_ALLOC;
120
124
  return;
121
125
  }
122
126
  memcpy(w->key, k, klen);
123
127
  w->key_len = klen;
128
+ } else {
129
+ /* an empty key stays PENDING: NULL means "no key", and the
130
+ * keyed-prefix checks treat NULL as absent. The parse side
131
+ * accepts '' = 1, so the writer must emit it ('' via emit_key) */
132
+ w->key = malloc(1);
133
+ if (w->key == NULL) {
134
+ w->key_len = 0;
135
+ w->st = TEPTRIS_ERR_ALLOC;
136
+ return;
137
+ }
138
+ w->key[0] = '\0';
139
+ w->key_len = 0;
124
140
  }
125
141
  }
126
142
 
@@ -392,12 +408,6 @@ teptris_status teptris_writer_feed(teptris_writer *w, const uint8_t *ops,
392
408
  emit_dt(&w->out, &dt, (teptris_kind)kb);
393
409
  w_end_line(w);
394
410
  break;
395
- if (w->st != TEPTRIS_OK) {
396
- break;
397
- }
398
- emit_dt(&w->out, &dt, (teptris_kind)kb);
399
- w_end_line(w);
400
- break;
401
411
  }
402
412
  case W_BEGIN_TABLE: {
403
413
  wframe *t = w->top;
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Teptris
4
- VERSION = "0.3.9.1"
4
+ VERSION = "0.3.11.1"
5
5
  end
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.9.1
4
+ version: 0.3.11.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - teptris contributors
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2026-10-25 00:00:00.000000000 Z
11
+ date: 2026-10-30 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.