first commit

This commit is contained in:
2026-01-09 23:05:52 -05:00
commit dec0c8e4e4
4203 changed files with 824454 additions and 0 deletions

21
node_modules/oniguruma-to-es/LICENSE generated vendored Normal file
View File

@@ -0,0 +1,21 @@
MIT License
Copyright (c) 2025 Steven Levithan
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.

1110
node_modules/oniguruma-to-es/README.md generated vendored Normal file

File diff suppressed because it is too large Load Diff

27
node_modules/oniguruma-to-es/dist/cjs/generate.d.ts generated vendored Normal file
View File

@@ -0,0 +1,27 @@
/**
@import {ToRegExpOptions} from './index.js';
@import {RegexPlusAst} from './transform.js';
@import {AlternativeNode, AssertionNode, BackreferenceNode, CapturingGroupNode, CharacterClassNode, CharacterClassRangeNode, CharacterNode, CharacterSetNode, FlagsNode, GroupNode, LookaroundAssertionNode, Node, QuantifierNode, SubroutineNode} from 'oniguruma-parser/parser';
@import {Visitor} from 'oniguruma-parser/traverser';
*/
/**
Generates a Regex+ compatible `pattern`, `flags`, and `options` from a Regex+ AST.
@param {RegexPlusAst} ast
@param {ToRegExpOptions} [options]
@returns {{
pattern: string;
flags: string;
options: Object;
_captureTransfers: Map<number, Array<number>>;
_hiddenCaptures: Array<number>;
}}
*/
export function generate(ast: RegexPlusAst, options?: ToRegExpOptions): {
pattern: string;
flags: string;
options: any;
_captureTransfers: Map<number, Array<number>>;
_hiddenCaptures: Array<number>;
};
import type { RegexPlusAst } from './transform.js';
import type { ToRegExpOptions } from './index.js';

64
node_modules/oniguruma-to-es/dist/cjs/index.d.ts generated vendored Normal file
View File

@@ -0,0 +1,64 @@
export type ToRegExpOptions = {
accuracy?: "default" | "strict";
avoidSubclass?: boolean;
flags?: string;
global?: boolean;
hasIndices?: boolean;
lazyCompileLength?: number;
rules?: {
allowOrphanBackrefs?: boolean;
asciiWordBoundaries?: boolean;
captureGroup?: boolean;
recursionLimit?: number;
singleline?: boolean;
};
target?: "auto" | "ES2025" | "ES2024" | "ES2018";
verbose?: boolean;
};
import { EmulatedRegExp } from './subclass.js';
/**
@import {EmulatedRegExpOptions} from './subclass.js';
*/
/**
@typedef {{
accuracy?: keyof Accuracy;
avoidSubclass?: boolean;
flags?: string;
global?: boolean;
hasIndices?: boolean;
lazyCompileLength?: number;
rules?: {
allowOrphanBackrefs?: boolean;
asciiWordBoundaries?: boolean;
captureGroup?: boolean;
recursionLimit?: number;
singleline?: boolean;
};
target?: keyof Target;
verbose?: boolean;
}} ToRegExpOptions
*/
/**
Accepts an Oniguruma pattern and returns an equivalent JavaScript `RegExp`.
@param {string} pattern Oniguruma regex pattern.
@param {ToRegExpOptions} [options]
@returns {RegExp | EmulatedRegExp}
*/
export function toRegExp(pattern: string, options?: ToRegExpOptions): RegExp | EmulatedRegExp;
/**
Accepts an Oniguruma pattern and returns the details for an equivalent JavaScript `RegExp`.
@param {string} pattern Oniguruma regex pattern.
@param {ToRegExpOptions} [options]
@returns {{
pattern: string;
flags: string;
options?: EmulatedRegExpOptions;
}}
*/
export function toRegExpDetails(pattern: string, options?: ToRegExpOptions): {
pattern: string;
flags: string;
options?: EmulatedRegExpOptions;
};
import type { EmulatedRegExpOptions } from './subclass.js';
export { EmulatedRegExp };

3146
node_modules/oniguruma-to-es/dist/cjs/index.js generated vendored Normal file

File diff suppressed because it is too large Load Diff

7
node_modules/oniguruma-to-es/dist/cjs/index.js.map generated vendored Normal file

File diff suppressed because one or more lines are too long

26
node_modules/oniguruma-to-es/dist/cjs/options.d.ts generated vendored Normal file
View File

