meriyah 7.1.1 → 7.2.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.
- package/CHANGELOG.md +25 -0
- package/README.md +2 -3
- package/dist/meriyah.cjs +397 -156
- package/dist/meriyah.min.mjs +1 -1
- package/dist/meriyah.mjs +397 -156
- package/dist/meriyah.umd.js +397 -156
- package/dist/meriyah.umd.min.js +1 -1
- package/dist/types/common.d.ts +2 -2
- package/dist/types/errors.d.ts +2 -2
- package/dist/types/estree.d.ts +1 -1
- package/dist/types/lexer/comments.d.ts +3 -3
- package/dist/types/lexer/common.d.ts +2 -2
- package/dist/types/lexer/identifier.d.ts +3 -3
- package/dist/types/lexer/index.d.ts +3 -3
- package/dist/types/lexer/jsx.d.ts +3 -3
- package/dist/types/lexer/numeric.d.ts +4 -4
- package/dist/types/lexer/regexp.d.ts +2 -2
- package/dist/types/lexer/scan.d.ts +4 -4
- package/dist/types/lexer/string.d.ts +3 -3
- package/dist/types/lexer/template.d.ts +3 -3
- package/dist/types/meriyah.d.ts +6 -6
- package/dist/types/options.d.ts +3 -3
- package/dist/types/parser/parser.d.ts +7 -7
- package/dist/types/parser/private-scope.d.ts +2 -2
- package/dist/types/parser/scope.d.ts +3 -3
- package/dist/types/parser.d.ts +3 -3
- package/dist/types/token.d.ts +22 -21
- package/package.json +2 -1
package/dist/types/common.d.ts
CHANGED
package/dist/types/errors.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { type Location } from './common';
|
|
2
|
-
import { type _Node, type SourceLocation } from './estree';
|
|
1
|
+
import { type Location } from './common.ts';
|
|
2
|
+
import { type _Node, type SourceLocation } from './estree.ts';
|
|
3
3
|
export declare const enum Errors {
|
|
4
4
|
Unexpected = 0,
|
|
5
5
|
StrictOctalEscape = 1,
|
package/dist/types/estree.d.ts
CHANGED
|
@@ -506,7 +506,7 @@ export interface UnaryExpression extends _Node {
|
|
|
506
506
|
export interface VariableDeclaration extends _Node {
|
|
507
507
|
type: 'VariableDeclaration';
|
|
508
508
|
declarations: VariableDeclarator[];
|
|
509
|
-
kind: 'let' | 'const' | 'var';
|
|
509
|
+
kind: 'let' | 'const' | 'var' | 'using' | 'await using';
|
|
510
510
|
}
|
|
511
511
|
export interface VariableDeclarator extends _Node {
|
|
512
512
|
type: 'VariableDeclarator';
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { Context, type Location } from '../common';
|
|
2
|
-
import { type Parser } from '../parser/parser';
|
|
3
|
-
import { LexerState } from './common';
|
|
1
|
+
import { Context, type Location } from '../common.ts';
|
|
2
|
+
import { type Parser } from '../parser/parser.ts';
|
|
3
|
+
import { LexerState } from './common.ts';
|
|
4
4
|
export declare const enum CommentType {
|
|
5
5
|
Single = 0,
|
|
6
6
|
Multi = 1,
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { Context } from '../common';
|
|
2
|
-
import { type Parser } from '../parser/parser';
|
|
3
|
-
import { Token } from './../token';
|
|
1
|
+
import { Context } from '../common.ts';
|
|
2
|
+
import { type Parser } from '../parser/parser.ts';
|
|
3
|
+
import { Token } from './../token.ts';
|
|
4
4
|
export declare function scanIdentifier(parser: Parser, context: Context, isValidAsKeyword: 0 | 1): Token;
|
|
5
5
|
export declare function scanUnicodeIdentifier(parser: Parser, context: Context): Token;
|
|
6
6
|
export declare function scanIdentifierSlowCase(parser: Parser, context: Context, hasEscape: 0 | 1, isValidAsKeyword: number): Token;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
export { scanSingleToken, nextToken } from './scan';
|
|
2
|
-
export { skipHashBang } from './comments';
|
|
3
|
-
export { advanceChar, consumeLineFeed, scanNewLine, LexerState, convertTokenType } from './common';
|
|
1
|
+
export { scanSingleToken, nextToken } from './scan.ts';
|
|
2
|
+
export { skipHashBang } from './comments.ts';
|
|
3
|
+
export { advanceChar, consumeLineFeed, scanNewLine, LexerState, convertTokenType } from './common.ts';
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { type Context } from '../common';
|
|
2
|
-
import { type Parser } from '../parser/parser';
|
|
3
|
-
import { Token } from '../token';
|
|
1
|
+
import { type Context } from '../common.ts';
|
|
2
|
+
import { type Parser } from '../parser/parser.ts';
|
|
3
|
+
import { Token } from '../token.ts';
|
|
4
4
|
export declare function scanJSXAttributeValue(parser: Parser, context: Context): Token;
|
|
5
5
|
export declare function nextJSXToken(parser: Parser): void;
|
|
6
6
|
export declare function rescanJSXIdentifier(parser: Parser): Token;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { Context } from '../common';
|
|
2
|
-
import { type Parser } from '../parser/parser';
|
|
3
|
-
import { Token } from '../token';
|
|
4
|
-
import { NumberKind } from './common';
|
|
1
|
+
import { Context } from '../common.ts';
|
|
2
|
+
import { type Parser } from '../parser/parser.ts';
|
|
3
|
+
import { Token } from '../token.ts';
|
|
4
|
+
import { NumberKind } from './common.ts';
|
|
5
5
|
export declare function scanNumber(parser: Parser, context: Context, kind: NumberKind): Token;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { type Parser } from '../parser/parser';
|
|
2
|
-
import { Token } from '../token';
|
|
1
|
+
import { type Parser } from '../parser/parser.ts';
|
|
2
|
+
import { Token } from '../token.ts';
|
|
3
3
|
export declare function scanRegularExpression(parser: Parser): Token;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { Context } from '../common';
|
|
2
|
-
import { type Parser } from '../parser/parser';
|
|
3
|
-
import { Token } from '../token';
|
|
4
|
-
import { LexerState } from './common';
|
|
1
|
+
import { Context } from '../common.ts';
|
|
2
|
+
import { type Parser } from '../parser/parser.ts';
|
|
3
|
+
import { Token } from '../token.ts';
|
|
4
|
+
import { LexerState } from './common.ts';
|
|
5
5
|
export declare function nextToken(parser: Parser, context: Context): void;
|
|
6
6
|
export declare function scanSingleToken(parser: Parser, context: Context, state: LexerState): Token;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { Context } from '../common';
|
|
2
|
-
import { type Parser } from '../parser/parser';
|
|
3
|
-
import { Token } from '../token';
|
|
1
|
+
import { Context } from '../common.ts';
|
|
2
|
+
import { type Parser } from '../parser/parser.ts';
|
|
3
|
+
import { Token } from '../token.ts';
|
|
4
4
|
export declare const enum Escape {
|
|
5
5
|
Empty = -1,
|
|
6
6
|
StrictOctal = -2,
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { Context } from '../common';
|
|
2
|
-
import { type Parser } from '../parser/parser';
|
|
3
|
-
import { Token } from '../token';
|
|
1
|
+
import { Context } from '../common.ts';
|
|
2
|
+
import { type Parser } from '../parser/parser.ts';
|
|
3
|
+
import { Token } from '../token.ts';
|
|
4
4
|
export declare function scanTemplate(parser: Parser, context: Context): Token;
|
|
5
5
|
export declare function scanTemplateTail(parser: Parser, context: Context): Token;
|
package/dist/types/meriyah.d.ts
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { type Program } from './estree';
|
|
2
|
-
import { type Options } from './options';
|
|
3
|
-
declare const version: string;
|
|
1
|
+
import { type Program } from './estree.ts';
|
|
2
|
+
import { type Options } from './options.ts';
|
|
3
|
+
export declare const version: string;
|
|
4
4
|
export declare function parseScript(source: string, options?: Omit<Options, 'sourceType'>): Program;
|
|
5
5
|
export declare function parseModule(source: string, options?: Omit<Options, 'sourceType'>): Program;
|
|
6
6
|
export declare function parse(source: string, options?: Options): Program;
|
|
7
|
-
export { type Options
|
|
8
|
-
export type * as ESTree from './estree';
|
|
9
|
-
export { isParseError, type ParseError } from './errors';
|
|
7
|
+
export { type Options } from './options.ts';
|
|
8
|
+
export type * as ESTree from './estree.ts';
|
|
9
|
+
export { isParseError, type ParseError } from './errors.ts';
|
package/dist/types/options.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import type * as ESTree from './estree';
|
|
2
|
-
import { type Token } from './token';
|
|
1
|
+
import type * as ESTree from './estree.ts';
|
|
2
|
+
import { type Token } from './token.ts';
|
|
3
3
|
type OnInsertedSemicolon = (pos: number) => any;
|
|
4
4
|
type SourceType = 'script' | 'module' | 'commonjs';
|
|
5
5
|
export type OnToken = (token: string, start: number, end: number, loc: ESTree.SourceLocation) => any;
|
|
@@ -27,7 +27,7 @@ export interface Options {
|
|
|
27
27
|
module?: boolean;
|
|
28
28
|
globalReturn?: boolean;
|
|
29
29
|
}
|
|
30
|
-
|
|
30
|
+
interface NormalizedRanges {
|
|
31
31
|
start: boolean;
|
|
32
32
|
end: boolean;
|
|
33
33
|
range: boolean;
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { AssignmentTargetKind, DestructuringKind, Flags, type Location } from '../common';
|
|
2
|
-
import { Errors } from '../errors';
|
|
3
|
-
import type * as ESTree from '../estree';
|
|
4
|
-
import { type NormalizedOptions, type Options } from '../options';
|
|
5
|
-
import { Token } from '../token';
|
|
6
|
-
import { PrivateScope } from './private-scope';
|
|
7
|
-
import { Scope, type ScopeKind } from './scope';
|
|
1
|
+
import { AssignmentTargetKind, DestructuringKind, Flags, type Location } from '../common.ts';
|
|
2
|
+
import { Errors } from '../errors.ts';
|
|
3
|
+
import type * as ESTree from '../estree.ts';
|
|
4
|
+
import { type NormalizedOptions, type Options } from '../options.ts';
|
|
5
|
+
import { Token } from '../token.ts';
|
|
6
|
+
import { PrivateScope } from './private-scope.ts';
|
|
7
|
+
import { Scope, type ScopeKind } from './scope.ts';
|
|
8
8
|
export declare class Parser {
|
|
9
9
|
readonly source: string;
|
|
10
10
|
private lastOnToken;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { type Location, PropertyKind } from '../common';
|
|
2
|
-
import { type Parser } from './parser';
|
|
1
|
+
import { type Location, PropertyKind } from '../common.ts';
|
|
2
|
+
import { type Parser } from './parser.ts';
|
|
3
3
|
export declare class PrivateScope {
|
|
4
4
|
readonly parser: Parser;
|
|
5
5
|
readonly parent?: PrivateScope | undefined;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { BindingKind, Context, type Location, Origin } from '../common';
|
|
2
|
-
import { Errors } from '../errors';
|
|
3
|
-
import { type Parser } from './parser';
|
|
1
|
+
import { BindingKind, Context, type Location, Origin } from '../common.ts';
|
|
2
|
+
import { Errors } from '../errors.ts';
|
|
3
|
+
import { type Parser } from './parser.ts';
|
|
4
4
|
export declare const enum ScopeKind {
|
|
5
5
|
ForStatement = 1,
|
|
6
6
|
Block = 2,
|
package/dist/types/parser.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Context } from './common';
|
|
2
|
-
import type * as ESTree from './estree';
|
|
3
|
-
import { type Options } from './options';
|
|
1
|
+
import { Context } from './common.ts';
|
|
2
|
+
import type * as ESTree from './estree.ts';
|
|
3
|
+
import { type Options } from './options.ts';
|
|
4
4
|
export declare function parseSource(source: string, rawOptions?: Options, context?: Context): ESTree.Program;
|
package/dist/types/token.d.ts
CHANGED
|
@@ -139,27 +139,28 @@ export declare const enum Token {
|
|
|
139
139
|
AccessorKeyword = 12402,
|
|
140
140
|
FromKeyword = 209011,
|
|
141
141
|
OfKeyword = 471156,
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
142
|
+
UsingKeyword = 209013,
|
|
143
|
+
EnumKeyword = 86134,
|
|
144
|
+
Eval = 537079927,
|
|
145
|
+
Arguments = 537079928,
|
|
146
|
+
EscapedReserved = -2147483527,
|
|
147
|
+
EscapedFutureReserved = -2147483526,
|
|
148
|
+
AnyIdentifier = 209019,
|
|
149
|
+
PrivateIdentifier = 124,
|
|
150
|
+
BigIntLiteral = 134283389,
|
|
151
|
+
Coalesce = 276824446,
|
|
152
|
+
QuestionMarkPeriod = 67108991,
|
|
153
|
+
WhiteSpace = 128,
|
|
154
|
+
Illegal = 129,
|
|
155
|
+
CarriageReturn = 130,
|
|
156
|
+
PrivateField = 131,
|
|
157
|
+
Template = 132,
|
|
158
|
+
Decorator = 133,
|
|
159
|
+
Target = 209030,
|
|
160
|
+
Meta = 209031,
|
|
161
|
+
LineFeed = 136,
|
|
162
|
+
EscapeStart = 137,
|
|
163
|
+
JSXText = 138
|
|
163
164
|
}
|
|
164
165
|
export declare const KeywordDescTable: string[];
|
|
165
166
|
export declare const descKeywordTable: {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "meriyah",
|
|
3
|
-
"version": "7.
|
|
3
|
+
"version": "7.2.0",
|
|
4
4
|
"description": "A 100% compliant, self-hosted javascript parser with high focus on both performance and stability",
|
|
5
5
|
"main": "dist/meriyah.cjs",
|
|
6
6
|
"module": "dist/meriyah.min.mjs",
|
|
@@ -11,6 +11,7 @@
|
|
|
11
11
|
"exports": {
|
|
12
12
|
"types": "./dist/types/meriyah.d.ts",
|
|
13
13
|
"module-sync": "./dist/meriyah.mjs",
|
|
14
|
+
"import": "./dist/meriyah.mjs",
|
|
14
15
|
"require": "./dist/meriyah.cjs",
|
|
15
16
|
"default": "./dist/meriyah.mjs"
|
|
16
17
|
},
|