trilean-regex 1.0.1 → 1.0.2
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.
- package/dist/matcher.cjs +2 -4
- package/dist/matcher.d.cts +2 -4
- package/dist/matcher.d.ts +2 -4
- package/dist/matcher.js +2 -4
- package/dist/parser.cjs +1 -2
- package/dist/parser.d.cts +1 -2
- package/dist/parser.d.ts +1 -2
- package/dist/parser.js +1 -2
- package/package.json +2 -2
package/dist/matcher.cjs
CHANGED
|
@@ -68,8 +68,7 @@ function matchesNfa(nfa, input) {
|
|
|
68
68
|
* Parses `pattern` (this package's grammar; see README.md) and compiles it to a reference matcher.
|
|
69
69
|
*
|
|
70
70
|
* Prefer this over `testPattern` when the same pattern will be tested against more than one input: it parses and compiles exactly once, and the returned `CompiledPattern.test` is then only the O(length x states) simulation.
|
|
71
|
-
*
|
|
72
|
-
* @throws {RegexParseError} if `pattern` is not a valid pattern in this grammar.
|
|
71
|
+
* @throws `RegexParseError` if `pattern` is not a valid pattern in this grammar.
|
|
73
72
|
*/
|
|
74
73
|
function compilePattern(pattern) {
|
|
75
74
|
const nfa = require_nfa.compileToNfa(require_parser.parseRegex(pattern));
|
|
@@ -77,8 +76,7 @@ function compilePattern(pattern) {
|
|
|
77
76
|
}
|
|
78
77
|
/**
|
|
79
78
|
* Parses `pattern` and tests it against `input` in one call. Equivalent to `compilePattern(pattern).test(input)`, and exactly as cheap for a single test -- prefer `compilePattern` instead when the same pattern will be reused, so the parse and compile steps happen once rather than once per input.
|
|
80
|
-
*
|
|
81
|
-
* @throws {RegexParseError} if `pattern` is not a valid pattern in this grammar.
|
|
79
|
+
* @throws `RegexParseError` if `pattern` is not a valid pattern in this grammar.
|
|
82
80
|
*/
|
|
83
81
|
function testPattern(pattern, input) {
|
|
84
82
|
return compilePattern(pattern).test(input);
|
package/dist/matcher.d.cts
CHANGED
|
@@ -17,14 +17,12 @@ interface CompiledPattern {
|
|
|
17
17
|
* Parses `pattern` (this package's grammar; see README.md) and compiles it to a reference matcher.
|
|
18
18
|
*
|
|
19
19
|
* Prefer this over `testPattern` when the same pattern will be tested against more than one input: it parses and compiles exactly once, and the returned `CompiledPattern.test` is then only the O(length x states) simulation.
|
|
20
|
-
*
|
|
21
|
-
* @throws {RegexParseError} if `pattern` is not a valid pattern in this grammar.
|
|
20
|
+
* @throws `RegexParseError` if `pattern` is not a valid pattern in this grammar.
|
|
22
21
|
*/
|
|
23
22
|
declare function compilePattern(pattern: string): CompiledPattern;
|
|
24
23
|
/**
|
|
25
24
|
* Parses `pattern` and tests it against `input` in one call. Equivalent to `compilePattern(pattern).test(input)`, and exactly as cheap for a single test -- prefer `compilePattern` instead when the same pattern will be reused, so the parse and compile steps happen once rather than once per input.
|
|
26
|
-
*
|
|
27
|
-
* @throws {RegexParseError} if `pattern` is not a valid pattern in this grammar.
|
|
25
|
+
* @throws `RegexParseError` if `pattern` is not a valid pattern in this grammar.
|
|
28
26
|
*/
|
|
29
27
|
declare function testPattern(pattern: string, input: string): boolean;
|
|
30
28
|
//#endregion
|
package/dist/matcher.d.ts
CHANGED
|
@@ -17,14 +17,12 @@ interface CompiledPattern {
|
|
|
17
17
|
* Parses `pattern` (this package's grammar; see README.md) and compiles it to a reference matcher.
|
|
18
18
|
*
|
|
19
19
|
* Prefer this over `testPattern` when the same pattern will be tested against more than one input: it parses and compiles exactly once, and the returned `CompiledPattern.test` is then only the O(length x states) simulation.
|
|
20
|
-
*
|
|
21
|
-
* @throws {RegexParseError} if `pattern` is not a valid pattern in this grammar.
|
|
20
|
+
* @throws `RegexParseError` if `pattern` is not a valid pattern in this grammar.
|
|
22
21
|
*/
|
|
23
22
|
declare function compilePattern(pattern: string): CompiledPattern;
|
|
24
23
|
/**
|
|
25
24
|
* Parses `pattern` and tests it against `input` in one call. Equivalent to `compilePattern(pattern).test(input)`, and exactly as cheap for a single test -- prefer `compilePattern` instead when the same pattern will be reused, so the parse and compile steps happen once rather than once per input.
|
|
26
|
-
*
|
|
27
|
-
* @throws {RegexParseError} if `pattern` is not a valid pattern in this grammar.
|
|
25
|
+
* @throws `RegexParseError` if `pattern` is not a valid pattern in this grammar.
|
|
28
26
|
*/
|
|
29
27
|
declare function testPattern(pattern: string, input: string): boolean;
|
|
30
28
|
//#endregion
|
package/dist/matcher.js
CHANGED
|
@@ -67,8 +67,7 @@ function matchesNfa(nfa, input) {
|
|
|
67
67
|
* Parses `pattern` (this package's grammar; see README.md) and compiles it to a reference matcher.
|
|
68
68
|
*
|
|
69
69
|
* Prefer this over `testPattern` when the same pattern will be tested against more than one input: it parses and compiles exactly once, and the returned `CompiledPattern.test` is then only the O(length x states) simulation.
|
|
70
|
-
*
|
|
71
|
-
* @throws {RegexParseError} if `pattern` is not a valid pattern in this grammar.
|
|
70
|
+
* @throws `RegexParseError` if `pattern` is not a valid pattern in this grammar.
|
|
72
71
|
*/
|
|
73
72
|
function compilePattern(pattern) {
|
|
74
73
|
const nfa = compileToNfa(parseRegex(pattern));
|
|
@@ -76,8 +75,7 @@ function compilePattern(pattern) {
|
|
|
76
75
|
}
|
|
77
76
|
/**
|
|
78
77
|
* Parses `pattern` and tests it against `input` in one call. Equivalent to `compilePattern(pattern).test(input)`, and exactly as cheap for a single test -- prefer `compilePattern` instead when the same pattern will be reused, so the parse and compile steps happen once rather than once per input.
|
|
79
|
-
*
|
|
80
|
-
* @throws {RegexParseError} if `pattern` is not a valid pattern in this grammar.
|
|
78
|
+
* @throws `RegexParseError` if `pattern` is not a valid pattern in this grammar.
|
|
81
79
|
*/
|
|
82
80
|
function testPattern(pattern, input) {
|
|
83
81
|
return compilePattern(pattern).test(input);
|
package/dist/parser.cjs
CHANGED
|
@@ -316,8 +316,7 @@ var Parser = class {
|
|
|
316
316
|
* Parses a pattern in this package's grammar (see README.md) into a `RegexNode` AST.
|
|
317
317
|
*
|
|
318
318
|
* Never returns a partial result: a pattern either parses completely, with nothing left over, or this throws `RegexParseError` naming exactly where parsing could not proceed.
|
|
319
|
-
*
|
|
320
|
-
* @throws {RegexParseError} if `pattern` is not a complete, valid pattern in this grammar.
|
|
319
|
+
* @throws `RegexParseError` if `pattern` is not a complete, valid pattern in this grammar.
|
|
321
320
|
*/
|
|
322
321
|
function parseRegex(pattern) {
|
|
323
322
|
const parser = new Parser(pattern);
|
package/dist/parser.d.cts
CHANGED
|
@@ -4,8 +4,7 @@ import { d as RegexNode } from "./ast-D8HLFxxv.cjs";
|
|
|
4
4
|
* Parses a pattern in this package's grammar (see README.md) into a `RegexNode` AST.
|
|
5
5
|
*
|
|
6
6
|
* Never returns a partial result: a pattern either parses completely, with nothing left over, or this throws `RegexParseError` naming exactly where parsing could not proceed.
|
|
7
|
-
*
|
|
8
|
-
* @throws {RegexParseError} if `pattern` is not a complete, valid pattern in this grammar.
|
|
7
|
+
* @throws `RegexParseError` if `pattern` is not a complete, valid pattern in this grammar.
|
|
9
8
|
*/
|
|
10
9
|
declare function parseRegex(pattern: string): RegexNode;
|
|
11
10
|
//#endregion
|
package/dist/parser.d.ts
CHANGED
|
@@ -4,8 +4,7 @@ import { d as RegexNode } from "./ast-D8HLFxxv.js";
|
|
|
4
4
|
* Parses a pattern in this package's grammar (see README.md) into a `RegexNode` AST.
|
|
5
5
|
*
|
|
6
6
|
* Never returns a partial result: a pattern either parses completely, with nothing left over, or this throws `RegexParseError` naming exactly where parsing could not proceed.
|
|
7
|
-
*
|
|
8
|
-
* @throws {RegexParseError} if `pattern` is not a complete, valid pattern in this grammar.
|
|
7
|
+
* @throws `RegexParseError` if `pattern` is not a complete, valid pattern in this grammar.
|
|
9
8
|
*/
|
|
10
9
|
declare function parseRegex(pattern: string): RegexNode;
|
|
11
10
|
//#endregion
|
package/dist/parser.js
CHANGED
|
@@ -315,8 +315,7 @@ var Parser = class {
|
|
|
315
315
|
* Parses a pattern in this package's grammar (see README.md) into a `RegexNode` AST.
|
|
316
316
|
*
|
|
317
317
|
* Never returns a partial result: a pattern either parses completely, with nothing left over, or this throws `RegexParseError` naming exactly where parsing could not proceed.
|
|
318
|
-
*
|
|
319
|
-
* @throws {RegexParseError} if `pattern` is not a complete, valid pattern in this grammar.
|
|
318
|
+
* @throws `RegexParseError` if `pattern` is not a complete, valid pattern in this grammar.
|
|
320
319
|
*/
|
|
321
320
|
function parseRegex(pattern) {
|
|
322
321
|
const parser = new Parser(pattern);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "trilean-regex",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.2",
|
|
4
4
|
"description": "A portable regular-expression grammar -- a true regular language, with a Thompson-construction reference matcher -- so a pattern means the same thing in process and wherever trilean-sql can push it down to a database's own engine.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"repository": {
|
|
@@ -74,7 +74,7 @@
|
|
|
74
74
|
],
|
|
75
75
|
"devDependencies": {
|
|
76
76
|
"@arethetypeswrong/cli": "^0.18.5",
|
|
77
|
-
"@exadev/eslint-config": "
|
|
77
|
+
"@exadev/eslint-config": "2.12.1",
|
|
78
78
|
"@types/node": "^26.4.0",
|
|
79
79
|
"@vitest/coverage-v8": "^4.1.11",
|
|
80
80
|
"eslint": "^10.9.1",
|