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.
@@ -1,5 +1,5 @@
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 const enum Context {
4
4
  None = 0,
5
5
  Strict = 1,
@@ -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,
@@ -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,5 +1,5 @@
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 const enum LexerState {
4
4
  None = 0,
5
5
  NewLine = 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;
@@ -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, version };
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';
@@ -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
- export interface NormalizedRanges {
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,
@@ -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;
@@ -139,27 +139,28 @@ export declare const enum Token {
139
139
  AccessorKeyword = 12402,
140
140
  FromKeyword = 209011,
141
141
  OfKeyword = 471156,
142
- EnumKeyword = 86133,
143
- Eval = 537079926,
144
- Arguments = 537079927,
145
- EscapedReserved = -2147483528,
146
- EscapedFutureReserved = -2147483527,
147
- AnyIdentifier = 209018,
148
- PrivateIdentifier = 123,
149
- BigIntLiteral = 134283388,
150
- Coalesce = 276824445,
151
- QuestionMarkPeriod = 67108990,
152
- WhiteSpace = 127,
153
- Illegal = 128,
154
- CarriageReturn = 129,
155
- PrivateField = 130,
156
- Template = 131,
157
- Decorator = 132,
158
- Target = 209029,
159
- Meta = 209030,
160
- LineFeed = 135,
161
- EscapeStart = 136,
162
- JSXText = 137
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.1.1",
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
  },