@@ -0,0 +1,26 @@
export namespace Accuracy {
let _default: "default";
export { _default as default };
export let strict: "strict";
}
export namespace EsVersion {
let ES2025: number;
let ES2024: number;
let ES2018: number;
}
/**
Returns a complete set of options, with default values set for options that weren't provided.
@param {ToRegExpOptions} [options]
@returns {Required<ToRegExpOptions>}
*/
export function getOptions(options?: ToRegExpOptions): Required<ToRegExpOptions>;
export namespace Target {
export let auto: "auto";
let ES2025_1: "ES2025";
export { ES2025_1 as ES2025 };
let ES2024_1: "ES2024";
export { ES2024_1 as ES2024 };
let ES2018_1: "ES2018";
export { ES2018_1 as ES2018 };
}
import type { ToRegExpOptions } from './index.js';

1
node_modules/oniguruma-to-es/dist/cjs/package.json generated vendored Normal file
View File

@@ -0,0 +1 @@
{"type":"commonjs"}

39
node_modules/oniguruma-to-es/dist/cjs/subclass.d.ts generated vendored Normal file
View File

@@ -0,0 +1,39 @@
export type EmulatedRegExpOptions = {
hiddenCaptures?: Array<number>;
lazyCompile?: boolean;
strategy?: string | null;
transfers?: Array<[number, Array<number>]>;
};
/**
@typedef {{
hiddenCaptures?: Array<number>;
lazyCompile?: boolean;
strategy?: string | null;
transfers?: Array<[number, Array<number>]>;
}} EmulatedRegExpOptions
*/
/**
Works the same as JavaScript's native `RegExp` constructor in all contexts, but can be given
results from `toRegExpDetails` to produce the same result as `toRegExp`.
*/
export class EmulatedRegExp extends RegExp {
/**
@overload
@param {string} pattern
@param {string} [flags]
@param {EmulatedRegExpOptions} [options]
*/
constructor(pattern: string, flags?: string, options?: EmulatedRegExpOptions);
/**
@overload
@param {EmulatedRegExp} pattern
@param {string} [flags]
*/
constructor(pattern: EmulatedRegExp, flags?: string);
/**
Can be used to serialize the instance.
@type {EmulatedRegExpOptions}
*/
rawOptions: EmulatedRegExpOptions;
#private;
}

52
node_modules/oniguruma-to-es/dist/cjs/transform.d.ts generated vendored Normal file
View File

@@ -0,0 +1,52 @@
export type RegexPlusAst = createAlternative & {
options: {
disable: {
[key: string]: boolean;
};
force: {
[key: string]: boolean;
};
};
_originMap: Map<createAlternative, createAlternative>;
_strategy: string | null;
};
/**
@import {CapturingGroupNode, OnigurumaAst, Node} from 'oniguruma-parser/parser';
@import {Visitor} from 'oniguruma-parser/traverser';
*/
/**
@typedef {
OnigurumaAst & {
options: {
disable: {[key: string]: boolean};
force: {[key: string]: boolean};
};
_originMap: Map<CapturingGroupNode, CapturingGroupNode>;
_strategy: string | null;
}
} RegexPlusAst
*/
/**
Transforms an Oniguruma AST in-place to a [Regex+](https://github.com/slevithan/regex) AST.
Assumes target ES2025, expecting the generator to down-convert to the desired JS target version.
Regex+'s syntax and behavior is a strict superset of native JavaScript, so the AST is very close
to representing native ES2025 `RegExp` but with some added features (atomic groups, possessive
quantifiers, recursion). The AST doesn't use some of Regex+'s extended features like flag x or
subroutines because they follow PCRE behavior and work somewhat differently than in Oniguruma. The
AST represents what's needed to precisely reproduce Oniguruma behavior using Regex+.
@param {OnigurumaAst} ast
@param {{
accuracy?: keyof Accuracy;
asciiWordBoundaries?: boolean;
avoidSubclass?: boolean;
bestEffortTarget?: keyof Target;
}} [options]
@returns {RegexPlusAst}
*/
export function transform(ast: createAlternative, options?: {
accuracy?: "default" | "strict";
asciiWordBoundaries?: boolean;
avoidSubclass?: boolean;
bestEffortTarget?: "auto" | "ES2025" | "ES2024" | "ES2018";
}): RegexPlusAst;

6
node_modules/oniguruma-to-es/dist/cjs/unicode.d.ts generated vendored Normal file
View File

