Skip to content

Commit 3036e8b

Browse files
committed
WIP: shifted indexes of string array wrappers #2: refactoring
1 parent 559e3a4 commit 3036e8b

14 files changed

+267
-35419
lines changed

dist/index.browser.js

Lines changed: 7 additions & 7 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/index.cli.js

Lines changed: 1 addition & 17976 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/index.js

Lines changed: 1 addition & 17298 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/container/ServiceIdentifiers.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,8 @@ export enum ServiceIdentifiers {
5050
IScopeIdentifiersTraverser = 'IScopeIdentifiersTraverser',
5151
ISourceCode = 'ISourceCode',
5252
IScopeAnalyzer = 'IScopeAnalyzer',
53-
IStringArrayScopeCallsWrapperDataStorage = 'IStringArrayScopeCallsWrapperDataStorage',
53+
IStringArrayScopeCallsWrapperLexicalScopeDataStorage = 'IStringArrayScopeCallsWrapperLexicalScopeDataStorage',
54+
IStringArrayScopeCallsWrapperNamesDataStorage = 'IStringArrayScopeCallsWrapperNamesDataStorage',
5455
IStringArrayStorage = 'IStringArrayStorage',
5556
IStringArrayStorageAnalyzer = 'IStringArrayStorageAnalyzer',
5657
IVisitedLexicalScopeNodesStackStorage = 'IVisitedLexicalScopeNodesStackStorage',

src/container/modules/storages/StoragesModule.ts

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,14 +7,16 @@ import { TCustomCodeHelperGroupStorage } from '../../../types/storages/TCustomCo
77
import { ILiteralNodesCacheStorage } from '../../../interfaces/storages/string-array-transformers/ILiteralNodesCacheStorage';
88
import { IOptions } from '../../../interfaces/options/IOptions';
99
import { IRandomGenerator } from '../../../interfaces/utils/IRandomGenerator';
10-
import { IStringArrayScopeCallsWrapperDataStorage } from '../../../interfaces/storages/string-array-transformers/IStringArrayScopeCallsWrapperDataStorage';
10+
import { IStringArrayScopeCallsWrapperLexicalScopeDataStorage } from '../../../interfaces/storages/string-array-transformers/IStringArrayScopeCallsWrapperLexicalScopeDataStorage';
11+
import { IStringArrayScopeCallsWrapperNamesDataStorage } from '../../../interfaces/storages/string-array-transformers/IStringArrayScopeCallsWrapperNamesDataStorage';
1112
import { IStringArrayStorage } from '../../../interfaces/storages/string-array-transformers/IStringArrayStorage';
1213
import { IVisitedLexicalScopeNodesStackStorage } from '../../../interfaces/storages/string-array-transformers/IVisitedLexicalScopeNodesStackStorage';
1314

1415
import { ControlFlowStorage } from '../../../storages/custom-nodes/ControlFlowStorage';
1516
import { CustomCodeHelperGroupStorage } from '../../../storages/custom-code-helpers/CustomCodeHelperGroupStorage';
1617
import { LiteralNodesCacheStorage } from '../../../storages/string-array-transformers/LiteralNodesCacheStorage';
17-
import { StringArrayScopeCallsWrapperDataStorage } from '../../../storages/string-array-transformers/StringArrayScopeCallsWrapperDataStorage';
18+
import { StringArrayScopeCallsWrapperLexicalScopeDataStorage } from '../../../storages/string-array-transformers/StringArrayScopeCallsWrapperLexicalScopeDataStorage';
19+
import { StringArrayScopeCallsWrapperNamesDataStorage } from '../../../storages/string-array-transformers/StringArrayScopeCallsWrapperNamesDataStorage';
1820
import { StringArrayStorage } from '../../../storages/string-array-transformers/StringArrayStorage';
1921
import { VisitedLexicalScopeNodesStackStorage } from '../../../storages/string-array-transformers/VisitedLexicalScopeNodesStackStorage';
2022

@@ -32,8 +34,12 @@ export const storagesModule: interfaces.ContainerModule = new ContainerModule((b
3234
.to(StringArrayStorage)
3335
.inSingletonScope();
3436

35-
bind<IStringArrayScopeCallsWrapperDataStorage>(ServiceIdentifiers.IStringArrayScopeCallsWrapperDataStorage)
36-
.to(StringArrayScopeCallsWrapperDataStorage)
37+
bind<IStringArrayScopeCallsWrapperLexicalScopeDataStorage>(ServiceIdentifiers.IStringArrayScopeCallsWrapperLexicalScopeDataStorage)
38+
.to(StringArrayScopeCallsWrapperLexicalScopeDataStorage)
39+
.inSingletonScope();
40+
41+
bind<IStringArrayScopeCallsWrapperNamesDataStorage>(ServiceIdentifiers.IStringArrayScopeCallsWrapperNamesDataStorage)
42+
.to(StringArrayScopeCallsWrapperNamesDataStorage)
3743
.inSingletonScope();
3844

3945
bind<IVisitedLexicalScopeNodesStackStorage>(ServiceIdentifiers.IVisitedLexicalScopeNodesStackStorage)

src/interfaces/node-transformers/string-array-transformers/IStringArrayScopeCallsWrapperData.ts

Lines changed: 0 additions & 24 deletions
This file was deleted.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
import { TNodeWithLexicalScopeStatements } from '../../../types/node/TNodeWithLexicalScopeStatements';
2+
3+
export interface IStringArrayScopeCallsWrapperLexicalScopeData {
4+
/**
5+
* @type {TNodeWithLexicalScopeStatements | null}
6+
*/
7+
parentLexicalScopeBodyNode: TNodeWithLexicalScopeStatements | null;
8+
9+
/**
10+
* @type {number}
11+
*/
12+
resultShiftedIndex: number;
13+
14+
/**
15+
* @type {number}
16+
*/
17+
scopeShiftedIndex: number;
18+
}

src/interfaces/storages/string-array-transformers/IStringArrayScopeCallsWrapperDataStorage.ts

Lines changed: 0 additions & 11 deletions
This file was deleted.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
import { TNodeWithLexicalScopeStatements } from '../../../types/node/TNodeWithLexicalScopeStatements';
2+
3+
import { IMapStorage } from '../IMapStorage';
4+
import { IStringArrayScopeCallsWrapperLexicalScopeData } from '../../node-transformers/string-array-transformers/IStringArrayScopeCallsWrapperLexicalScopeData';
5+
6+
// eslint-disable-next-line @typescript-eslint/no-empty-interface
7+
export interface IStringArrayScopeCallsWrapperLexicalScopeDataStorage extends IMapStorage<
8+
TNodeWithLexicalScopeStatements,
9+
IStringArrayScopeCallsWrapperLexicalScopeData
10+
> {}
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
import { TNodeWithLexicalScopeStatements } from '../../../types/node/TNodeWithLexicalScopeStatements';
2+
import { TStringArrayScopeCallsWrapperNamesDataByEncoding } from '../../../types/node-transformers/string-array-transformers/TStringArrayScopeCallsWrapperNamesDataByEncoding';
3+
4+
import { IMapStorage } from '../IMapStorage';
5+
6+
// eslint-disable-next-line @typescript-eslint/no-empty-interface
7+
export interface IStringArrayScopeCallsWrapperNamesDataStorage extends IMapStorage<
8+
TNodeWithLexicalScopeStatements,
9+
TStringArrayScopeCallsWrapperNamesDataByEncoding
10+
> {}

0 commit comments

Comments
 (0)