@words-lang/parser 0.1.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/dist/analyser/analyser.d.ts +106 -0
- package/dist/analyser/analyser.d.ts.map +1 -0
- package/dist/analyser/analyser.js +291 -0
- package/dist/analyser/analyser.js.map +1 -0
- package/dist/analyser/diagnostics.d.ts +166 -0
- package/dist/analyser/diagnostics.d.ts.map +1 -0
- package/dist/analyser/diagnostics.js +139 -0
- package/dist/analyser/diagnostics.js.map +1 -0
- package/dist/analyser/workspace.d.ts +198 -0
- package/dist/analyser/workspace.d.ts.map +1 -0
- package/dist/analyser/workspace.js +403 -0
- package/dist/analyser/workspace.js.map +1 -0
- package/dist/index.d.ts +8 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +31 -0
- package/dist/index.js.map +1 -0
- package/dist/lexer/lexer.d.ts +120 -0
- package/dist/lexer/lexer.d.ts.map +1 -0
- package/dist/lexer/lexer.js +365 -0
- package/dist/lexer/lexer.js.map +1 -0
- package/dist/lexer/token.d.ts +247 -0
- package/dist/lexer/token.d.ts.map +1 -0
- package/dist/lexer/token.js +250 -0
- package/dist/lexer/token.js.map +1 -0
- package/dist/parser/ast.d.ts +685 -0
- package/dist/parser/ast.d.ts.map +1 -0
- package/dist/parser/ast.js +3 -0
- package/dist/parser/ast.js.map +1 -0
- package/dist/parser/parser.d.ts +411 -0
- package/dist/parser/parser.d.ts.map +1 -0
- package/dist/parser/parser.js +1600 -0
- package/dist/parser/parser.js.map +1 -0
- package/package.json +23 -0
- package/src/analyser/analyser.ts +403 -0
- package/src/analyser/diagnostics.ts +232 -0
- package/src/analyser/workspace.ts +457 -0
- package/src/index.ts +7 -0
- package/src/lexer/lexer.ts +379 -0
- package/src/lexer/token.ts +331 -0
- package/src/parser/ast.ts +798 -0
- package/src/parser/parser.ts +1815 -0
|
@@ -0,0 +1,139 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* diagnostics.ts
|
|
4
|
+
*
|
|
5
|
+
* Defines the Diagnostic type returned by the parser and analyser.
|
|
6
|
+
* Diagnostics are never thrown — they are collected and returned alongside
|
|
7
|
+
* the AST so the caller always receives the fullest possible picture of
|
|
8
|
+
* what the source contains, even when it is malformed.
|
|
9
|
+
*
|
|
10
|
+
* The LSP server maps these directly to VS Code diagnostics, using the
|
|
11
|
+
* `range` to underline the offending token in the editor.
|
|
12
|
+
*/
|
|
13
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
14
|
+
exports.DiagnosticCode = void 0;
|
|
15
|
+
exports.rangeFromToken = rangeFromToken;
|
|
16
|
+
exports.parseDiagnostic = parseDiagnostic;
|
|
17
|
+
exports.analyserDiagnostic = analyserDiagnostic;
|
|
18
|
+
// ── Diagnostic codes ──────────────────────────────────────────────────────────
|
|
19
|
+
/**
|
|
20
|
+
* Every diagnostic code the parser and analyser can produce.
|
|
21
|
+
* Codes are namespaced by layer:
|
|
22
|
+
* P_* — parse errors (structural / syntactic problems)
|
|
23
|
+
* A_* — analyser errors (semantic problems)
|
|
24
|
+
* W_* — warnings
|
|
25
|
+
* H_* — hints
|
|
26
|
+
*/
|
|
27
|
+
var DiagnosticCode;
|
|
28
|
+
(function (DiagnosticCode) {
|
|
29
|
+
// ── Parse errors ────────────────────────────────────────────────────────────
|
|
30
|
+
/** An unexpected token was encountered where a specific token was required. */
|
|
31
|
+
DiagnosticCode["P_UNEXPECTED_TOKEN"] = "P001";
|
|
32
|
+
/** The source ended before the construct was complete. */
|
|
33
|
+
DiagnosticCode["P_UNEXPECTED_EOF"] = "P002";
|
|
34
|
+
/** An opening `(` was not matched by a closing `)`. */
|
|
35
|
+
DiagnosticCode["P_UNCLOSED_PAREN"] = "P003";
|
|
36
|
+
/** A string literal was opened with `"` but never closed. */
|
|
37
|
+
DiagnosticCode["P_UNCLOSED_STRING"] = "P004";
|
|
38
|
+
/** A construct keyword was found in a position where it is not valid. */
|
|
39
|
+
DiagnosticCode["P_INVALID_CONSTRUCT_POSITION"] = "P005";
|
|
40
|
+
/** A `when` rule is missing its `enter` clause. */
|
|
41
|
+
DiagnosticCode["P_MISSING_ENTER"] = "P006";
|
|
42
|
+
/** A `when` rule is missing its `returns` clause. */
|
|
43
|
+
DiagnosticCode["P_MISSING_RETURNS"] = "P007";
|
|
44
|
+
/** A type annotation `(Type)` was expected but not found. */
|
|
45
|
+
DiagnosticCode["P_MISSING_TYPE"] = "P008";
|
|
46
|
+
/** An identifier (PascalCase or camelCase) was expected but not found. */
|
|
47
|
+
DiagnosticCode["P_MISSING_IDENTIFIER"] = "P009";
|
|
48
|
+
/** An `is` keyword was expected in an argument assignment but not found. */
|
|
49
|
+
DiagnosticCode["P_MISSING_IS"] = "P010";
|
|
50
|
+
// ── Analyser errors ─────────────────────────────────────────────────────────
|
|
51
|
+
/**
|
|
52
|
+
* A state referenced in a `when` rule or `start` declaration has no
|
|
53
|
+
* corresponding state definition in the module's directory.
|
|
54
|
+
*/
|
|
55
|
+
DiagnosticCode["A_UNDEFINED_STATE"] = "A001";
|
|
56
|
+
/**
|
|
57
|
+
* A context referenced in a `when` rule, `receives`, or `returns` clause
|
|
58
|
+
* has no corresponding context definition in the module's directory.
|
|
59
|
+
*/
|
|
60
|
+
DiagnosticCode["A_UNDEFINED_CONTEXT"] = "A002";
|
|
61
|
+
/**
|
|
62
|
+
* A context listed in a state's `returns` block has no corresponding
|
|
63
|
+
* `when` rule in any of the module's processes.
|
|
64
|
+
*/
|
|
65
|
+
DiagnosticCode["A_UNHANDLED_RETURN"] = "A003";
|
|
66
|
+
/**
|
|
67
|
+
* A state is defined but never referenced in any process `when` rule
|
|
68
|
+
* and is not the module's `start` state.
|
|
69
|
+
*/
|
|
70
|
+
DiagnosticCode["A_UNREACHABLE_STATE"] = "A004";
|
|
71
|
+
/**
|
|
72
|
+
* A module listed in the system's `modules` block has no corresponding
|
|
73
|
+
* module definition file.
|
|
74
|
+
*/
|
|
75
|
+
DiagnosticCode["A_UNDEFINED_MODULE"] = "A005";
|
|
76
|
+
/**
|
|
77
|
+
* A component referenced by qualified name (e.g. `UIModule.LoginForm`)
|
|
78
|
+
* cannot be resolved — either the module does not exist or the component
|
|
79
|
+
* is not defined within it.
|
|
80
|
+
*/
|
|
81
|
+
DiagnosticCode["A_UNDEFINED_COMPONENT"] = "A006";
|
|
82
|
+
/**
|
|
83
|
+
* The owning module declared at the top of a component file (e.g.
|
|
84
|
+
* `module AuthModule`) does not match the module the construct names itself.
|
|
85
|
+
*/
|
|
86
|
+
DiagnosticCode["A_MODULE_MISMATCH"] = "A007";
|
|
87
|
+
/**
|
|
88
|
+
* A `state.return(contextName)` call references a context name that does
|
|
89
|
+
* not appear in the enclosing state's `returns` clause.
|
|
90
|
+
*/
|
|
91
|
+
DiagnosticCode["A_INVALID_STATE_RETURN"] = "A008";
|
|
92
|
+
/**
|
|
93
|
+
* An `implements` block references a handler interface that is not declared
|
|
94
|
+
* in the named module.
|
|
95
|
+
*/
|
|
96
|
+
DiagnosticCode["A_UNDEFINED_INTERFACE"] = "A009";
|
|
97
|
+
// ── Warnings ────────────────────────────────────────────────────────────────
|
|
98
|
+
/**
|
|
99
|
+
* A `when` rule has no transition narrative.
|
|
100
|
+
* Narratives are optional but strongly recommended for readability.
|
|
101
|
+
*/
|
|
102
|
+
DiagnosticCode["W_MISSING_NARRATIVE"] = "W001";
|
|
103
|
+
/**
|
|
104
|
+
* A construct has no description string.
|
|
105
|
+
* Descriptions are optional but recommended for documentation.
|
|
106
|
+
*/
|
|
107
|
+
DiagnosticCode["W_MISSING_DESCRIPTION"] = "W002";
|
|
108
|
+
// ── Hints ────────────────────────────────────────────────────────────────────
|
|
109
|
+
/**
|
|
110
|
+
* A state has no `uses` block — it is a transient state that holds a
|
|
111
|
+
* position in the process map while something external resolves.
|
|
112
|
+
* This is valid but worth flagging so the designer is aware.
|
|
113
|
+
*/
|
|
114
|
+
DiagnosticCode["H_EMPTY_USES"] = "H001";
|
|
115
|
+
})(DiagnosticCode || (exports.DiagnosticCode = DiagnosticCode = {}));
|
|
116
|
+
// ── Convenience constructors ──────────────────────────────────────────────────
|
|
117
|
+
/**
|
|
118
|
+
* Creates a Range from a 1-based line and column and the length of the
|
|
119
|
+
* offending text. Converts to the zero-based LSP convention internally.
|
|
120
|
+
*/
|
|
121
|
+
function rangeFromToken(line, column, length) {
|
|
122
|
+
return {
|
|
123
|
+
start: { line: line - 1, character: column - 1 },
|
|
124
|
+
end: { line: line - 1, character: column - 1 + length },
|
|
125
|
+
};
|
|
126
|
+
}
|
|
127
|
+
/**
|
|
128
|
+
* Creates a parser-layer Diagnostic.
|
|
129
|
+
*/
|
|
130
|
+
function parseDiagnostic(code, message, severity, range) {
|
|
131
|
+
return { code, message, severity, range, source: 'parser' };
|
|
132
|
+
}
|
|
133
|
+
/**
|
|
134
|
+
* Creates an analyser-layer Diagnostic.
|
|
135
|
+
*/
|
|
136
|
+
function analyserDiagnostic(code, message, severity, range) {
|
|
137
|
+
return { code, message, severity, range, source: 'analyser' };
|
|
138
|
+
}
|
|
139
|
+
//# sourceMappingURL=diagnostics.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"diagnostics.js","sourceRoot":"","sources":["../../src/analyser/diagnostics.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;GAUG;;;AAgMH,wCAKC;AAKD,0CAOC;AAKD,gDAOC;AAtLD,iFAAiF;AAEjF;;;;;;;GAOG;AACH,IAAY,cAiHX;AAjHD,WAAY,cAAc;IAEtB,+EAA+E;IAE/E,+EAA+E;IAC/E,6CAA2B,CAAA;IAE3B,0DAA0D;IAC1D,2CAAyB,CAAA;IAEzB,uDAAuD;IACvD,2CAAyB,CAAA;IAEzB,6DAA6D;IAC7D,4CAA0B,CAAA;IAE1B,yEAAyE;IACzE,uDAAqC,CAAA;IAErC,mDAAmD;IACnD,0CAAwB,CAAA;IAExB,qDAAqD;IACrD,4CAA0B,CAAA;IAE1B,6DAA6D;IAC7D,yCAAuB,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AO,EAAE,QAAQ,EAAE,KAAK,EAAE,MAAM,EAAE,UAAU,EAAE,CAAA;AACjE,CAAC"}
|
|
@@ -0,0 +1,198 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* workspace.ts
|
|
3
|
+
*
|
|
4
|
+
* The Workspace scans a WORDS project directory, parses every `.wds` file it
|
|
5
|
+
* finds, and builds a cross-file index of all constructs organised by module.
|
|
6
|
+
*
|
|
7
|
+
* The index is the shared data structure consumed by the Analyser and later
|
|
8
|
+
* by the LSP server for go-to-definition and find-references. Neither the
|
|
9
|
+
* Analyser nor the LSP reads files directly — they always go through the
|
|
10
|
+
* Workspace.
|
|
11
|
+
*
|
|
12
|
+
* Design principles:
|
|
13
|
+
*
|
|
14
|
+
* - One parse per file. The Workspace caches parse results so the Analyser
|
|
15
|
+
* can query the index repeatedly without re-parsing.
|
|
16
|
+
*
|
|
17
|
+
* - Flat index structure. Constructs are indexed by module name and construct
|
|
18
|
+
* name so lookups are O(1) rather than requiring a tree walk.
|
|
19
|
+
*
|
|
20
|
+
* - Parse errors are preserved. Files that fail to parse partially are still
|
|
21
|
+
* indexed — whatever nodes were recovered are included. Parse diagnostics
|
|
22
|
+
* are stored alongside the index and returned with analyser diagnostics.
|
|
23
|
+
*
|
|
24
|
+
* - The Workspace is synchronous. File I/O uses Node's `fs` module directly.
|
|
25
|
+
* The LSP layer wraps this in async when needed.
|
|
26
|
+
*/
|
|
27
|
+
import { ParseResult } from '../parser/parser';
|
|
28
|
+
import { SystemNode, ModuleNode, StateNode, ContextNode, ScreenNode, ViewNode, ProviderNode, AdapterNode, InterfaceNode } from '../parser/ast';
|
|
29
|
+
import { Diagnostic } from './diagnostics';
|
|
30
|
+
/**
|
|
31
|
+
* A map from construct name to node, scoped to one module.
|
|
32
|
+
* e.g. states.get('AuthModule')?.get('Unauthenticated') → StateNode
|
|
33
|
+
*/
|
|
34
|
+
type ConstructMap<T> = Map<string, T>;
|
|
35
|
+
/**
|
|
36
|
+
* A map from module name to a per-module construct map.
|
|
37
|
+
*/
|
|
38
|
+
type ModuleIndex<T> = Map<string, ConstructMap<T>>;
|
|
39
|
+
/**
|
|
40
|
+
* Everything the Workspace knows about a single `.wds` file.
|
|
41
|
+
*
|
|
42
|
+
* `filePath` — absolute path to the file on disk.
|
|
43
|
+
* `source` — raw source text read from disk.
|
|
44
|
+
* `parseResult` — the result of parsing the source, including the document
|
|
45
|
+
* AST and any parse-layer diagnostics.
|
|
46
|
+
*/
|
|
47
|
+
export interface FileRecord {
|
|
48
|
+
filePath: string;
|
|
49
|
+
source: string;
|
|
50
|
+
parseResult: ParseResult;
|
|
51
|
+
}
|
|
52
|
+
/**
|
|
53
|
+
* The cross-file index of a WORDS project.
|
|
54
|
+
*
|
|
55
|
+
* Built by calling `Workspace.load(projectRoot)`. Consumers query the index
|
|
56
|
+
* directly via the public maps — there are no query methods, just data.
|
|
57
|
+
*/
|
|
58
|
+
export declare class Workspace {
|
|
59
|
+
/** Absolute path to the project root directory. */
|
|
60
|
+
readonly projectRoot: string;
|
|
61
|
+
/**
|
|
62
|
+
* All parsed files, keyed by absolute file path.
|
|
63
|
+
* Includes both successfully parsed files and files with parse errors.
|
|
64
|
+
*/
|
|
65
|
+
readonly files: Map<string, FileRecord>;
|
|
66
|
+
/**
|
|
67
|
+
* All parse-layer diagnostics collected across all files.
|
|
68
|
+
* Indexed by absolute file path.
|
|
69
|
+
*/
|
|
70
|
+
readonly parseDiagnostics: Map<string, Diagnostic[]>;
|
|
71
|
+
/**
|
|
72
|
+
* The single system declaration found in the project.
|
|
73
|
+
* Null if no system file was found or if it failed to parse.
|
|
74
|
+
*/
|
|
75
|
+
system: SystemNode | null;
|
|
76
|
+
/**
|
|
77
|
+
* The file path of the system declaration, for diagnostic reporting.
|
|
78
|
+
*/
|
|
79
|
+
systemFilePath: string | null;
|
|
80
|
+
/**
|
|
81
|
+
* All module definitions, keyed by module name.
|
|
82
|
+
* e.g. modules.get('AuthModule') → ModuleNode
|
|
83
|
+
*/
|
|
84
|
+
readonly modules: Map<string, ModuleNode>;
|
|
85
|
+
/**
|
|
86
|
+
* File path of each module definition, for diagnostic reporting.
|
|
87
|
+
* e.g. modulePaths.get('AuthModule') → '/project/AuthModule/AuthModule.wds'
|
|
88
|
+
*/
|
|
89
|
+
readonly modulePaths: Map<string, string>;
|
|
90
|
+
/**
|
|
91
|
+
* All state definitions, keyed by module name then state name.
|
|
92
|
+
* e.g. states.get('AuthModule')?.get('Unauthenticated') → StateNode
|
|
93
|
+
*/
|
|
94
|
+
readonly states: ModuleIndex<StateNode>;
|
|
95
|
+
/**
|
|
96
|
+
* All context definitions, keyed by module name then context name.
|
|
97
|
+
*/
|
|
98
|
+
readonly contexts: ModuleIndex<ContextNode>;
|
|
99
|
+
/**
|
|
100
|
+
* All screen definitions, keyed by module name then screen name.
|
|
101
|
+
*/
|
|
102
|
+
readonly screens: ModuleIndex<ScreenNode>;
|
|
103
|
+
/**
|
|
104
|
+
* All view definitions, keyed by module name then view name.
|
|
105
|
+
*/
|
|
106
|
+
readonly views: ModuleIndex<ViewNode>;
|
|
107
|
+
/**
|
|
108
|
+
* All provider definitions, keyed by module name then provider name.
|
|
109
|
+
*/
|
|
110
|
+
readonly providers: ModuleIndex<ProviderNode>;
|
|
111
|
+
/**
|
|
112
|
+
* All adapter definitions, keyed by module name then adapter name.
|
|
113
|
+
*/
|
|
114
|
+
readonly adapters: ModuleIndex<AdapterNode>;
|
|
115
|
+
/**
|
|
116
|
+
* All interface component definitions, keyed by module name then interface name.
|
|
117
|
+
*/
|
|
118
|
+
readonly interfaces: ModuleIndex<InterfaceNode>;
|
|
119
|
+
/**
|
|
120
|
+
* File path of each construct, for go-to-definition.
|
|
121
|
+
* Key format: 'ModuleName/ConstructName' (e.g. 'AuthModule/Unauthenticated')
|
|
122
|
+
*/
|
|
123
|
+
readonly constructPaths: Map<string, string>;
|
|
124
|
+
private constructor();
|
|
125
|
+
/**
|
|
126
|
+
* Scans `projectRoot` recursively for `.wds` files, parses each one,
|
|
127
|
+
* and returns a fully populated Workspace.
|
|
128
|
+
*
|
|
129
|
+
* Never throws — files that cannot be read or parsed are recorded with
|
|
130
|
+
* their errors and skipped during indexing.
|
|
131
|
+
*/
|
|
132
|
+
static load(projectRoot: string): Workspace;
|
|
133
|
+
/**
|
|
134
|
+
* Reloads a single file and rebuilds the index.
|
|
135
|
+
* Used by the LSP server when a file changes on disk.
|
|
136
|
+
*/
|
|
137
|
+
reload(filePath: string): void;
|
|
138
|
+
/**
|
|
139
|
+
* Returns the StateNode for the given module and state name, or null.
|
|
140
|
+
*/
|
|
141
|
+
getState(moduleName: string, stateName: string): StateNode | null;
|
|
142
|
+
/**
|
|
143
|
+
* Returns the ContextNode for the given module and context name, or null.
|
|
144
|
+
*/
|
|
145
|
+
getContext(moduleName: string, contextName: string): ContextNode | null;
|
|
146
|
+
/**
|
|
147
|
+
* Returns the ScreenNode for the given module and screen name, or null.
|
|
148
|
+
*/
|
|
149
|
+
getScreen(moduleName: string, screenName: string): ScreenNode | null;
|
|
150
|
+
/**
|
|
151
|
+
* Returns the ViewNode for the given module and view name, or null.
|
|
152
|
+
* Also searches other modules if moduleName is null.
|
|
153
|
+
*/
|
|
154
|
+
getView(moduleName: string, viewName: string): ViewNode | null;
|
|
155
|
+
/**
|
|
156
|
+
* Returns all parse diagnostics across all files as a flat array,
|
|
157
|
+
* each annotated with the file path that produced it.
|
|
158
|
+
*/
|
|
159
|
+
allParseDiagnostics(): Array<{
|
|
160
|
+
filePath: string;
|
|
161
|
+
diagnostic: Diagnostic;
|
|
162
|
+
}>;
|
|
163
|
+
/**
|
|
164
|
+
* Reads and parses a single `.wds` file, storing the result in `this.files`.
|
|
165
|
+
* Silently records any read error as a parse diagnostic.
|
|
166
|
+
*/
|
|
167
|
+
private loadFile;
|
|
168
|
+
/**
|
|
169
|
+
* Recursively finds all `.wds` files under `dir`.
|
|
170
|
+
* Skips `node_modules` and hidden directories.
|
|
171
|
+
*/
|
|
172
|
+
private findWdsFiles;
|
|
173
|
+
/**
|
|
174
|
+
* Clears all index maps. Called before a rebuild.
|
|
175
|
+
*/
|
|
176
|
+
private clearIndex;
|
|
177
|
+
/**
|
|
178
|
+
* Walks all parsed documents and populates the index maps.
|
|
179
|
+
* Called once after all files are loaded, and again after each reload.
|
|
180
|
+
*/
|
|
181
|
+
private buildIndex;
|
|
182
|
+
/**
|
|
183
|
+
* Indexes all top-level nodes in a single document into the appropriate maps.
|
|
184
|
+
*/
|
|
185
|
+
private indexDocument;
|
|
186
|
+
/**
|
|
187
|
+
* Indexes a single top-level node into the appropriate map.
|
|
188
|
+
* Uses `ownerModule` from the ownership declaration if the node's own
|
|
189
|
+
* `module` field is empty (component files).
|
|
190
|
+
*/
|
|
191
|
+
private indexNode;
|
|
192
|
+
/**
|
|
193
|
+
* Ensures a per-module map exists for the given module name.
|
|
194
|
+
*/
|
|
195
|
+
private ensureModuleMap;
|
|
196
|
+
}
|
|
197
|
+
export {};
|
|
198
|
+
//# sourceMappingURL=workspace.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"workspace.d.ts","sourceRoot":"","sources":["../../src/analyser/workspace.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AAKH,OAAO,EAAU,WAAW,EAAE,MAAM,kBAAkB,CAAA;AACtD,OAAO,EACH,UAAU,EACV,UAAU,EACV,SAAS,EACT,WAAW,EACX,UAAU,EACV,QAAQ,EACR,YAAY,EACZ,WAAW,EACX,aAAa,EAGhB,MAAM,eAAe,CAAA;AACtB,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAA;AAI1C;;;GAGG;AACH,KAAK,YAAY,CAAC,CAAC,IAAI,GAAG,CAAC,MAAM,EAAE,CAAC,CAAC,CAAA;AAErC;;GAEG;AACH,KAAK,WAAW,CAAC,CAAC,IAAI,GAAG,CAAC,MAAM,EAAE,YAAY,CAAC,CAAC,CAAC,CAAC,CAAA;AAIlD;;;;;;;GAOG;AACH,M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