@@ -0,0 +1,6 @@
export const asciiSpaceChar: "[\t-\r ]";
export const defaultWordChar: string;
export function getIgnoreCaseMatchChars(char: any): any[];
export const JsUnicodePropertyMap: Map<any, string>;
export const PosixClassMap: Map<string, string>;
export const UnicodePropertiesWithSpecificCase: Set<string>;

23
node_modules/oniguruma-to-es/dist/cjs/utils.d.ts generated vendored Normal file
View File

@@ -0,0 +1,23 @@
export const cp: (...codePoints: number[]) => string;
export namespace envFlags {
let bugFlagVLiteralHyphenIsRange: boolean;
let bugNestedClassIgnoresNegation: boolean;
}
export function getNewCurrentFlags(current: any, { enable, disable }: {
enable: any;
disable: any;
}): {
dotAll: boolean;
ignoreCase: boolean;
};
export function getOrInsert(map: any, key: any, defaultValue: any): any;
/**
@param {keyof Target} target
@param {keyof Target} min
@returns {boolean}
*/
export function isMinTarget(target: "auto" | "ES2025" | "ES2024" | "ES2018", min: "auto" | "ES2025" | "ES2024" | "ES2018"): boolean;
export const r: (template: {
raw: readonly string[] | ArrayLike<string>;
}, ...substitutions: any[]) => string;
export function throwIfNullish(value: any, msg: any): any;

27
node_modules/oniguruma-to-es/dist/esm/generate.d.ts generated vendored Normal file
View File

@@ -0,0 +1,27 @@
/**
@import {ToRegExpOptions} from './index.js';
@import {RegexPlusAst} from './transform.js';
@import {AlternativeNode, AssertionNode, BackreferenceNode, CapturingGroupNode, CharacterClassNode, CharacterClassRangeNode, CharacterNode, CharacterSetNode, FlagsNode, GroupNode, LookaroundAssertionNode, Node, QuantifierNode, SubroutineNode} from 'oniguruma-parser/parser';
@import {Visitor} from 'oniguruma-parser/traverser';
*/
/**
Generates a Regex+ compatible `pattern`, `flags`, and `options` from a Regex+ AST.
@param {RegexPlusAst} ast
@param {ToRegExpOptions} [options]
@returns {{
pattern: string;
flags: string;
options: Object;
_captureTransfers: Map<number, Array<number>>;
_hiddenCaptures: Array<number>;
}}
*/
export function generate(ast: RegexPlusAst, options?: ToRegExpOptions): {
pattern: string;
flags: string;
options: any;
_captureTransfers: Map<number, Array<number>>;
_hiddenCaptures: Array<number>;
};
import type { RegexPlusAst } from './transform.js';
import type { ToRegExpOptions } from './index.js';

64
node_modules/oniguruma-to-es/dist/esm/index.d.ts generated vendored Normal file
View File

@@ -0,0 +1,64 @@
export type ToRegExpOptions = {
accuracy?: "default" | "strict";
avoidSubclass?: boolean;
flags?: string;
global?: boolean;
hasIndices?: boolean;
lazyCompileLength?: number;
rules?: {
allowOrphanBackrefs?: boolean;
asciiWordBoundaries?: boolean;
captureGroup?: boolean;
recursionLimit?: number;
singleline?: boolean;
};
target?: "auto" | "ES2025" | "ES2024" | "ES2018";
verbose?: boolean;
};
import { EmulatedRegExp } from './subclass.js';
/**
@import {EmulatedRegExpOptions} from './subclass.js';
*/
/**
@typedef {{
accuracy?: keyof Accuracy;
avoidSubclass?: boolean;
flags?: string;
global?: boolean;
hasIndices?: boolean;
lazyCompileLength?: number;
rules?: {
allowOrphanBackrefs?: boolean;
asciiWordBoundaries?: boolean;
captureGroup?: boolean;
recursionLimit?: number;
singleline?: boolean;
};
target?: keyof Target;
verbose?: boolean;
}} ToRegExpOptions
*/
/**
Accepts an Oniguruma pattern and returns an equivalent JavaScript `RegExp`.
@param {string} pattern Oniguruma regex pattern.
@param {ToRegExpOptions} [options]
@returns {RegExp | EmulatedRegExp}
*/
export function toRegExp(pattern: string, options?: ToRegExpOptions): RegExp | EmulatedRegExp;
/**
Accepts an Oniguruma pattern and returns the details for an equivalent JavaScript `RegExp`.
@param {string} pattern Oniguruma regex pattern.
@param {ToRegExpOptions} [options]
@returns {{
pattern: string;
flags: string;
options?: EmulatedRegExpOptions;
}}
*/
export function toRegExpDetails(pattern: string, options?: ToRegExpOptions): {
pattern: string;
flags: string;
options?: EmulatedRegExpOptions;
};
import type { EmulatedRegExpOptions } from './subclass.js';
export { EmulatedRegExp };

