ndtypes 0.2.0dev5 → 0.2.0dev6

Sign up to get free protection for your applications and to get access to all the features.
Files changed (130) hide show
  1. checksums.yaml +4 -4
  2. data/CONTRIBUTING.md +12 -0
  3. data/Rakefile +8 -0
  4. data/ext/ruby_ndtypes/GPATH +0 -0
  5. data/ext/ruby_ndtypes/GRTAGS +0 -0
  6. data/ext/ruby_ndtypes/GTAGS +0 -0
  7. data/ext/ruby_ndtypes/extconf.rb +1 -1
  8. data/ext/ruby_ndtypes/include/ndtypes.h +231 -122
  9. data/ext/ruby_ndtypes/include/ruby_ndtypes.h +1 -1
  10. data/ext/ruby_ndtypes/lib/libndtypes.a +0 -0
  11. data/ext/ruby_ndtypes/lib/libndtypes.so.0.2.0dev3 +0 -0
  12. data/ext/ruby_ndtypes/ndtypes/Makefile +87 -0
  13. data/ext/ruby_ndtypes/ndtypes/config.h +68 -0
  14. data/ext/ruby_ndtypes/ndtypes/config.log +477 -0
  15. data/ext/ruby_ndtypes/ndtypes/config.status +1027 -0
  16. data/ext/ruby_ndtypes/ndtypes/doc/_static/style.css +7 -0
  17. data/ext/ruby_ndtypes/ndtypes/doc/_templates/layout.html +2 -0
  18. data/ext/ruby_ndtypes/ndtypes/doc/conf.py +40 -4
  19. data/ext/ruby_ndtypes/ndtypes/doc/images/xndlogo.png +0 -0
  20. data/ext/ruby_ndtypes/ndtypes/doc/ndtypes/types.rst +1 -1
  21. data/ext/ruby_ndtypes/ndtypes/doc/requirements.txt +2 -0
  22. data/ext/ruby_ndtypes/ndtypes/libndtypes/Makefile +287 -0
  23. data/ext/ruby_ndtypes/ndtypes/libndtypes/Makefile.in +20 -4
  24. data/ext/ruby_ndtypes/ndtypes/libndtypes/Makefile.vc +22 -3
  25. data/ext/ruby_ndtypes/ndtypes/libndtypes/alloc.c +1 -1
  26. data/ext/ruby_ndtypes/ndtypes/libndtypes/alloc.o +0 -0
  27. data/ext/ruby_ndtypes/ndtypes/libndtypes/attr.o +0 -0
  28. data/ext/ruby_ndtypes/ndtypes/libndtypes/compat/Makefile +73 -0
  29. data/ext/ruby_ndtypes/ndtypes/libndtypes/compat/bpgrammar.c +246 -229
  30. data/ext/ruby_ndtypes/ndtypes/libndtypes/compat/bpgrammar.h +15 -11
  31. data/ext/ruby_ndtypes/ndtypes/libndtypes/compat/bpgrammar.o +0 -0
  32. data/ext/ruby_ndtypes/ndtypes/libndtypes/compat/bpgrammar.y +38 -28
  33. data/ext/ruby_ndtypes/ndtypes/libndtypes/compat/bplexer.c +91 -91
  34. data/ext/ruby_ndtypes/ndtypes/libndtypes/compat/bplexer.h +1 -1
  35. data/ext/ruby_ndtypes/ndtypes/libndtypes/compat/bplexer.l +4 -3
  36. data/ext/ruby_ndtypes/ndtypes/libndtypes/compat/bplexer.o +0 -0
  37. data/ext/ruby_ndtypes/ndtypes/libndtypes/compat/export.c +8 -7
  38. data/ext/ruby_ndtypes/ndtypes/libndtypes/compat/export.o +0 -0
  39. data/ext/ruby_ndtypes/ndtypes/libndtypes/compat/import.c +2 -2
  40. data/ext/ruby_ndtypes/ndtypes/libndtypes/compat/import.o +0 -0
  41. data/ext/ruby_ndtypes/ndtypes/libndtypes/context.o +0 -0
  42. data/ext/ruby_ndtypes/ndtypes/libndtypes/copy.c +263 -182
  43. data/ext/ruby_ndtypes/ndtypes/libndtypes/copy.o +0 -0
  44. data/ext/ruby_ndtypes/ndtypes/libndtypes/encodings.o +0 -0
  45. data/ext/ruby_ndtypes/ndtypes/libndtypes/equal.c +67 -7
  46. data/ext/ruby_ndtypes/ndtypes/libndtypes/equal.o +0 -0
  47. data/ext/ruby_ndtypes/ndtypes/libndtypes/grammar.c +1112 -1000
  48. data/ext/ruby_ndtypes/ndtypes/libndtypes/grammar.h +69 -58
  49. data/ext/ruby_ndtypes/ndtypes/libndtypes/grammar.o +0 -0
  50. data/ext/ruby_ndtypes/ndtypes/libndtypes/grammar.y +150 -99
  51. data/ext/ruby_ndtypes/ndtypes/libndtypes/io.c +185 -15
  52. data/ext/ruby_ndtypes/ndtypes/libndtypes/io.o +0 -0
  53. data/ext/ruby_ndtypes/ndtypes/libndtypes/lexer.c +301 -276
  54. data/ext/ruby_ndtypes/ndtypes/libndtypes/lexer.h +1 -1
  55. data/ext/ruby_ndtypes/ndtypes/libndtypes/lexer.l +9 -4
  56. data/ext/ruby_ndtypes/ndtypes/libndtypes/lexer.o +0 -0
  57. data/ext/ruby_ndtypes/ndtypes/libndtypes/libndtypes.a +0 -0
  58. data/ext/ruby_ndtypes/ndtypes/libndtypes/libndtypes.so +1 -0
  59. data/ext/ruby_ndtypes/ndtypes/libndtypes/libndtypes.so.0 +1 -0
  60. data/ext/ruby_ndtypes/ndtypes/libndtypes/libndtypes.so.0.2.0dev3 +0 -0
  61. data/ext/ruby_ndtypes/ndtypes/libndtypes/match.c +729 -228
  62. data/ext/ruby_ndtypes/ndtypes/libndtypes/match.o +0 -0
  63. data/ext/ruby_ndtypes/ndtypes/libndtypes/ndtypes.c +768 -403
  64. data/ext/ruby_ndtypes/ndtypes/libndtypes/ndtypes.h +1002 -0
  65. data/ext/ruby_ndtypes/ndtypes/libndtypes/ndtypes.h.in +231 -122
  66. data/ext/ruby_ndtypes/ndtypes/libndtypes/ndtypes.o +0 -0
  67. data/ext/ruby_ndtypes/ndtypes/libndtypes/parsefuncs.c +176 -84
  68. data/ext/ruby_ndtypes/ndtypes/libndtypes/parsefuncs.h +26 -14
  69. data/ext/ruby_ndtypes/ndtypes/libndtypes/parsefuncs.o +0 -0
  70. data/ext/ruby_ndtypes/ndtypes/libndtypes/parser.c +57 -35
  71. data/ext/ruby_ndtypes/ndtypes/libndtypes/parser.o +0 -0
  72. data/ext/ruby_ndtypes/ndtypes/libndtypes/primitive.c +420 -0
  73. data/ext/ruby_ndtypes/ndtypes/libndtypes/primitive.o +0 -0
  74. data/ext/ruby_ndtypes/ndtypes/libndtypes/seq.c +8 -8
  75. data/ext/ruby_ndtypes/ndtypes/libndtypes/seq.h +1 -1
  76. data/ext/ruby_ndtypes/ndtypes/libndtypes/seq.o +0 -0
  77. data/ext/ruby_ndtypes/ndtypes/libndtypes/serialize/Makefile +48 -0
  78. data/ext/ruby_ndtypes/ndtypes/libndtypes/serialize/deserialize.c +200 -116
  79. data/ext/ruby_ndtypes/ndtypes/libndtypes/serialize/deserialize.o +0 -0
  80. data/ext/ruby_ndtypes/ndtypes/libndtypes/serialize/serialize.c +46 -4
  81. data/ext/ruby_ndtypes/ndtypes/libndtypes/serialize/serialize.o +0 -0
  82. data/ext/ruby_ndtypes/ndtypes/libndtypes/substitute.c +58 -27
  83. data/ext/ruby_ndtypes/ndtypes/libndtypes/substitute.h +1 -1
  84. data/ext/ruby_ndtypes/ndtypes/libndtypes/substitute.o +0 -0
  85. data/ext/ruby_ndtypes/ndtypes/libndtypes/symtable.c +3 -5
  86. data/ext/ruby_ndtypes/ndtypes/libndtypes/symtable.h +12 -4
  87. data/ext/ruby_ndtypes/ndtypes/libndtypes/symtable.o +0 -0
  88. data/ext/ruby_ndtypes/ndtypes/libndtypes/tests/Makefile +55 -0
  89. data/ext/ruby_ndtypes/ndtypes/libndtypes/tests/Makefile.in +8 -8
  90. data/ext/ruby_ndtypes/ndtypes/libndtypes/tests/Makefile.vc +5 -5
  91. data/ext/ruby_ndtypes/ndtypes/libndtypes/tests/runtest.c +274 -172
  92. data/ext/ruby_ndtypes/ndtypes/libndtypes/tests/test.h +24 -4
  93. data/ext/ruby_ndtypes/ndtypes/libndtypes/tests/test_array.c +2 -2
  94. data/ext/ruby_ndtypes/ndtypes/libndtypes/tests/test_buffer.c +14 -14
  95. data/ext/ruby_ndtypes/ndtypes/libndtypes/tests/test_match.c +32 -30
  96. data/ext/ruby_ndtypes/ndtypes/libndtypes/tests/test_parse.c +37 -0
  97. data/ext/ruby_ndtypes/ndtypes/libndtypes/tests/test_parse_error.c +36 -0
  98. data/ext/ruby_ndtypes/ndtypes/libndtypes/tests/test_parse_roundtrip.c +16 -0
  99. data/ext/ruby_ndtypes/ndtypes/libndtypes/tests/test_record.c +5 -5
  100. data/ext/ruby_ndtypes/ndtypes/libndtypes/tests/test_typecheck.c +706 -253
  101. data/ext/ruby_ndtypes/ndtypes/libndtypes/tests/test_unify.c +132 -0
  102. data/ext/ruby_ndtypes/ndtypes/libndtypes/unify.c +703 -0
  103. data/ext/ruby_ndtypes/ndtypes/libndtypes/unify.o +0 -0
  104. data/ext/ruby_ndtypes/ndtypes/libndtypes/util.c +335 -127
  105. data/ext/ruby_ndtypes/ndtypes/libndtypes/util.o +0 -0
  106. data/ext/ruby_ndtypes/ndtypes/libndtypes/values.c +2 -2
  107. data/ext/ruby_ndtypes/ndtypes/libndtypes/values.o +0 -0
  108. data/ext/ruby_ndtypes/ndtypes/python/ndt_randtype.py +88 -71
  109. data/ext/ruby_ndtypes/ndtypes/python/ndt_support.py +0 -1
  110. data/ext/ruby_ndtypes/ndtypes/python/ndtypes/__init__.py +10 -13
  111. data/ext/ruby_ndtypes/ndtypes/python/ndtypes/_ndtypes.c +395 -314
  112. data/ext/ruby_ndtypes/ndtypes/python/ndtypes/libndtypes.a +0 -0
  113. data/ext/ruby_ndtypes/ndtypes/python/ndtypes/libndtypes.so +1 -0
  114. data/ext/ruby_ndtypes/ndtypes/python/ndtypes/libndtypes.so.0 +1 -0
  115. data/ext/ruby_ndtypes/ndtypes/python/ndtypes/libndtypes.so.0.2.0dev3 +0 -0
  116. data/ext/ruby_ndtypes/ndtypes/python/ndtypes/ndtypes.h +1002 -0
  117. data/ext/ruby_ndtypes/ndtypes/python/ndtypes/pyndtypes.h +15 -33
  118. data/ext/ruby_ndtypes/ndtypes/python/test_ndtypes.py +340 -132
  119. data/ext/ruby_ndtypes/ndtypes/setup.py +11 -2
  120. data/ext/ruby_ndtypes/ruby_ndtypes.c +364 -241
  121. data/ext/ruby_ndtypes/ruby_ndtypes.h +1 -1
  122. data/ext/ruby_ndtypes/ruby_ndtypes_internal.h +0 -1
  123. data/lib/ndtypes.rb +11 -0
  124. data/lib/ndtypes/version.rb +2 -2
  125. data/lib/ruby_ndtypes.so +0 -0
  126. data/ndtypes.gemspec +3 -0
  127. data/spec/ndtypes_spec.rb +6 -0
  128. metadata +98 -4
  129. data/ext/ruby_ndtypes/gc_guard.c +0 -36
  130. data/ext/ruby_ndtypes/gc_guard.h +0 -12
