teptris 0.3.19.1 → 0.3.21.0
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/Steepfile +1 -0
- data/ext/teptris_ext/engine/README.md +1 -1
- data/ext/teptris_ext/engine/src/include/teptris/schema.h +107 -0
- data/ext/teptris_ext/engine/src/include/teptris/version.h +2 -2
- data/ext/teptris_ext/engine/src/teptris/schema/formats.c +656 -0
- data/ext/teptris_ext/engine/src/teptris/schema/json_read.c +440 -0
- data/ext/teptris_ext/engine/src/teptris/schema/json_read.h +34 -0
- data/ext/teptris_ext/engine/src/teptris/schema/regex.c +1090 -0
- data/ext/teptris_ext/engine/src/teptris/schema/regex.h +25 -0
- data/ext/teptris_ext/engine/src/teptris/schema/schema.c +734 -0
- data/ext/teptris_ext/engine/src/teptris/schema/schema_internal.h +221 -0
- data/ext/teptris_ext/engine/src/teptris/schema/validate.c +1034 -0
- data/ext/teptris_ext/materialize.c +87 -1
- data/lib/teptris/schema.rb +64 -0
- data/lib/teptris/version.rb +1 -1
- data/lib/teptris.rb +1 -0
- data/sig/teptris.rbs +32 -0
- metadata +12 -2
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
/* The safe regex subset: internal to the schema subsystem; see
|
|
2
|
+
* regex.c for the engine contract. */
|
|
3
|
+
#ifndef TEPTRIS_SCHEMA_REGEX_H
|
|
4
|
+
#define TEPTRIS_SCHEMA_REGEX_H
|
|
5
|
+
|
|
6
|
+
#include <stdbool.h>
|
|
7
|
+
#include <stddef.h>
|
|
8
|
+
#include <stdint.h>
|
|
9
|
+
|
|
10
|
+
#include "teptris/memory/arena.h"
|
|
11
|
+
|
|
12
|
+
typedef struct sch_regex sch_regex;
|
|
13
|
+
|
|
14
|
+
/* Compile a pattern into the arena; NULL with a diagnostic on error. */
|
|
15
|
+
struct sch_regex *sch_regex_compile(teptris_arena *a, const char *pattern,
|
|
16
|
+
size_t len, char *err, size_t err_cap);
|
|
17
|
+
|
|
18
|
+
/* ECMA-style unanchored search over UTF-8 bytes. */
|
|
19
|
+
bool sch_regex_is_match(const struct sch_regex *re, const char *utf8,
|
|
20
|
+
size_t len);
|
|
21
|
+
|
|
22
|
+
/* Search over pre-decoded code points. */
|
|
23
|
+
bool sch_regex_search(const struct sch_regex *re, const uint32_t *s, int len);
|
|
24
|
+
|
|
25
|
+
#endif
|