1876
node_modules/oniguruma-to-es/dist/esm/index.js generated vendored Normal file

File diff suppressed because it is too large Load Diff

7
node_modules/oniguruma-to-es/dist/esm/index.js.map generated vendored Normal file

File diff suppressed because one or more lines are too long

26
node_modules/oniguruma-to-es/dist/esm/options.d.ts generated vendored Normal file
View File

@@ -0,0 +1,26 @@
export namespace Accuracy {
let _default: "default";
export { _default as default };
export let strict: "strict";
}
export namespace EsVersion {
let ES2025: number;
let ES2024: number;
let ES2018: number;
}
/**
Returns a complete set of options, with default values set for options that weren't provided.
@param {ToRegExpOptions} [options]
@returns {Required<ToRegExpOptions>}
*/
export function getOptions(options?: ToRegExpOptions): Required<ToRegExpOptions>;
export namespace Target {
export let auto: "auto";
let ES2025_1: "ES2025";
export { ES2025_1 as ES2025 };
let ES2024_1: "ES2024";
export { ES2024_1 as ES2024 };
let ES2018_1: "ES2018";
export { ES2018_1 as ES2018 };
}
import type { ToRegExpOptions } from './index.js';

1
node_modules/oniguruma-to-es/dist/esm/package.json generated vendored Normal file
View File

@@ -0,0 +1 @@
{"type":"module"}

39
node_modules/oniguruma-to-es/dist/esm/subclass.d.ts generated vendored Normal file
View File

@@ -0,0 +1,39 @@
export type EmulatedRegExpOptions = {
hiddenCaptures?: Array<number>;
lazyCompile?: boolean;
strategy?: string | null;
transfers?: Array<[number, Array<number>]>;
};
/**
@typedef {{
hiddenCaptures?: Array<number>;
lazyCompile?: boolean;
strategy?: string | null;
transfers?: Array<[number, Array<number>]>;
}} EmulatedRegExpOptions
*/
/**
Works the same as JavaScript's native `RegExp` constructor in all contexts, but can be given
results from `toRegExpDetails` to produce the same result as `toRegExp`.
*/
export class EmulatedRegExp extends RegExp {
/**
@overload
@param {string} pattern
@param {string} [flags]
@param {EmulatedRegExpOptions} [options]
*/
constructor(pattern: string, flags?: string, options?: EmulatedRegExpOptions);
/**
@overload
@param {EmulatedRegExp} pattern
@param {string} [flags]
*/
constructor(pattern: EmulatedRegExp, flags?: string);
/**
Can be used to serialize the instance.
@type {EmulatedRegExpOptions}
*/
rawOptions: EmulatedRegExpOptions;
#private;
}

52
node_modules/oniguruma-to-es/dist/esm/transform.d.ts generated vendored Normal file
View File

@@ -0,0 +1,52 @@
export type RegexPlusAst = createAlternative & {
options: {
disable: {
[key: string]: boolean;
};
force: {
[key: string]: boolean;
};
};
_originMap: Map<createAlternative, createAlternative>;
_strategy: string | null;
};
/**
@import {CapturingGroupNode, OnigurumaAst, Node} from 'oniguruma-parser/parser';
@import {Visitor} from 'oniguruma-parser/traverser';
*/
/**
@typedef {
OnigurumaAst & {
options: {
disable: {[key: string]: boolean};
force: {[key: string]: boolean};
};
_originMap: Map<CapturingGroupNode, CapturingGroupNode>;
_strategy: string | null;
}
} RegexPlusAst
*/
/**
Transforms an Oniguruma AST in-place to a [Regex+](https://github.com/slevithan/regex) AST.
Assumes target ES2025, expecting the generator to down-convert to the desired JS target version.
Regex+'s syntax and behavior is a strict superset of native JavaScript, so the AST is very close
to representing native ES2025 `RegExp` but with some added features (atomic groups, possessive
quantifiers, recursion). The AST doesn't use some of Regex+'s extended features like flag x or
subroutines because they follow PCRE behavior and work somewhat differently than in Oniguruma. The
AST represents what's needed to precisely reproduce Oniguruma behavior using Regex+.
@param {OnigurumaAst} ast
@param {{
accuracy?: keyof Accuracy;
asciiWordBoundaries?: boolean;
avoidSubclass?: boolean;
bestEffortTarget?: keyof Target;
}} [options]
@returns {RegexPlusAst}
*/
export function transform(ast: createAlternative, options?: {
accuracy?: "default" | "strict";
asciiWordBoundaries?: boolean;
avoidSubclass?: boolean;
bestEffortTarget?: "auto" | "ES2025" | "ES2024" | "ES2018";
}): RegexPlusAst;