@@ -38,6 +38,13 @@
38
38
  #include "ndtypes.h"
39
39
 
40
40
 
41
+
42
+ #define XSTRINGIZE(v) #v
43
+ #define STRINGIZE(v) XSTRINGIZE(v)
44
+
45
+ #define loc() __FILE__ ":" STRINGIZE(__LINE__)
46
+
47
+
41
48
  typedef struct {
42
49
  const char *input;
43
50
  const char *indented;
@@ -50,12 +57,24 @@ typedef struct {
50
57
  } match_testcase_t;
51
58
 
52
59
  typedef struct {
60
+ const char *t1;
61
+ const char *t2;
62
+ const char *expected;
63
+ } unify_testcase_t;
64
+
65
+ typedef struct {
66
+ const char *loc;
67
+ bool success;
68
+
53
69
  const char *signature;
54
- const char *in[128];
55
- const char *out[128];
56
- const char *broadcast[128];
70
+ const char *args[NDT_MAX_ARGS];
71
+ const char *kwargs[NDT_MAX_ARGS];
72
+
57
73
  int outer_dims;
58
- bool success;
74
+ int nin;
75
+ int nout;
76
+ int nargs;
77
+ const char *types[NDT_MAX_ARGS];
59
78
  } typecheck_testcase_t;
60
79
 
61
80
  typedef struct {
@@ -72,6 +91,7 @@ extern const indent_testcase_t indent_tests[];
72
91
  extern const char *typedef_tests[];
73
92
  extern const char *typedef_error_tests[];
74
93
  extern const match_testcase_t match_tests[];
94
+ extern const unify_testcase_t unify_tests[];
75
95
  extern const typecheck_testcase_t typecheck_tests[];
76
96
  extern const numba_testcase_t numba_tests[];
77
97
  extern const char *buffer_tests[];
@@ -75,7 +75,7 @@ int
75
75
  test_array(void)
76
76
  {
77
77
  ndt_context_t *ctx;
78
- ndt_t *t;
78
+ const ndt_t *t;
79
79
 
80
80
  ctx = ndt_context_new();
81
81
  if (ctx == NULL) {
@@ -105,7 +105,7 @@ test_array(void)
105
105
  fprintf(stderr, "test_array (1 test case)\n");
106
106
  }
107
107
 
108
- ndt_del(t);
108
+ ndt_decref(t);
109
109
  ndt_context_del(ctx);
110
110
 
111
111
  return 0;
@@ -42,7 +42,7 @@ const char *buffer_tests[] = {
42
42
  "H", "I", "L", "Q",
43
43
  "n", "N",
44
44
  "e", "f", "d",
45
- "E", "F", "D",
45
+ "Ze", "Zf", "Zd",
46
46
  "s", "100s",
47
47
  "T{b:a:100s:b:}",
48
48
 
@@ -52,21 +52,21 @@ const char *buffer_tests[] = {
52
52
  "(2,3)b",
53
53
  "(0,2,0)B",
54
54
  "(1,2,3,4)h",
55
- "(2,3,10)F",
56
- "(20,2,100)D",
55
+ "(2,3,10)Zf",
56
+ "(20,2,100)Zd",
57
57
  "(10,2)s",
58
58
  "(10,2)100s",
59
59
  "(10,2)T{b:a:100s:b:}",
60
60
  "(10,2)T{b:a:100s:b:}",
61
61
 
62
- "T{T{F:foo:(2,3)L:bar:}:a:100s:b:}",
62
+ "T{T{Zf:foo:(2,3)L:bar:}:a:100s:b:}",
63
63
 
64
64
  "f -> f",
65
65
  "ff -> f",
66
66
  "fc -> f",
67
- "F -> Q",
67
+ "Zf -> Q",
68
68
 
69
- "T{b:a:100s:b:} -> T{T{F:foo:(2,3)L:bar:}:a:100s:b:}",
69
+ "T{b:a:100s:b:} -> T{T{Zf:foo:(2,3)L:bar:}:a:100s:b:}",
70
70
 
71
71
  NULL
72
72
  };
@@ -83,9 +83,9 @@ const char *buffer_roundtrip_tests[] = {
83
83
  "=e", "<e", ">e",
84
84
  "=f", "<f", ">f",
85
85
  "=d", "<d", ">d",
86
- "=E", "<E", ">E",
87
- "=F", "<F", ">F",
88
- "=D", "<D", ">D",
86
+ "=Ze", "<Ze", ">Ze",
87
+ "=Zf", "<Zf", ">Zf",
88
+ "=Zd", "<Zd", ">Zd",
89
89
 
90
90
  "(2)=Q",
91
91
  "(2)<Q",
@@ -98,16 +98,16 @@ const char *buffer_roundtrip_tests[] = {
98
98
  "(2,3,4)>Q",
99
99
 
100
100
  "T{=b:a:100s:b:}",
101
- "T{T{=F:foo:(2,3)=I:bar:}:a:100s:b:}",
101
+ "T{T{=Zf:foo:(2,3)=I:bar:}:a:100s:b:}",
102
102
 
103
103
  NULL
104
104
  };
105
105
 
106
106
  const char *buffer_error_tests[] = {
107
107
  "&",
108
- "Ze",
109
- "Zf",
110
- "Zd",
108
+ "E",
109
+ "F",
110
+ "D",
111
111
  "O", "O",
112
112
  "T{O:a:100O:b:}",
113
113
 
@@ -131,7 +131,7 @@ const char *buffer_error_tests[] = {
131
131
  "(10,2)T{b:a:100s:b:{",
132
132
  "(10,2)T{b:a:100s:b:}}",
133
133
 
134
- "T{T{F:foo:(2,3)%:bar:}:a:100s:b:}",
134
+ "T{T{Zf:foo:(2,3)%:bar:}:a:100s:b:}",
135
135
 
136
136
  NULL
137
137
  };
@@ -177,23 +177,23 @@ const match_testcase_t match_tests[] = {
177
177
  "?bool",
178
178
  1 },
179
179
 
180
- { "10 * Signed",
181
- "10 * Signed",
180
+ { "10 * signed",
181
+ "10 * signed",
182
182
  0 },
183
183
 
184
- { "10 * Signed",
184
+ { "10 * signed",
185
185
  "10 * int32",
186
186
  1 },
187
187
 
188
- { "Signed",
189
- "Signed",
188
+ { "signed",
189
+ "signed",
190
190
  0 },
191
191
 
192
- { "Signed",
192
+ { "signed",
193
193
  "int64",
194
194
  1 },
195
195
 
196
- { "?Signed",
196
+ { "?signed",
197
197
  "?int16",
198
198
  1 },
199
199
 
@@ -206,7 +206,7 @@ const match_testcase_t match_tests[] = {
206
206
  1 },
207
207
 
208
208
  { "?int8",
209
- "?Signed",
209
+ "?signed",
210
210
  0 },
211
211
 
212
212
  { "10 * int16",
@@ -245,20 +245,20 @@ const match_testcase_t match_tests[] = {
245
245
  "?int64",
246
246
  1 },
247
247
 
248
- { "10 * Unsigned",
248
+ { "10 * unsigned",
249
249
  "10 * uint16",
250
250
  1 },
251
251
 
252
- { "10 * Unsigned",
252
+ { "10 * unsigned",
253
253
  "10 * uint8",
254
254
  1 },
255
255
 
256
- { "Unsigned",
257
- "Unsigned",
256
+ { "unsigned",
257
+ "unsigned",
258
258
  0 },
259
259
 
260
- { "?Unsigned",
261
- "?Unsigned",
260
+ { "?unsigned",
261
+ "?unsigned",
262
262
  0 },
263
263
 
264
264
  { "10 * uint8",
@@ -309,11 +309,11 @@ const match_testcase_t match_tests[] = {
309
309
  "?uint64",
310
310
  1 },
311
311
 
312
- { "10 * Float",
313
- "10 * Float",
312
+ { "10 * float",
313
+ "10 * float",
314
314
  0 },
315
315
 
316
- { "10 * Float",
316
+ { "10 * float",
317
317
  "10 * float64",
318
318
  1 },
319
319
 
@@ -325,30 +325,22 @@ const match_testcase_t match_tests[] = {
325
325
  "?float64",
326
326
  1 },
327
327
 
328
- { "10 * Complex",
328
+ { "10 * complex",
329
329
  "10 * complex128",
330
330
  1 },
331
331
 
332
- { "10 * Complex",
332
+ { "10 * complex",
333
333
  "10 * complex64",
334
334
  1 },
335
335
 
336
- { "Complex",
337
- "Complex",
336
+ { "complex",
337
+ "complex",
338
338
  0 },
339
339
 
340
- { "Complex",
340
+ { "complex",
341
341
  "complex128",
342
342
  1 },
343
343
 
344
- { "?Complex",
345
- "?X",
346
- 0 },
347
-
348
- { "?X",
349
- "?Complex",
350
- 0 },
351
-
352
344
  { "10 * complex64",
353
345
  "10 * complex64",
354
346
  1 },
@@ -2391,6 +2383,16 @@ const match_testcase_t match_tests[] = {
2391
2383
  { "... * F[N * 2 * float64]",
2392
2384
  "!10 * 3 * 2 * float64", 0 },
2393
2385
 
2386
+ /* array... */
2387
+ { "array... of float64",
2388
+ "2 * 3 * float64", 0 },
2389
+
2390
+ { "array... of float64",
2391
+ "array of float64", 1 },
2392
+
2393
+ { "array... of float64",
2394
+ "array of array of float64", 1 },
2395
+
2394
2396
  /* END MANUALLY GENERATED */
2395
2397
 
2396
2398
  { NULL, NULL, 0 }
@@ -45,6 +45,8 @@ const char *parse_tests[] = {
45
45
  "10 * L * Any",
46
46
  "10 * 10 * L * Any",
47
47
  "var * Any",
48
+ "array of Any",
49
+ "array of array of Any",
48
50
  "... * Any",
49
51
  "10 * Any",
50
52
  "Any",
@@ -210,6 +212,8 @@ const char *parse_tests[] = {
210
212
  "10 * (Any, ...)",
211
213
  "(Any, ...)",
212
214
  "10 * {...}",
215
+ "10 * Float of float64",
216
+ "10 * Float of float64 | Int of int8",
213
217
  "{...}",
214
218
  "10 * {a: Any}",
215
219
  "{a: Any}",
@@ -255,19 +259,26 @@ const char *parse_tests[] = {
255
259
  "1286044356 * LbR6JPFI * 2096958782 * uint8",
256
260
  "categorical(-507014936.36, -25910, 'xM3Mys0XqH', 4265882500)",
257
261
  "var * var * FixedBytesKind",
262
+ "array of FixedBytesKind",
263
+ "array of array of FixedBytesKind",
258
264
  "var * var * var * fixed_bytes(size=2816010912, align=16)",
265
+ "array of fixed_bytes(size=2816010912, align=16)",
259
266
  "36 * 16 * fixed_bytes(size=912328236, align=2)",
260
267
  "var * var * float64",
268
+ "array of float64",
261
269
  "var * var * var * ZcTmBXnKPi",
270
+ "array of ZcTmBXnKPi",
262
271
  "categorical('omhwkoWVWw', 43, 946986991)",
263
272
  "var * float32",
264
273
  "var * var * var * uint16",
265
274
  "var * var * var * ScalarKind",
275
+ "array of ScalarKind",
266
276
  "fixed_bytes(size=280180380, align=2)",
267
277
  "fixed_string(1901614748, 'utf-32')",
268
278
  "var * M7",
269
279
  "var * bytes(align=2)",
270
280
  "var * var * ULy8(char)",
281
+ "array of ULy8(char)",
271
282
  "fixed_bytes(size=1882259744, align=16)",
272
283
  "categorical(-136747211.015, -58, -83)",
273
284
  "3739637665 * 1476113530 * 1701021063 * IKd * 450514382 * WXn",
@@ -275,6 +286,7 @@ const char *parse_tests[] = {
275
286
  "var * R8KFFEabJ",
276
287
  "var * QoFb",
277
288
  "var * fixed_string(1233383142, 'utf-32')",
289
+ "array of fixed_string(1233383142, 'utf-32')",
278
290
  "fixed_bytes(size=2882797968, align=4)",
279
291
  "fixed_bytes(size=1233209904, align=8)",
280
292
  "WhRsMHHXYp(categorical(145))",
@@ -299,6 +311,7 @@ const char *parse_tests[] = {
299
311
  "(int32, float64) -> int32",
300
312
  "int32, float64 -> int32",
301
313
  "(...) -> int32",
314
+ "void -> float32",
302
315
 
303
316
  "10 * defined_t",
304
317
  "defined_t",
@@ -306,6 +319,12 @@ const char *parse_tests[] = {
306
319
  "10 * foo_t",
307
320
  "foo_t",
308
321
 
322
+ /* bfloat16 */
323
+ "10 * bfloat16",
324
+
325
+ /* bcomplex32 */
326
+ "10 * bcomplex32",
327
+
309
328
  /* Half-float */
310
329
  "10 * float16",
311
330
  "10 * complex32",
@@ -326,6 +345,14 @@ const char *parse_tests[] = {
326
345
  "var(offsets=[0,10]) * var(offsets=[0,1,3,6,10,15,21,28,36,45,55]) * float64",
327
346
  "var(offsets=[0,2]) * var(offsets=[0,3,7]) * var(offsets=[0,5,11,18,26,35,45,56]) * float64",
328
347
 
348
+ /* Tagged unions */
349
+ "2 * 3 * ThisRecord of {first: (int64, complex128), second: string}",
350
+ "2 * 3 * ThisRecord of {first: (int64, complex128), second: string} | ThatTuple of (bytes, string)",
351
+ "2 * 3 * Int of int64 | ThisRecord of {first: (int64, complex128), second: string} | ThatTuple of (bytes, string)",
352
+ "array of Int of int64 | ThisRecord of {first: (int64, complex128), second: uint8} | ThatTuple of (float64, float64)",
353
+
354
+ "fixed(shape=10) * complex128",
355
+
329
356
  /* Short ref notation */
330
357
  "&float64",
331
358
  "&2 * 10 * {a: (&int64, &float64)}",
@@ -334,14 +361,24 @@ const char *parse_tests[] = {
334
361
  "!2 * 10 * float16",
335
362
  "!2 * 10 * {a: !2 * 10 * float16}",
336
363
  "!2 * 10 * {a: !2 * 10 * float16}",
364
+ "!2 * 10 * bfloat16",
365
+ "!2 * 10 * {a: !2 * 10 * bfloat16}",
366
+ "!2 * 10 * {a: !2 * 10 * bfloat16}",
337
367
  "!2 * 10 * {a: !2 * 10 * (int64, string)}",
338
368
 
369
+ /* Nested variable dimensions */
370
+ "var(offsets=[0, 2]) * var(offsets=[0,4,10]) * (var(offsets=[0,2]) * var(offsets=[0,3,5]) * float32, int64)",
371
+
339
372
  "2 * N * {a: !2 * 10 * (int64, string)}",
340
373
 
341
374
  /* Overflow */
342
375
  "9223372036854775807 * uint8",
343
376
  "1 * 1 * 9223372036854775807 * uint8",
344
377
 
378
+ /* var..., array... */
379
+ "var... * (int8, int64)",
380
+ "array... of (int8, int64)",
381
+
345
382
  /* END MANUALLY GENERATED */
346
383
 
347
384
  NULL
@@ -396,6 +396,7 @@ const char *parse_error_tests[] = {
396
396
  "?[10 * 10 $ X * Any$",
397
397
  "?[10 * 10 $ X * Any$",
398
398
  "$var * Any",
399
+ "$array of Any",
399
400
  "=var * Any",
400
401
  "$[var * Any]",
401
402
  "xxx[var * Any]",
@@ -15925,6 +15926,17 @@ const char *parse_error_tests[] = {
15925
15926
  "?=10 * {x: int64$ a: Any}]",
15926
15927
  "?[10 * {x: int64$ a: Any}$",
15927
15928
  "?[10 * {x: int64$ a: Any}$",
15929
+ "?10 * $Tag of int64",
15930
+ "?10 * Tag $of int64",
15931
+ "?10 * Tag of $int64",
15932
+ "?10 * Tag of int64$",
15933
+ "?10 * Tag of int64$",
15934
+ "?10 * A of int64 $| B of float64",
15935
+ "?10 * A of int64 | $B of float64",
15936
+ "?10 * A of int64 | B $of float64",
15937
+ "?10 * A of int64 | B of $float64",
15938
+ "?10 * A of int64 | B of float64$",
15939
+ "?10 * A of int64 | B of float64$",
15928
15940
  "{x: int64$ a: Any}",
15929
15941
  "?{x: int64$ a: Any}",
15930
15942
  "?({x: int64$ a: Any})",
@@ -27736,10 +27748,13 @@ const char *parse_error_tests[] = {
27736
27748
  "fixed_bytes(1342281638, align=xxx)",
27737
27749
  "Y5vtk * var * 905934102 * 1310846899 * fixed[3359714476] * LKgwlEDf * 2822334059 * ; PKI_8Ob8(fixed_string(795133707))",
27738
27750
  "?(E00Lr_HMM * ... * UAzC * var * M4nJaK * , var * var * 1002912577 * PZPD)",
27751
+ "?(E00Lr_HMM * ... * UAzC * array of M4nJaK * , array of array of 1002912577 * PZPD)",
27739
27752
  "?ref(fixed_string(3865363101, 'ucs-10'))",
27740
27753
  "fixed[3622391868] * SUc9IusL * CaPaWth4m * CEwSPY_6Z * HPW * SbvgP * 29709a97707 * 1300296096 * Fixed * VA8O",
27741
27754
  "fixed[1603107638)] * 2764230114 * IRXLe * Odlw6RSx * ... * Fixed * var * 2484716214 * ScalarKind",
27755
+ "fixed[1603107638)] * 2764230114 * IRXLe * Odlw6RSx * ... * Fixed * array of 2484716214 * ScalarKind",
27742
27756
  "ZmQxcy * var * 1098824011 * var * var * (,,,)",
27757
+ "ZmQxcy * array of 1098824011 of array of array * (,,,)",
27743
27758
  "ref(?x1869144321 * Y3_Dm0 * int32)",
27744
27759
  "categorical[\"a\", 1619552300, 490620000000000000000000000000000000000000, 18772, -84, 'l']",
27745
27760
  "?fixed[2889099917] * ... * var * JgdIXy5M * var * Wr2[categorical['gLsA7BM43V', 16460]]",
@@ -27747,6 +27762,7 @@ const char *parse_error_tests[] = {
27747
27762
  "?var * Fixed * FdN_HERKv * 4204012258 * var * fixed[233758212000000000000000000000000000] * Fixed * FixedBytesKind",
27748
27763
  "?categorical[30987, -16536, -270032755.642, -189, -823800099]",
27749
27764
  "?Fixed * 1998811088 * var * var * var * var * bytes(align=-58)",
27765
+ "?Fixed * 1998811088 * array of array of array of array of bytes(align=-58)",
27750
27766
  "257051452 * QRgi * Fixed * 4147849906 * var * P4h8i8 * var * 3924618173 * fixed[207255421] * int100",
27751
27767
  "categorical[408786241.474, 2840608325, 44038, 1763886348, \"jOt', 24]",
27752
27768
  "?[OQ78AW32d[categorical[49]%]",
@@ -27833,6 +27849,26 @@ const char *parse_error_tests[] = {
27833
27849
  "10 * 2 * (Dims... * int64)",
27834
27850
  "(Dims... * M * N * T, Dims... * N * P * T)",
27835
27851
 
27852
+ /* Nested variable dimensions */
27853
+ "var(offsets=[0,2]) * var(offsets=[0,4,10]) * (var(offsets=[0,2]) * var(offsets=[0,3]) * float32, int64)",
27854
+ "var(offsets=[0,2]) * var(offsets=[0,4,10]) * (var(offsets=[0,1]) * var(offsets=[0,3,5]) * float32, int64)",
27855
+ "var(offsets=[0,2]) * var(offsets=[0,4]) * (var(offsets=[0,2]) * var(offsets=[0,3,5]) * float32, int64)",
27856
+ "var(offsets=[0,1]) * var(offsets=[0,4,10]) * (var(offsets=[0,2]) * var(offsets=[0,3,5]) * float32, int64)",
27857
+ "var(offsets=[0,2]) * var(offsets=[0,4,10]) * (var(offsets=[0,2]) * var(offsets=[0,3,5]) * float32, intXX)",
27858
+ "var(offsets=[0,2]) * var(offsets=[0,4,10]) * (var(offsets=[0,2]) * var(offsets=[0,3,5)) * float32, int64)",
27859
+ "var(offsets=[0,2]) * var(offsets=[0,4,10]) * (var(offsets=(0,2]) * var(offsets=[0,3,5]) * float32, int64)",
27860
+
27861
+ /* Unions */
27862
+ "2 * 3 * []",
27863
+ "Array of 2 * 3 * int64 | $Record of { s: int64 }",
27864
+ "Array of 2 * 3 * int64 | Record of { s: int64XX }",
27865
+ "This of int64 | Array of 2 * 3 * (float64, ref(int64))",
27866
+
27867
+ /* var... and array... */
27868
+ "var... of float64",
27869
+ "var... * (int64, str)",
27870
+ "array... * float64",
27871
+ "array... * (int64, str)",
27836
27872
  /* END MANUALLY GENERATED */
27837
27873
 
27838
27874
  NULL