Readonly
astThe parsed AST of the literal this parser works on.
While not explicitly typed that way, the parser will assume that the AST is readonly and makes optimizations based on that assumption. It is not safe to change the AST in any way.
Readonly
flagsThis contains the same flags as ast.flags
but with a better type.
Readonly
literalThe literal of the parser instance.
Readonly
maxThe maximum character of all character sets in the parsed AST.
This value will also be returned as part of the ParseResult.
Parsed the entire literal.
For more information on parsing, see parseElement.
Optional
options: Readonly<ParseOptions>Parses a specific element of the literal.
Use ParseOptions to control how the element is parsed.
Optional
options: Readonly<ParseOptions>Static
fromCreates a new parser from the given regexpp AST.
When the JS RegExp has already been parsed using regexpp, this method can be used to avoid parsing the regex again.
The given AST is not allowed to be changed during the lifetime of the returned parser.
Static
fromCreates a new parser from the given literal.
This function will throw a SyntaxError
if the given literal is not a valid RegExp literal according to the
given RegExp parser options.
If a string is given as the literal, it must be of the form /pattern/flags
. If possible, use the
object form with Literal instead.
Optional
parserOptions: Options
Converts JS RegExp to refa's RE AST format.