6
node_modules/oniguruma-to-es/dist/esm/unicode.d.ts generated vendored Normal file
View File

@@ -0,0 +1,6 @@
export const asciiSpaceChar: "[\t-\r ]";
export const defaultWordChar: string;
export function getIgnoreCaseMatchChars(char: any): any[];
export const JsUnicodePropertyMap: Map<any, string>;
export const PosixClassMap: Map<string, string>;
export const UnicodePropertiesWithSpecificCase: Set<string>;

23
node_modules/oniguruma-to-es/dist/esm/utils.d.ts generated vendored Normal file
View File

@@ -0,0 +1,23 @@
export const cp: (...codePoints: number[]) => string;
export namespace envFlags {
let bugFlagVLiteralHyphenIsRange: boolean;
let bugNestedClassIgnoresNegation: boolean;
}
export function getNewCurrentFlags(current: any, { enable, disable }: {
enable: any;
disable: any;
}): {
dotAll: boolean;
ignoreCase: boolean;
};
export function getOrInsert(map: any, key: any, defaultValue: any): any;
/**
@param {keyof Target} target
@param {keyof Target} min
@returns {boolean}
*/
export function isMinTarget(target: "auto" | "ES2025" | "ES2024" | "ES2018", min: "auto" | "ES2025" | "ES2024" | "ES2018"): boolean;
export const r: (template: {
raw: readonly string[] | ArrayLike<string>;
}, ...substitutions: any[]) => string;
export function throwIfNullish(value: any, msg: any): any;

142
node_modules/oniguruma-to-es/dist/index.min.js generated vendored Normal file

File diff suppressed because one or more lines are too long

7
node_modules/oniguruma-to-es/dist/index.min.js.map generated vendored Normal file

File diff suppressed because one or more lines are too long

61
node_modules/oniguruma-to-es/package.json generated vendored Normal file
View File

@@ -0,0 +1,61 @@
{
"name": "oniguruma-to-es",
"version": "4.3.4",
"description": "Convert Oniguruma patterns to native JavaScript RegExp",
"author": "Steven Levithan",
"license": "MIT",
"type": "module",
"sideEffects": false,
"exports": {
".": {
"import": {
"types": "./dist/esm/index.d.ts",
"default": "./dist/esm/index.js"
},
"require": {
"types": "./dist/cjs/index.d.ts",
"default": "./dist/cjs/index.js"
}
}
},
"browser": "./dist/index.min.js",
"main": "./dist/cjs/index.js",
"types": "./dist/cjs/index.d.ts",
"files": [
"dist"
],
"repository": {
"type": "git",
"url": "git+https://github.com/slevithan/oniguruma-to-es.git"
},
"keywords": [
"regex",
"regexp",
"oniguruma",
"textmate-grammar",
"transpiler"
],
"dependencies": {
"oniguruma-parser": "^0.12.1",
"regex": "^6.0.1",
"regex-recursion": "^6.0.2"
},
"devDependencies": {
"esbuild": "^0.27.0",
"jasmine": "^5.12.0",
"typescript": "^5.9.3",
"vscode-oniguruma": "^2.0.1"
},
"scripts": {
"bundle:global": "esbuild src/index.js --global-name=OnigurumaToEs --bundle --minify --sourcemap --outfile=dist/index.min.js",
"bundle:esm": "esbuild src/index.js --format=esm --bundle --sourcemap --external:oniguruma-parser --external:regex --external:regex-recursion --outfile=dist/esm/index.js",
"bundle:cjs": "esbuild src/index.js --format=cjs --bundle --sourcemap --outfile=dist/cjs/index.js",
"types": "tsc src/index.js --rootDir src --declaration --allowJs --emitDeclarationOnly --outDir types --lib ESNext",
"prebuild": "rm -rf dist/* types/*",
"build": "pnpm bundle:global && pnpm bundle:esm && pnpm bundle:cjs && pnpm types",
"postbuild": "node scripts/postbuild.js",
"pretest": "pnpm build",
"test": "jasmine",
"onig:match": "node scripts/onig-match.js"
}
}