Update checked-in dependencies
This commit is contained in:
parent
4fad06f438
commit
40a500c743
4168 changed files with 298222 additions and 374905 deletions
21
node_modules/@eslint-community/regexpp/LICENSE
generated
vendored
Normal file
21
node_modules/@eslint-community/regexpp/LICENSE
generated
vendored
Normal file
|
|
@ -0,0 +1,21 @@
|
|||
MIT License
|
||||
|
||||
Copyright (c) 2018 Toru Nagashima
|
||||
|
||||
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.
|
||||
177
node_modules/@eslint-community/regexpp/README.md
generated
vendored
Normal file
177
node_modules/@eslint-community/regexpp/README.md
generated
vendored
Normal file
|
|
@ -0,0 +1,177 @@
|
|||
# @eslint-community/regexpp
|
||||
|
||||
[](https://www.npmjs.com/package/@eslint-community/regexpp)
|
||||
[](http://www.npmtrends.com/@eslint-community/regexpp)
|
||||
[](https://github.com/eslint-community/regexpp/actions)
|
||||
[](https://codecov.io/gh/eslint-community/regexpp)
|
||||
|
||||
A regular expression parser for ECMAScript.
|
||||
|
||||
## 💿 Installation
|
||||
|
||||
```bash
|
||||
$ npm install @eslint-community/regexpp
|
||||
```
|
||||
|
||||
- require Node@^12.0.0 || ^14.0.0 || >=16.0.0.
|
||||
|
||||
## 📖 Usage
|
||||
|
||||
```ts
|
||||
import {
|
||||
AST,
|
||||
RegExpParser,
|
||||
RegExpValidator,
|
||||
RegExpVisitor,
|
||||
parseRegExpLiteral,
|
||||
validateRegExpLiteral,
|
||||
visitRegExpAST
|
||||
} from "@eslint-community/regexpp"
|
||||
```
|
||||
|
||||
### parseRegExpLiteral(source, options?)
|
||||
|
||||
Parse a given regular expression literal then make AST object.
|
||||
|
||||
This is equivalent to `new RegExpParser(options).parseLiteral(source)`.
|
||||
|
||||
- **Parameters:**
|
||||
- `source` (`string | RegExp`) The source code to parse.
|
||||
- `options?` ([`RegExpParser.Options`]) The options to parse.
|
||||
- **Return:**
|
||||
- The AST of the regular expression.
|
||||
|
||||
### validateRegExpLiteral(source, options?)
|
||||
|
||||
Validate a given regular expression literal.
|
||||
|
||||
This is equivalent to `new RegExpValidator(options).validateLiteral(source)`.
|
||||
|
||||
- **Parameters:**
|
||||
- `source` (`string`) The source code to validate.
|
||||
- `options?` ([`RegExpValidator.Options`]) The options to validate.
|
||||
|
||||
### visitRegExpAST(ast, handlers)
|
||||
|
||||
Visit each node of a given AST.
|
||||
|
||||
This is equivalent to `new RegExpVisitor(handlers).visit(ast)`.
|
||||
|
||||
- **Parameters:**
|
||||
- `ast` ([`AST.Node`]) The AST to visit.
|
||||
- `handlers` ([`RegExpVisitor.Handlers`]) The callbacks.
|
||||
|
||||
### RegExpParser
|
||||
|
||||
#### new RegExpParser(options?)
|
||||
|
||||
- **Parameters:**
|
||||
- `options?` ([`RegExpParser.Options`]) The options to parse.
|
||||
|
||||
#### parser.parseLiteral(source, start?, end?)
|
||||
|
||||
Parse a regular expression literal.
|
||||
|
||||
- **Parameters:**
|
||||
- `source` (`string`) The source code to parse. E.g. `"/abc/g"`.
|
||||
- `start?` (`number`) The start index in the source code. Default is `0`.
|
||||
- `end?` (`number`) The end index in the source code. Default is `source.length`.
|
||||
- **Return:**
|
||||
- The AST of the regular expression.
|
||||
|
||||
#### parser.parsePattern(source, start?, end?, uFlag?)
|
||||
|
||||
Parse a regular expression pattern.
|
||||
|
||||
- **Parameters:**
|
||||
- `source` (`string`) The source code to parse. E.g. `"abc"`.
|
||||
- `start?` (`number`) The start index in the source code. Default is `0`.
|
||||
- `end?` (`number`) The end index in the source code. Default is `source.length`.
|
||||
- `uFlag?` (`boolean`) The flag to enable Unicode mode.
|
||||
- **Return:**
|
||||
- The AST of the regular expression pattern.
|
||||
|
||||
#### parser.parseFlags(source, start?, end?)
|
||||
|
||||
Parse a regular expression flags.
|
||||
|
||||
- **Parameters:**
|
||||
- `source` (`string`) The source code to parse. E.g. `"gim"`.
|
||||
- `start?` (`number`) The start index in the source code. Default is `0`.
|
||||
- `end?` (`number`) The end index in the source code. Default is `source.length`.
|
||||
- **Return:**
|
||||
- The AST of the regular expression flags.
|
||||
|
||||
### RegExpValidator
|
||||
|
||||
#### new RegExpValidator(options)
|
||||
|
||||
- **Parameters:**
|
||||
- `options` ([`RegExpValidator.Options`]) The options to validate.
|
||||
|
||||
#### validator.validateLiteral(source, start, end)
|
||||
|
||||
Validate a regular expression literal.
|
||||
|
||||
- **Parameters:**
|
||||
- `source` (`string`) The source code to validate.
|
||||
- `start?` (`number`) The start index in the source code. Default is `0`.
|
||||
- `end?` (`number`) The end index in the source code. Default is `source.length`.
|
||||
|
||||
#### validator.validatePattern(source, start, end, uFlag)
|
||||
|
||||
Validate a regular expression pattern.
|
||||
|
||||
- **Parameters:**
|
||||
- `source` (`string`) The source code to validate.
|
||||
- `start?` (`number`) The start index in the source code. Default is `0`.
|
||||
- `end?` (`number`) The end index in the source code. Default is `source.length`.
|
||||
- `uFlag?` (`boolean`) The flag to enable Unicode mode.
|
||||
|
||||
#### validator.validateFlags(source, start, end)
|
||||
|
||||
Validate a regular expression flags.
|
||||
|
||||
- **Parameters:**
|
||||
- `source` (`string`) The source code to validate.
|
||||
- `start?` (`number`) The start index in the source code. Default is `0`.
|
||||
- `end?` (`number`) The end index in the source code. Default is `source.length`.
|
||||
|
||||
### RegExpVisitor
|
||||
|
||||
#### new RegExpVisitor(handlers)
|
||||
|
||||
- **Parameters:**
|
||||
- `handlers` ([`RegExpVisitor.Handlers`]) The callbacks.
|
||||
|
||||
#### visitor.visit(ast)
|
||||
|
||||
Validate a regular expression literal.
|
||||
|
||||
- **Parameters:**
|
||||
- `ast` ([`AST.Node`]) The AST to visit.
|
||||
|
||||
## 📰 Changelog
|
||||
|
||||
- [GitHub Releases](https://github.com/eslint-community/regexpp/releases)
|
||||
|
||||
## 🍻 Contributing
|
||||
|
||||
Welcome contributing!
|
||||
|
||||
Please use GitHub's Issues/PRs.
|
||||
|
||||
### Development Tools
|
||||
|
||||
- `npm test` runs tests and measures coverage.
|
||||
- `npm run build` compiles TypeScript source code to `index.js`, `index.js.map`, and `index.d.ts`.
|
||||
- `npm run clean` removes the temporary files which are created by `npm test` and `npm run build`.
|
||||
- `npm run lint` runs ESLint.
|
||||
- `npm run update:test` updates test fixtures.
|
||||
- `npm run update:ids` updates `src/unicode/ids.ts`.
|
||||
- `npm run watch` runs tests with `--watch` option.
|
||||
|
||||
[`AST.Node`]: src/ast.ts#L4
|
||||
[`RegExpParser.Options`]: src/parser.ts#L539
|
||||
[`RegExpValidator.Options`]: src/validator.ts#L127
|
||||
[`RegExpVisitor.Handlers`]: src/visitor.ts#L204
|
||||
781
node_modules/@eslint-community/regexpp/index.d.ts
generated
vendored
Normal file
781
node_modules/@eslint-community/regexpp/index.d.ts
generated
vendored
Normal file
|
|
@ -0,0 +1,781 @@
|
|||
// Generated by dts-bundle v0.7.3
|
||||
|
||||
declare module "@eslint-community/regexpp" {
|
||||
import * as AST from "@eslint-community/regexpp/ast";
|
||||
import { RegExpParser } from "@eslint-community/regexpp/parser";
|
||||
import { RegExpValidator } from "@eslint-community/regexpp/validator";
|
||||
import { RegExpVisitor } from "@eslint-community/regexpp/visitor";
|
||||
export { AST, RegExpParser, RegExpValidator };
|
||||
/**
|
||||
* Parse a given regular expression literal then make AST object.
|
||||
* @param source The source code to parse.
|
||||
* @param options The options to parse.
|
||||
* @returns The AST of the regular expression.
|
||||
*/
|
||||
export function parseRegExpLiteral(
|
||||
source: RegExp | string,
|
||||
options?: RegExpParser.Options
|
||||
): AST.RegExpLiteral;
|
||||
/**
|
||||
* Validate a given regular expression literal.
|
||||
* @param source The source code to validate.
|
||||
* @param options The options to validate.
|
||||
*/
|
||||
export function validateRegExpLiteral(
|
||||
source: string,
|
||||
options?: RegExpValidator.Options
|
||||
): void;
|
||||
export function visitRegExpAST(
|
||||
node: AST.Node,
|
||||
handlers: RegExpVisitor.Handlers
|
||||
): void;
|
||||
}
|
||||
|
||||
declare module "@eslint-community/regexpp/ast" {
|
||||
/**
|
||||
* The type which includes all nodes.
|
||||
*/
|
||||
export type Node = BranchNode | LeafNode;
|
||||
/**
|
||||
* The type which includes all branch nodes.
|
||||
*/
|
||||
export type BranchNode =
|
||||
| Alternative
|
||||
| CapturingGroup
|
||||
| CharacterClass
|
||||
| CharacterClassRange
|
||||
| Group
|
||||
| LookaroundAssertion
|
||||
| Pattern
|
||||
| Quantifier
|
||||
| RegExpLiteral;
|
||||
/**
|
||||
* The type which includes all leaf nodes.
|
||||
*/
|
||||
export type LeafNode =
|
||||
| Backreference
|
||||
| BoundaryAssertion
|
||||
| Character
|
||||
| CharacterSet
|
||||
| Flags;
|
||||
/**
|
||||
* The type which includes all atom nodes.
|
||||
*/
|
||||
export type Element = Assertion | QuantifiableElement | Quantifier;
|
||||
/**
|
||||
* The type which includes all atom nodes that Quantifier node can have as children.
|
||||
*/
|
||||
export type QuantifiableElement =
|
||||
| Backreference
|
||||
| CapturingGroup
|
||||
| Character
|
||||
| CharacterClass
|
||||
| CharacterSet
|
||||
| Group
|
||||
| LookaheadAssertion;
|
||||
/**
|
||||
* The type which includes all character class atom nodes.
|
||||
*/
|
||||
export type CharacterClassElement =
|
||||
| Character
|
||||
| CharacterClassRange
|
||||
| EscapeCharacterSet
|
||||
| UnicodePropertyCharacterSet;
|
||||
/**
|
||||
* The type which defines common properties for all node types.
|
||||
*/
|
||||
export interface NodeBase {
|
||||
/** The node type. */
|
||||
type: Node["type"];
|
||||
/** The parent node. */
|
||||
parent: Node["parent"];
|
||||
/** The 0-based index that this node starts. */
|
||||
start: number;
|
||||
/** The 0-based index that this node ends. */
|
||||
end: number;
|
||||
/** The raw text of this node. */
|
||||
raw: string;
|
||||
}
|
||||
/**
|
||||
* The root node.
|
||||
*/
|
||||
export interface RegExpLiteral extends NodeBase {
|
||||
type: "RegExpLiteral";
|
||||
parent: null;
|
||||
pattern: Pattern;
|
||||
flags: Flags;
|
||||
}
|
||||
/**
|
||||
* The pattern.
|
||||
*/
|
||||
export interface Pattern extends NodeBase {
|
||||
type: "Pattern";
|
||||
parent: RegExpLiteral | null;
|
||||
alternatives: Alternative[];
|
||||
}
|
||||
/**
|
||||
* The alternative.
|
||||
* E.g. `a|b`
|
||||
*/
|
||||
export interface Alternative extends NodeBase {
|
||||
type: "Alternative";
|
||||
parent: CapturingGroup | Group | LookaroundAssertion | Pattern;
|
||||
elements: Element[];
|
||||
}
|
||||
/**
|
||||
* The uncapturing group.
|
||||
* E.g. `(?:ab)`
|
||||
*/
|
||||
export interface Group extends NodeBase {
|
||||
type: "Group";
|
||||
parent: Alternative | Quantifier;
|
||||
alternatives: Alternative[];
|
||||
}
|
||||
/**
|
||||
* The capturing group.
|
||||
* E.g. `(ab)`, `(?<name>ab)`
|
||||
*/
|
||||
export interface CapturingGroup extends NodeBase {
|
||||
type: "CapturingGroup";
|
||||
parent: Alternative | Quantifier;
|
||||
name: string | null;
|
||||
alternatives: Alternative[];
|
||||
references: Backreference[];
|
||||
}
|
||||
/**
|
||||
* The lookaround assertion.
|
||||
*/
|
||||
export type LookaroundAssertion = LookaheadAssertion | LookbehindAssertion;
|
||||
/**
|
||||
* The lookahead assertion.
|
||||
* E.g. `(?=ab)`, `(?!ab)`
|
||||
*/
|
||||
export interface LookaheadAssertion extends NodeBase {
|
||||
type: "Assertion";
|
||||
parent: Alternative | Quantifier;
|
||||
kind: "lookahead";
|
||||
negate: boolean;
|
||||
alternatives: Alternative[];
|
||||
}
|
||||
/**
|
||||
* The lookbehind assertion.
|
||||
* E.g. `(?<=ab)`, `(?<!ab)`
|
||||
*/
|
||||
export interface LookbehindAssertion extends NodeBase {
|
||||
type: "Assertion";
|
||||
parent: Alternative;
|
||||
kind: "lookbehind";
|
||||
negate: boolean;
|
||||
alternatives: Alternative[];
|
||||
}
|
||||
/**
|
||||
* The quantifier.
|
||||
* E.g. `a?`, `a*`, `a+`, `a{1,2}`, `a??`, `a*?`, `a+?`, `a{1,2}?`
|
||||
*/
|
||||
export interface Quantifier extends NodeBase {
|
||||
type: "Quantifier";
|
||||
parent: Alternative;
|
||||
min: number;
|
||||
max: number;
|
||||
greedy: boolean;
|
||||
element: QuantifiableElement;
|
||||
}
|
||||
/**
|
||||
* The character class.
|
||||
* E.g. `[ab]`, `[^ab]`
|
||||
*/
|
||||
export interface CharacterClass extends NodeBase {
|
||||
type: "CharacterClass";
|
||||
parent: Alternative | Quantifier;
|
||||
negate: boolean;
|
||||
elements: CharacterClassElement[];
|
||||
}
|
||||
/**
|
||||
* The character class.
|
||||
* E.g. `[a-b]`
|
||||
*/
|
||||
export interface CharacterClassRange extends NodeBase {
|
||||
type: "CharacterClassRange";
|
||||
parent: CharacterClass;
|
||||
min: Character;
|
||||
max: Character;
|
||||
}
|
||||
/**
|
||||
* The assertion.
|
||||
*/
|
||||
export type Assertion = BoundaryAssertion | LookaroundAssertion;
|
||||
/**
|
||||
* The boundary assertion.
|
||||
*/
|
||||
export type BoundaryAssertion = EdgeAssertion | WordBoundaryAssertion;
|
||||
/**
|
||||
* The edge boundary assertion.
|
||||
* E.g. `^`, `$`
|
||||
*/
|
||||
export interface EdgeAssertion extends NodeBase {
|
||||
type: "Assertion";
|
||||
parent: Alternative | Quantifier;
|
||||
kind: "end" | "start";
|
||||
}
|
||||
/**
|
||||
* The word bondary assertion.
|
||||
* E.g. `\b`, `\B`
|
||||
*/
|
||||
export interface WordBoundaryAssertion extends NodeBase {
|
||||
type: "Assertion";
|
||||
parent: Alternative | Quantifier;
|
||||
kind: "word";
|
||||
negate: boolean;
|
||||
}
|
||||
/**
|
||||
* The character set.
|
||||
*/
|
||||
export type CharacterSet =
|
||||
| AnyCharacterSet
|
||||
| EscapeCharacterSet
|
||||
| UnicodePropertyCharacterSet;
|
||||
/**
|
||||
* The dot.
|
||||
* E.g. `.`
|
||||
*/
|
||||
export interface AnyCharacterSet extends NodeBase {
|
||||
type: "CharacterSet";
|
||||
parent: Alternative | Quantifier;
|
||||
kind: "any";
|
||||
}
|
||||
/**
|
||||
* The character class escape.
|
||||
* E.g. `\d`, `\s`, `\w`, `\D`, `\S`, `\W`
|
||||
*/
|
||||
export interface EscapeCharacterSet extends NodeBase {
|
||||
type: "CharacterSet";
|
||||
parent: Alternative | CharacterClass | Quantifier;
|
||||
kind: "digit" | "space" | "word";
|
||||
negate: boolean;
|
||||
}
|
||||
/**
|
||||
* The unicode property escape.
|
||||
* E.g. `\p{ASCII}`, `\P{ASCII}`, `\p{Script=Hiragana}`
|
||||
*/
|
||||
export interface UnicodePropertyCharacterSet extends NodeBase {
|
||||
type: "CharacterSet";
|
||||
parent: Alternative | CharacterClass | Quantifier;
|
||||
kind: "property";
|
||||
key: string;
|
||||
value: string | null;
|
||||
negate: boolean;
|
||||
}
|
||||
/**
|
||||
* The character.
|
||||
* This includes escape sequences which mean a character.
|
||||
* E.g. `a`, `あ`, `✿`, `\x65`, `\u0065`, `\u{65}`, `\/`
|
||||
*/
|
||||
export interface Character extends NodeBase {
|
||||
type: "Character";
|
||||
parent: Alternative | CharacterClass | CharacterClassRange | Quantifier;
|
||||
value: number;
|
||||
}
|
||||
/**
|
||||
* The backreference.
|
||||
* E.g. `\1`, `\k<name>`
|
||||
*/
|
||||
export interface Backreference extends NodeBase {
|
||||
type: "Backreference";
|
||||
parent: Alternative | Quantifier;
|
||||
ref: number | string;
|
||||
resolved: CapturingGroup;
|
||||
}
|
||||
/**
|
||||
* The flags.
|
||||
*/
|
||||
export interface Flags extends NodeBase {
|
||||
type: "Flags";
|
||||
parent: RegExpLiteral | null;
|
||||
dotAll: boolean;
|
||||
global: boolean;
|
||||
hasIndices: boolean;
|
||||
ignoreCase: boolean;
|
||||
multiline: boolean;
|
||||
sticky: boolean;
|
||||
unicode: boolean;
|
||||
}
|
||||
}
|
||||
|
||||
declare module "@eslint-community/regexpp/parser" {
|
||||
import type {
|
||||
Flags,
|
||||
RegExpLiteral,
|
||||
Pattern,
|
||||
} from "@eslint-community/regexpp/ast";
|
||||
import type { EcmaVersion } from "@eslint-community/regexpp/ecma-versions";
|
||||
export namespace RegExpParser {
|
||||
/**
|
||||
* The options for RegExpParser construction.
|
||||
*/
|
||||
interface Options {
|
||||
/**
|
||||
* The flag to disable Annex B syntax. Default is `false`.
|
||||
*/
|
||||
strict?: boolean;
|
||||
/**
|
||||
* ECMAScript version. Default is `2023`.
|
||||
* - `2015` added `u` and `y` flags.
|
||||
* - `2018` added `s` flag, Named Capturing Group, Lookbehind Assertion,
|
||||
* and Unicode Property Escape.
|
||||
* - `2019`, `2020`, and `2021` added more valid Unicode Property Escapes.
|
||||
* - `2022` added `d` flag.
|
||||
* - `2023` added more valid Unicode Property Escapes.
|
||||
*/
|
||||
ecmaVersion?: EcmaVersion;
|
||||
}
|
||||
}
|
||||
export class RegExpParser {
|
||||
/**
|
||||
* Initialize this parser.
|
||||
* @param options The options of parser.
|
||||
*/
|
||||
constructor(options?: RegExpParser.Options);
|
||||
/**
|
||||
* Parse a regular expression literal. E.g. "/abc/g"
|
||||
* @param source The source code to parse.
|
||||
* @param start The start index in the source code.
|
||||
* @param end The end index in the source code.
|
||||
* @returns The AST of the given regular expression.
|
||||
*/
|
||||
parseLiteral(source: string, start?: number, end?: number): RegExpLiteral;
|
||||
/**
|
||||
* Parse a regular expression flags. E.g. "gim"
|
||||
* @param source The source code to parse.
|
||||
* @param start The start index in the source code.
|
||||
* @param end The end index in the source code.
|
||||
* @returns The AST of the given flags.
|
||||
*/
|
||||
parseFlags(source: string, start?: number, end?: number): Flags;
|
||||
/**
|
||||
* Parse a regular expression pattern. E.g. "abc"
|
||||
* @param source The source code to parse.
|
||||
* @param start The start index in the source code.
|
||||
* @param end The end index in the source code.
|
||||
* @param uFlag The flag to set unicode mode.
|
||||
* @returns The AST of the given pattern.
|
||||
*/
|
||||
parsePattern(
|
||||
source: string,
|
||||
start?: number,
|
||||
end?: number,
|
||||
uFlag?: boolean
|
||||
): Pattern;
|
||||
}
|
||||
}
|
||||
|
||||
declare module "@eslint-community/regexpp/validator" {
|
||||
import type { EcmaVersion } from "@eslint-community/regexpp/ecma-versions";
|
||||
export namespace RegExpValidator {
|
||||
/**
|
||||
* The options for RegExpValidator construction.
|
||||
*/
|
||||
interface Options {
|
||||
/**
|
||||
* The flag to disable Annex B syntax. Default is `false`.
|
||||
*/
|
||||
strict?: boolean;
|
||||
/**
|
||||
* ECMAScript version. Default is `2023`.
|
||||
* - `2015` added `u` and `y` flags.
|
||||
* - `2018` added `s` flag, Named Capturing Group, Lookbehind Assertion,
|
||||
* and Unicode Property Escape.
|
||||
* - `2019`, `2020`, and `2021` added more valid Unicode Property Escapes.
|
||||
* - `2022` added `d` flag.
|
||||
* - `2023` added more valid Unicode Property Escapes.
|
||||
*/
|
||||
ecmaVersion?: EcmaVersion;
|
||||
/**
|
||||
* A function that is called when the validator entered a RegExp literal.
|
||||
* @param start The 0-based index of the first character.
|
||||
*/
|
||||
onLiteralEnter?: (start: number) => void;
|
||||
/**
|
||||
* A function that is called when the validator left a RegExp literal.
|
||||
* @param start The 0-based index of the first character.
|
||||
* @param end The next 0-based index of the last character.
|
||||
*/
|
||||
onLiteralLeave?: (start: number, end: number) => void;
|
||||
/**
|
||||
* A function that is called when the validator found flags.
|
||||
* @param start The 0-based index of the first character.
|
||||
* @param end The next 0-based index of the last character.
|
||||
* @param flags.global `g` flag.
|
||||
* @param flags.ignoreCase `i` flag.
|
||||
* @param flags.multiline `m` flag.
|
||||
* @param flags.unicode `u` flag.
|
||||
* @param flags.sticky `y` flag.
|
||||
* @param flags.dotAll `s` flag.
|
||||
* @param flags.hasIndices `d` flag.
|
||||
*/
|
||||
onRegExpFlags?: (
|
||||
start: number,
|
||||
end: number,
|
||||
flags: {
|
||||
global: boolean;
|
||||
ignoreCase: boolean;
|
||||
multiline: boolean;
|
||||
unicode: boolean;
|
||||
sticky: boolean;
|
||||
dotAll: boolean;
|
||||
hasIndices: boolean;
|
||||
}
|
||||
) => void;
|
||||
/**
|
||||
* A function that is called when the validator found flags.
|
||||
* @param start The 0-based index of the first character.
|
||||
* @param end The next 0-based index of the last character.
|
||||
* @param global `g` flag.
|
||||
* @param ignoreCase `i` flag.
|
||||
* @param multiline `m` flag.
|
||||
* @param unicode `u` flag.
|
||||
* @param sticky `y` flag.
|
||||
* @param dotAll `s` flag.
|
||||
* @param hasIndices `d` flag.
|
||||
*
|
||||
* @deprecated Use `onRegExpFlags` instead.
|
||||
*/
|
||||
onFlags?: (
|
||||
start: number,
|
||||
end: number,
|
||||
global: boolean,
|
||||
ignoreCase: boolean,
|
||||
multiline: boolean,
|
||||
unicode: boolean,
|
||||
sticky: boolean,
|
||||
dotAll: boolean,
|
||||
hasIndices: boolean
|
||||
) => void;
|
||||
/**
|
||||
* A function that is called when the validator entered a pattern.
|
||||
* @param start The 0-based index of the first character.
|
||||
*/
|
||||
onPatternEnter?: (start: number) => void;
|
||||
/**
|
||||
* A function that is called when the validator left a pattern.
|
||||
* @param start The 0-based index of the first character.
|
||||
* @param end The next 0-based index of the last character.
|
||||
*/
|
||||
onPatternLeave?: (start: number, end: number) => void;
|
||||
/**
|
||||
* A function that is called when the validator entered a disjunction.
|
||||
* @param start The 0-based index of the first character.
|
||||
*/
|
||||
onDisjunctionEnter?: (start: number) => void;
|
||||
/**
|
||||
* A function that is called when the validator left a disjunction.
|
||||
* @param start The 0-based index of the first character.
|
||||
* @param end The next 0-based index of the last character.
|
||||
*/
|
||||
onDisjunctionLeave?: (start: number, end: number) => void;
|
||||
/**
|
||||
* A function that is called when the validator entered an alternative.
|
||||
* @param start The 0-based index of the first character.
|
||||
* @param index The 0-based index of alternatives in a disjunction.
|
||||
*/
|
||||
onAlternativeEnter?: (start: number, index: number) => void;
|
||||
/**
|
||||
* A function that is called when the validator left an alternative.
|
||||
* @param start The 0-based index of the first character.
|
||||
* @param end The next 0-based index of the last character.
|
||||
* @param index The 0-based index of alternatives in a disjunction.
|
||||
*/
|
||||
onAlternativeLeave?: (start: number, end: number, index: number) => void;
|
||||
/**
|
||||
* A function that is called when the validator entered an uncapturing group.
|
||||
* @param start The 0-based index of the first character.
|
||||
*/
|
||||
onGroupEnter?: (start: number) => void;
|
||||
/**
|
||||
* A function that is called when the validator left an uncapturing group.
|
||||
* @param start The 0-based index of the first character.
|
||||
* @param end The next 0-based index of the last character.
|
||||
*/
|
||||
onGroupLeave?: (start: number, end: number) => void;
|
||||
/**
|
||||
* A function that is called when the validator entered a capturing group.
|
||||
* @param start The 0-based index of the first character.
|
||||
* @param name The group name.
|
||||
*/
|
||||
onCapturingGroupEnter?: (start: number, name: string | null) => void;
|
||||
/**
|
||||
* A function that is called when the validator left a capturing group.
|
||||
* @param start The 0-based index of the first character.
|
||||
* @param end The next 0-based index of the last character.
|
||||
* @param name The group name.
|
||||
*/
|
||||
onCapturingGroupLeave?: (
|
||||
start: number,
|
||||
end: number,
|
||||
name: string | null
|
||||
) => void;
|
||||
/**
|
||||
* A function that is called when the validator found a quantifier.
|
||||
* @param start The 0-based index of the first character.
|
||||
* @param end The next 0-based index of the last character.
|
||||
* @param min The minimum number of repeating.
|
||||
* @param max The maximum number of repeating.
|
||||
* @param greedy The flag to choose the longest matching.
|
||||
*/
|
||||
onQuantifier?: (
|
||||
start: number,
|
||||
end: number,
|
||||
min: number,
|
||||
max: number,
|
||||
greedy: boolean
|
||||
) => void;
|
||||
/**
|
||||
* A function that is called when the validator entered a lookahead/lookbehind assertion.
|
||||
* @param start The 0-based index of the first character.
|
||||
* @param kind The kind of the assertion.
|
||||
* @param negate The flag which represents that the assertion is negative.
|
||||
*/
|
||||
onLookaroundAssertionEnter?: (
|
||||
start: number,
|
||||
kind: "lookahead" | "lookbehind",
|
||||
negate: boolean
|
||||
) => void;
|
||||
/**
|
||||
* A function that is called when the validator left a lookahead/lookbehind assertion.
|
||||
* @param start The 0-based index of the first character.
|
||||
* @param end The next 0-based index of the last character.
|
||||
* @param kind The kind of the assertion.
|
||||
* @param negate The flag which represents that the assertion is negative.
|
||||
*/
|
||||
onLookaroundAssertionLeave?: (
|
||||
start: number,
|
||||
end: number,
|
||||
kind: "lookahead" | "lookbehind",
|
||||
negate: boolean
|
||||
) => void;
|
||||
/**
|
||||
* A function that is called when the validator found an edge boundary assertion.
|
||||
* @param start The 0-based index of the first character.
|
||||
* @param end The next 0-based index of the last character.
|
||||
* @param kind The kind of the assertion.
|
||||
*/
|
||||
onEdgeAssertion?: (
|
||||
start: number,
|
||||
end: number,
|
||||
kind: "end" | "start"
|
||||
) => void;
|
||||
/**
|
||||
* A function that is called when the validator found a word boundary assertion.
|
||||
* @param start The 0-based index of the first character.
|
||||
* @param end The next 0-based index of the last character.
|
||||
* @param kind The kind of the assertion.
|
||||
* @param negate The flag which represents that the assertion is negative.
|
||||
*/
|
||||
onWordBoundaryAssertion?: (
|
||||
start: number,
|
||||
end: number,
|
||||
kind: "word",
|
||||
negate: boolean
|
||||
) => void;
|
||||
/**
|
||||
* A function that is called when the validator found a dot.
|
||||
* @param start The 0-based index of the first character.
|
||||
* @param end The next 0-based index of the last character.
|
||||
* @param kind The kind of the character set.
|
||||
*/
|
||||
onAnyCharacterSet?: (start: number, end: number, kind: "any") => void;
|
||||
/**
|
||||
* A function that is called when the validator found a character set escape.
|
||||
* @param start The 0-based index of the first character.
|
||||
* @param end The next 0-based index of the last character.
|
||||
* @param kind The kind of the character set.
|
||||
* @param negate The flag which represents that the character set is negative.
|
||||
*/
|
||||
onEscapeCharacterSet?: (
|
||||
start: number,
|
||||
end: number,
|
||||
kind: "digit" | "space" | "word",
|
||||
negate: boolean
|
||||
) => void;
|
||||
/**
|
||||
* A function that is called when the validator found a Unicode proerty escape.
|
||||
* @param start The 0-based index of the first character.
|
||||
* @param end The next 0-based index of the last character.
|
||||
* @param kind The kind of the character set.
|
||||
* @param key The property name.
|
||||
* @param value The property value.
|
||||
* @param negate The flag which represents that the character set is negative.
|
||||
*/
|
||||
onUnicodePropertyCharacterSet?: (
|
||||
start: number,
|
||||
end: number,
|
||||
kind: "property",
|
||||
key: string,
|
||||
value: string | null,
|
||||
negate: boolean
|
||||
) => void;
|
||||
/**
|
||||
* A function that is called when the validator found a character.
|
||||
* @param start The 0-based index of the first character.
|
||||
* @param end The next 0-based index of the last character.
|
||||
* @param value The code point of the character.
|
||||
*/
|
||||
onCharacter?: (start: number, end: number, value: number) => void;
|
||||
/**
|
||||
* A function that is called when the validator found a backreference.
|
||||
* @param start The 0-based index of the first character.
|
||||
* @param end The next 0-based index of the last character.
|
||||
* @param ref The key of the referred capturing group.
|
||||
*/
|
||||
onBackreference?: (
|
||||
start: number,
|
||||
end: number,
|
||||
ref: number | string
|
||||
) => void;
|
||||
/**
|
||||
* A function that is called when the validator entered a character class.
|
||||
* @param start The 0-based index of the first character.
|
||||
* @param negate The flag which represents that the character class is negative.
|
||||
*/
|
||||
onCharacterClassEnter?: (start: number, negate: boolean) => void;
|
||||
/**
|
||||
* A function that is called when the validator left a character class.
|
||||
* @param start The 0-based index of the first character.
|
||||
* @param end The next 0-based index of the last character.
|
||||
* @param negate The flag which represents that the character class is negative.
|
||||
*/
|
||||
onCharacterClassLeave?: (
|
||||
start: number,
|
||||
end: number,
|
||||
negate: boolean
|
||||
) => void;
|
||||
/**
|
||||
* A function that is called when the validator found a character class range.
|
||||
* @param start The 0-based index of the first character.
|
||||
* @param end The next 0-based index of the last character.
|
||||
* @param min The minimum code point of the range.
|
||||
* @param max The maximum code point of the range.
|
||||
*/
|
||||
onCharacterClassRange?: (
|
||||
start: number,
|
||||
end: number,
|
||||
min: number,
|
||||
max: number
|
||||
) => void;
|
||||
}
|
||||
}
|
||||
/**
|
||||
* The regular expression validator.
|
||||
*/
|
||||
export class RegExpValidator {
|
||||
/**
|
||||
* Initialize this validator.
|
||||
* @param options The options of validator.
|
||||
*/
|
||||
constructor(options?: RegExpValidator.Options);
|
||||
/**
|
||||
* Validate a regular expression literal. E.g. "/abc/g"
|
||||
* @param source The source code to validate.
|
||||
* @param start The start index in the source code.
|
||||
* @param end The end index in the source code.
|
||||
*/
|
||||
validateLiteral(source: string, start?: number, end?: number): void;
|
||||
/**
|
||||
* Validate a regular expression flags. E.g. "gim"
|
||||
* @param source The source code to validate.
|
||||
* @param start The start index in the source code.
|
||||
* @param end The end index in the source code.
|
||||
*/
|
||||
validateFlags(source: string, start?: number, end?: number): void;
|
||||
/**
|
||||
* Validate a regular expression pattern. E.g. "abc"
|
||||
* @param source The source code to validate.
|
||||
* @param start The start index in the source code.
|
||||
* @param end The end index in the source code.
|
||||
* @param uFlag The flag to set unicode mode.
|
||||
*/
|
||||
validatePattern(
|
||||
source: string,
|
||||
start?: number,
|
||||
end?: number,
|
||||
uFlag?: boolean
|
||||
): void;
|
||||
}
|
||||
}
|
||||
|
||||
declare module "@eslint-community/regexpp/visitor" {
|
||||
import type {
|
||||
Alternative,
|
||||
Assertion,
|
||||
Backreference,
|
||||
CapturingGroup,
|
||||
Character,
|
||||
CharacterClass,
|
||||
CharacterClassRange,
|
||||
CharacterSet,
|
||||
Flags,
|
||||
Group,
|
||||
Node,
|
||||
Pattern,
|
||||
Quantifier,
|
||||
RegExpLiteral,
|
||||
} from "@eslint-community/regexpp/ast";
|
||||
/**
|
||||
* The visitor to walk on AST.
|
||||
*/
|
||||
export class RegExpVisitor {
|
||||
/**
|
||||
* Initialize this visitor.
|
||||
* @param handlers Callbacks for each node.
|
||||
*/
|
||||
constructor(handlers: RegExpVisitor.Handlers);
|
||||
/**
|
||||
* Visit a given node and descendant nodes.
|
||||
* @param node The root node to visit tree.
|
||||
*/
|
||||
visit(node: Node): void;
|
||||
}
|
||||
export namespace RegExpVisitor {
|
||||
interface Handlers {
|
||||
onAlternativeEnter?: (node: Alternative) => void;
|
||||
onAlternativeLeave?: (node: Alternative) => void;
|
||||
onAssertionEnter?: (node: Assertion) => void;
|
||||
onAssertionLeave?: (node: Assertion) => void;
|
||||
onBackreferenceEnter?: (node: Backreference) => void;
|
||||
onBackreferenceLeave?: (node: Backreference) => void;
|
||||
onCapturingGroupEnter?: (node: CapturingGroup) => void;
|
||||
onCapturingGroupLeave?: (node: CapturingGroup) => void;
|
||||
onCharacterEnter?: (node: Character) => void;
|
||||
onCharacterLeave?: (node: Character) => void;
|
||||
onCharacterClassEnter?: (node: CharacterClass) => void;
|
||||
onCharacterClassLeave?: (node: CharacterClass) => void;
|
||||
onCharacterClassRangeEnter?: (node: CharacterClassRange) => void;
|
||||
onCharacterClassRangeLeave?: (node: CharacterClassRange) => void;
|
||||
onCharacterSetEnter?: (node: CharacterSet) => void;
|
||||
onCharacterSetLeave?: (node: CharacterSet) => void;
|
||||
onFlagsEnter?: (node: Flags) => void;
|
||||
onFlagsLeave?: (node: Flags) => void;
|
||||
onGroupEnter?: (node: Group) => void;
|
||||
onGroupLeave?: (node: Group) => void;
|
||||
onPatternEnter?: (node: Pattern) => void;
|
||||
onPatternLeave?: (node: Pattern) => void;
|
||||
onQuantifierEnter?: (node: Quantifier) => void;
|
||||
onQuantifierLeave?: (node: Quantifier) => void;
|
||||
onRegExpLiteralEnter?: (node: RegExpLiteral) => void;
|
||||
onRegExpLiteralLeave?: (node: RegExpLiteral) => void;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
declare module "@eslint-community/regexpp/ecma-versions" {
|
||||
export type EcmaVersion =
|
||||
| 5
|
||||
| 2015
|
||||
| 2016
|
||||
| 2017
|
||||
| 2018
|
||||
| 2019
|
||||
| 2020
|
||||
| 2021
|
||||
| 2022
|
||||
| 2023;
|
||||
}
|
||||
2136
node_modules/@eslint-community/regexpp/index.js
generated
vendored
Normal file
2136
node_modules/@eslint-community/regexpp/index.js
generated
vendored
Normal file
File diff suppressed because it is too large
Load diff
1
node_modules/@eslint-community/regexpp/index.js.map
generated
vendored
Normal file
1
node_modules/@eslint-community/regexpp/index.js.map
generated
vendored
Normal file
File diff suppressed because one or more lines are too long
2127
node_modules/@eslint-community/regexpp/index.mjs
generated
vendored
Normal file
2127
node_modules/@eslint-community/regexpp/index.mjs
generated
vendored
Normal file
File diff suppressed because it is too large
Load diff
1
node_modules/@eslint-community/regexpp/index.mjs.map
generated
vendored
Normal file
1
node_modules/@eslint-community/regexpp/index.mjs.map
generated
vendored
Normal file
File diff suppressed because one or more lines are too long
88
node_modules/@eslint-community/regexpp/package.json
generated
vendored
Normal file
88
node_modules/@eslint-community/regexpp/package.json
generated
vendored
Normal file
|
|
@ -0,0 +1,88 @@
|
|||
{
|
||||
"name": "@eslint-community/regexpp",
|
||||
"version": "4.5.1",
|
||||
"description": "Regular expression parser for ECMAScript.",
|
||||
"keywords": [
|
||||
"regexp",
|
||||
"regular",
|
||||
"expression",
|
||||
"parser",
|
||||
"validator",
|
||||
"ast",
|
||||
"abstract",
|
||||
"syntax",
|
||||
"tree",
|
||||
"ecmascript",
|
||||
"es2015",
|
||||
"es2016",
|
||||
"es2017",
|
||||
"es2018",
|
||||
"es2019",
|
||||
"es2020",
|
||||
"es2021",
|
||||
"annexB"
|
||||
],
|
||||
"homepage": "https://github.com/eslint-community/regexpp#readme",
|
||||
"bugs": {
|
||||
"url": "https://github.com/eslint-community/regexpp/issues"
|
||||
},
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/eslint-community/regexpp"
|
||||
},
|
||||
"license": "MIT",
|
||||
"author": "Toru Nagashima",
|
||||
"exports": {
|
||||
".": {
|
||||
"types": "./index.d.ts",
|
||||
"import": "./index.mjs",
|
||||
"default": "./index.js"
|
||||
},
|
||||
"./package.json": "./package.json"
|
||||
},
|
||||
"main": "index",
|
||||
"files": [
|
||||
"index.*"
|
||||
],
|
||||
"scripts": {
|
||||
"prebuild": "npm run -s clean",
|
||||
"build": "run-s build:*",
|
||||
"build:tsc": "tsc --module es2015",
|
||||
"build:rollup": "rollup -c",
|
||||
"build:dts": "npm run -s build:tsc -- --removeComments false && dts-bundle --name @eslint-community/regexpp --main .temp/index.d.ts --out ../index.d.ts && prettier --write index.d.ts",
|
||||
"clean": "rimraf .temp index.*",
|
||||
"lint": "eslint . --ext .ts",
|
||||
"test": "nyc _mocha \"test/*.ts\" --reporter dot --timeout 10000",
|
||||
"update:test": "ts-node scripts/update-fixtures.ts",
|
||||
"update:unicode": "run-s update:unicode:*",
|
||||
"update:unicode:ids": "ts-node scripts/update-unicode-ids.ts",
|
||||
"update:unicode:props": "ts-node scripts/update-unicode-properties.ts",
|
||||
"preversion": "npm test && npm run -s build",
|
||||
"postversion": "git push && git push --tags",
|
||||
"prewatch": "npm run -s clean",
|
||||
"watch": "_mocha \"test/*.ts\" --require ts-node/register --reporter dot --timeout 10000 --watch-extensions ts --watch --growl"
|
||||
},
|
||||
"dependencies": {},
|
||||
"devDependencies": {
|
||||
"@eslint-community/eslint-plugin-mysticatea": "^15.3.0",
|
||||
"@rollup/plugin-node-resolve": "^14.1.0",
|
||||
"@types/eslint": "^8.4.10",
|
||||
"@types/jsdom": "^16.2.15",
|
||||
"@types/mocha": "^9.1.1",
|
||||
"@types/node": "^12.20.55",
|
||||
"dts-bundle": "^0.7.3",
|
||||
"eslint": "^8.31.0",
|
||||
"jsdom": "^19.0.0",
|
||||
"mocha": "^9.2.2",
|
||||
"npm-run-all": "^4.1.5",
|
||||
"nyc": "^14.1.1",
|
||||
"rimraf": "^3.0.2",
|
||||
"rollup": "^2.79.1",
|
||||
"rollup-plugin-sourcemaps": "^0.6.3",
|
||||
"ts-node": "^10.9.1",
|
||||
"typescript": "~5.0.2"
|
||||
},
|
||||
"engines": {
|
||||
"node": "^12.0.0 || ^14.0.0 || >=16.0.0"
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue