yini-parser 1.1.0-beta → 1.3.0-beta
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 +50 -2
- package/README.md +2 -2
- package/dist/YINI.d.ts +155 -27
- package/dist/YINI.js +145 -174
- package/dist/YINI.js.map +1 -0
- package/dist/config/env.js +1 -0
- package/dist/config/env.js.map +1 -0
- package/dist/core/{ASTBuilder.d.ts → astBuilder.d.ts} +4 -4
- package/dist/core/{ASTBuilder.js → astBuilder.js} +82 -69
- package/dist/core/astBuilder.js.map +1 -0
- package/dist/core/{ErrorDataHandler.d.ts → errorDataHandler.d.ts} +16 -10
- package/dist/core/{ErrorDataHandler.js → errorDataHandler.js} +115 -109
- package/dist/core/errorDataHandler.js.map +1 -0
- package/dist/core/internalTypes.d.ts +127 -0
- package/dist/core/{types.js → internalTypes.js} +6 -0
- package/dist/core/internalTypes.js.map +1 -0
- package/dist/core/objectBuilder.d.ts +2 -2
- package/dist/core/objectBuilder.js +1 -0
- package/dist/core/objectBuilder.js.map +1 -0
- package/dist/core/options/defaultParserOptions.d.ts +17 -0
- package/dist/core/options/defaultParserOptions.js +46 -0
- package/dist/core/options/defaultParserOptions.js.map +1 -0
- package/dist/core/options/failLevel.d.ts +3 -0
- package/dist/core/options/failLevel.js +27 -0
- package/dist/core/options/failLevel.js.map +1 -0
- package/dist/core/options/optionsFunctions.d.ts +8 -0
- package/dist/core/options/optionsFunctions.js +62 -0
- package/dist/core/options/optionsFunctions.js.map +1 -0
- package/dist/core/parsingRules/modeFromRulesMatcher.d.ts +8 -0
- package/dist/core/parsingRules/modeFromRulesMatcher.js +114 -0
- package/dist/core/parsingRules/modeFromRulesMatcher.js.map +1 -0
- package/dist/core/parsingRules/rulesConstAndGuards.d.ts +7 -0
- package/dist/core/parsingRules/rulesConstAndGuards.js +35 -0
- package/dist/core/parsingRules/rulesConstAndGuards.js.map +1 -0
- package/dist/core/pipeline/errorListeners.d.ts +18 -0
- package/dist/core/pipeline/errorListeners.js +107 -0
- package/dist/core/pipeline/errorListeners.js.map +1 -0
- package/dist/core/pipeline/pipeline.d.ts +18 -0
- package/dist/core/pipeline/pipeline.js +244 -0
- package/dist/core/pipeline/pipeline.js.map +1 -0
- package/dist/core/resultMetadataBuilder.d.ts +19 -0
- package/dist/core/resultMetadataBuilder.js +187 -0
- package/dist/core/resultMetadataBuilder.js.map +1 -0
- package/dist/core/runtime.d.ts +21 -0
- package/dist/core/runtime.js +201 -0
- package/dist/core/runtime.js.map +1 -0
- package/dist/dev/main.d.ts +1 -0
- package/dist/dev/main.js +305 -0
- package/dist/dev/main.js.map +1 -0
- package/dist/grammar/{YiniLexer.js → generated/YiniLexer.js} +2 -1
- package/dist/grammar/generated/YiniLexer.js.map +1 -0
- package/dist/grammar/{YiniParser.js → generated/YiniParser.js} +2 -1
- package/dist/grammar/generated/YiniParser.js.map +1 -0
- package/dist/grammar/{YiniParserVisitor.js → generated/YiniParserVisitor.js} +2 -1
- package/dist/grammar/generated/YiniParserVisitor.js.map +1 -0
- package/dist/index.d.ts +40 -1
- package/dist/index.js +60 -359
- package/dist/index.js.map +1 -0
- package/dist/parsers/extractHeaderParts.d.ts +2 -2
- package/dist/parsers/extractHeaderParts.js +2 -1
- package/dist/parsers/extractHeaderParts.js.map +1 -0
- package/dist/parsers/extractSignificantYiniLine.js +2 -1
- package/dist/parsers/extractSignificantYiniLine.js.map +1 -0
- package/dist/parsers/parseBoolean.js +1 -0
- package/dist/parsers/parseBoolean.js.map +1 -0
- package/dist/parsers/parseNull.js +1 -0
- package/dist/parsers/parseNull.js.map +1 -0
- package/dist/parsers/parseNumber.js +1 -0
- package/dist/parsers/parseNumber.js.map +1 -0
- package/dist/parsers/parseSectionHeader.d.ts +3 -3
- package/dist/parsers/parseSectionHeader.js +2 -1
- package/dist/parsers/parseSectionHeader.js.map +1 -0
- package/dist/parsers/parseString.js +3 -3
- package/dist/parsers/parseString.js.map +1 -0
- package/dist/types/index.d.ts +219 -0
- package/dist/types/index.js +4 -0
- package/dist/types/index.js.map +1 -0
- package/dist/utils/number.js +1 -0
- package/dist/utils/number.js.map +1 -0
- package/dist/utils/object.d.ts +12 -0
- package/dist/utils/object.js +41 -1
- package/dist/utils/object.js.map +1 -0
- package/dist/utils/pathAndFileName.js +1 -0
- package/dist/utils/pathAndFileName.js.map +1 -0
- package/dist/utils/print.d.ts +2 -2
- package/dist/utils/print.js +11 -6
- package/dist/utils/print.js.map +1 -0
- package/dist/utils/string.d.ts +5 -0
- package/dist/utils/string.js +10 -1
- package/dist/utils/string.js.map +1 -0
- package/dist/utils/system.js +1 -0
- package/dist/utils/system.js.map +1 -0
- package/dist/{yiniHelpers.d.ts → utils/yiniHelpers.d.ts} +1 -1
- package/dist/{yiniHelpers.js → utils/yiniHelpers.js} +3 -2
- package/dist/utils/yiniHelpers.js.map +1 -0
- package/examples/basic-output.js +12 -12
- package/package.json +11 -6
- package/dist/core/types.d.ts +0 -249
- package/dist/parseEntry.d.ts +0 -3
- package/dist/parseEntry.js +0 -456
- /package/dist/grammar/{YiniLexer.d.ts → generated/YiniLexer.d.ts} +0 -0
- /package/dist/grammar/{YiniParser.d.ts → generated/YiniParser.d.ts} +0 -0
- /package/dist/grammar/{YiniParserVisitor.d.ts → generated/YiniParserVisitor.d.ts} +0 -0
package/dist/YINI.js
CHANGED
|
@@ -1,50 +1,20 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
-
};
|
|
5
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
const fs_1 = __importDefault(require("fs"));
|
|
7
|
-
const perf_hooks_1 = require("perf_hooks");
|
|
8
3
|
const env_1 = require("./config/env");
|
|
9
|
-
const
|
|
10
|
-
const
|
|
11
|
-
const
|
|
4
|
+
const errorDataHandler_1 = require("./core/errorDataHandler");
|
|
5
|
+
const optionsFunctions_1 = require("./core/options/optionsFunctions");
|
|
6
|
+
const runtime_1 = require("./core/runtime");
|
|
12
7
|
const print_1 = require("./utils/print");
|
|
13
|
-
const string_1 = require("./utils/string");
|
|
14
8
|
const DEFAULT_TAB_SIZE = 4; // De facto "modern default" (even though traditionally/historically it's 8).
|
|
15
|
-
let _runtimeInfo = {
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
}
|
|
24
|
-
// Type guard: did the caller use the options-object form?
|
|
25
|
-
const isOptionsObjectForm = (v) => {
|
|
26
|
-
return (v != null &&
|
|
27
|
-
typeof v === 'object' &&
|
|
28
|
-
// Note: If one wants, this can be relax to "typeof v === 'object'"
|
|
29
|
-
// but this keeps accidental booleans/strings out.
|
|
30
|
-
('strictMode' in v ||
|
|
31
|
-
'failLevel' in v ||
|
|
32
|
-
'includeMetaData' in v ||
|
|
33
|
-
'includeDiagnostics' in v ||
|
|
34
|
-
'includeTiming' in v ||
|
|
35
|
-
'preserveUndefinedInMeta' in v ||
|
|
36
|
-
'requireDocTerminator' in v));
|
|
37
|
-
};
|
|
38
|
-
// Initial default values.
|
|
39
|
-
const DEFAULT_OPTS = {
|
|
40
|
-
strictMode: false,
|
|
41
|
-
failLevel: 'auto',
|
|
42
|
-
includeMetaData: false,
|
|
43
|
-
includeDiagnostics: false,
|
|
44
|
-
includeTiming: false,
|
|
45
|
-
preserveUndefinedInMeta: false,
|
|
46
|
-
requireDocTerminator: false,
|
|
47
|
-
};
|
|
9
|
+
// let _runtimeInfo: IRuntimeInfo = {
|
|
10
|
+
// sourceType: 'Inline',
|
|
11
|
+
// fileName: undefined,
|
|
12
|
+
// fileByteSize: null,
|
|
13
|
+
// lineCount: null,
|
|
14
|
+
// timeIoMs: null,
|
|
15
|
+
// preferredBailSensitivity: null,
|
|
16
|
+
// sha256: null,
|
|
17
|
+
// }
|
|
48
18
|
/**
|
|
49
19
|
* This class is the public API, which exposes only parse(..) and
|
|
50
20
|
* parseFile(..), rest of the implementation details are hidden.
|
|
@@ -63,7 +33,8 @@ class YINI {
|
|
|
63
33
|
*/
|
|
64
34
|
static setTabSize(spaces) {
|
|
65
35
|
if (spaces < 1 || spaces > 32) {
|
|
66
|
-
new
|
|
36
|
+
new errorDataHandler_1.ErrorDataHandler('None/Ignore').pushOrBail(null, 'Fatal-Error', `Invalid tab size ${spaces} is out of range.`, 'Tab size must be between 1 and 32 spaces.');
|
|
37
|
+
throw new RangeError(`Tab size ${spaces} is out of range (1–32).`);
|
|
67
38
|
}
|
|
68
39
|
this.g_tabSize = spaces;
|
|
69
40
|
}
|
|
@@ -71,76 +42,67 @@ class YINI {
|
|
|
71
42
|
// Implementation method (not declared with arrow function) for both method overload signatures.
|
|
72
43
|
// NOTE: Must be method declaration with NO =, arrow functions not (currently) supported for this type of method overloading.
|
|
73
44
|
static parse(yiniContent, arg2, // strictMode | options
|
|
74
|
-
failLevel =
|
|
75
|
-
var _a, _b, _c, _d, _e, _f, _g, _h;
|
|
45
|
+
failLevel = 'auto', includeMetadata = false) {
|
|
76
46
|
(0, print_1.debugPrint)('-> Entered static parse(..) in class YINI\n');
|
|
77
|
-
// Runtime guard to catch illegal/ambiguous calls coming from JS or any-cast code
|
|
78
|
-
if (
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
//
|
|
83
|
-
|
|
84
|
-
//
|
|
85
|
-
//
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
//
|
|
115
|
-
//
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
level = 1;
|
|
128
|
-
}
|
|
129
|
-
else {
|
|
130
|
-
level = userOpts.failLevel;
|
|
131
|
-
}
|
|
132
|
-
const coreOpts = {
|
|
133
|
-
isStrict: userOpts.strictMode,
|
|
134
|
-
bailSensitivity: level,
|
|
135
|
-
isIncludeMeta: userOpts.includeMetaData,
|
|
136
|
-
isWithDiagnostics: (0, env_1.isDev)() || (0, env_1.isDebug)() || userOpts.includeDiagnostics,
|
|
137
|
-
isWithTiming: (0, env_1.isDev)() || (0, env_1.isDebug)() || userOpts.includeTiming,
|
|
138
|
-
isKeepUndefinedInMeta: (0, env_1.isDebug)() || userOpts.preserveUndefinedInMeta,
|
|
139
|
-
isRequireDocTerminator: userOpts.requireDocTerminator,
|
|
140
|
-
};
|
|
47
|
+
// // Runtime guard to catch illegal/ambiguous calls coming from JS or any-cast code
|
|
48
|
+
// if (
|
|
49
|
+
// isOptionsObjectForm(arg2) &&
|
|
50
|
+
// (failLevel !== 'auto' || includeMetadata !== false)
|
|
51
|
+
// ) {
|
|
52
|
+
// throw new TypeError(
|
|
53
|
+
// 'Invalid call: when providing an options object, do not also pass positional parameters.',
|
|
54
|
+
// )
|
|
55
|
+
// }
|
|
56
|
+
// const mode: TParserMode = inferModeFromArgs(arg2)
|
|
57
|
+
// const defaultOptions = getDefaultOptions(mode)
|
|
58
|
+
// // Normalize to a fully-required options object.
|
|
59
|
+
// let userOpts: Required<ParseOptions>
|
|
60
|
+
// // Required, makes all properties in T required, no undefined.
|
|
61
|
+
// if (isOptionsObjectForm(arg2)) {
|
|
62
|
+
// userOpts = {
|
|
63
|
+
// ...defaultOptions, // Sets the default options.
|
|
64
|
+
// ...arg2,
|
|
65
|
+
// }
|
|
66
|
+
// } else {
|
|
67
|
+
// // Positional form.
|
|
68
|
+
// userOpts = {
|
|
69
|
+
// ...defaultOptions, // Sets the default options.
|
|
70
|
+
// strictMode:
|
|
71
|
+
// (arg2 as boolean | undefined) ?? defaultOptions.strictMode,
|
|
72
|
+
// failLevel,
|
|
73
|
+
// includeMetadata,
|
|
74
|
+
// }
|
|
75
|
+
// }
|
|
76
|
+
// if (userOpts.includeMetadata && _runtimeInfo.sourceType === 'Inline') {
|
|
77
|
+
// const lineCount = yiniContent.split(/\r?\n/).length // Counts the lines.
|
|
78
|
+
// const sha256 = computeSha256(yiniContent) // NOTE: Compute BEFORE any possible tampering of content.
|
|
79
|
+
// _runtimeInfo.lineCount = lineCount
|
|
80
|
+
// _runtimeInfo.preferredBailSensitivity = userOpts.failLevel
|
|
81
|
+
// _runtimeInfo.sha256 = sha256
|
|
82
|
+
// }
|
|
83
|
+
// // NOTE: Important: Do not trim or mutate the yiniContent here, due
|
|
84
|
+
// // to it will mess up the line numbers in error reporting.
|
|
85
|
+
// if (!yiniContent) {
|
|
86
|
+
// throw new Error('Syntax-Error: Unexpected blank YINI input')
|
|
87
|
+
// }
|
|
88
|
+
// if (!yiniContent.endsWith('\n')) {
|
|
89
|
+
// yiniContent += '\n'
|
|
90
|
+
// }
|
|
91
|
+
// let level: TBailSensitivityLevel = mapFailLevelToBail(
|
|
92
|
+
// userOpts.strictMode,
|
|
93
|
+
// userOpts.failLevel,
|
|
94
|
+
// )
|
|
95
|
+
////////////////
|
|
96
|
+
// const coreOpts: IParseCoreOptions = toCoreOptions(userOpts,level)
|
|
141
97
|
(0, print_1.debugPrint)();
|
|
142
|
-
(0, print_1.debugPrint)('==== Call
|
|
143
|
-
const result =
|
|
98
|
+
(0, print_1.debugPrint)('==== Call doParse(..) in runtime ==========================');
|
|
99
|
+
// const result = _parseMain(yiniContent, coreOpts, _runtimeInfo)
|
|
100
|
+
const runtime = new runtime_1.YiniRuntime('Inline');
|
|
101
|
+
const result = (0, optionsFunctions_1.isOptionsObjectForm)(arg2)
|
|
102
|
+
? runtime.doParse(yiniContent, arg2) // Overload #2: (content, options)
|
|
103
|
+
: runtime.doParse(
|
|
104
|
+
// Overload #1: (content, strict?, failLevel?, includeMeta?)
|
|
105
|
+
yiniContent, arg2, failLevel, includeMetadata);
|
|
144
106
|
(0, print_1.debugPrint)('==== End call parse ==========================\n');
|
|
145
107
|
if ((0, env_1.isDev)()) {
|
|
146
108
|
console.log();
|
|
@@ -155,73 +117,82 @@ class YINI {
|
|
|
155
117
|
// Implementation method (not declared with arrow function) for both method overload signatures.
|
|
156
118
|
// NOTE: Must be method declaration with NO =, arrow functions not (currently) supported for this type of method overloading.
|
|
157
119
|
static parseFile(filePath, arg2, // strictMode | options
|
|
158
|
-
failLevel =
|
|
159
|
-
var _a, _b, _c, _d, _e, _f, _g, _h;
|
|
120
|
+
failLevel = 'auto', includeMetadata = false) {
|
|
160
121
|
(0, print_1.debugPrint)('-> Entered static parseFile(..) in class YINI\n');
|
|
161
122
|
(0, print_1.debugPrint)('Current directory = ' + process.cwd());
|
|
162
|
-
// Runtime guard to catch illegal/ambiguous calls coming from JS or any-cast code
|
|
163
|
-
if (
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
//
|
|
168
|
-
|
|
169
|
-
//
|
|
170
|
-
//
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
}
|
|
192
|
-
if (
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
//
|
|
199
|
-
|
|
200
|
-
//
|
|
201
|
-
const
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
const
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
123
|
+
// // Runtime guard to catch illegal/ambiguous calls coming from JS or any-cast code
|
|
124
|
+
// if (
|
|
125
|
+
// isOptionsObjectForm(arg2) &&
|
|
126
|
+
// (failLevel !== 'auto' || includeMetadata !== false)
|
|
127
|
+
// ) {
|
|
128
|
+
// throw new TypeError(
|
|
129
|
+
// 'Invalid call: when providing an options object, do not also pass positional parameters.',
|
|
130
|
+
// )
|
|
131
|
+
// }
|
|
132
|
+
// const mode: TParserMode = inferModeFromArgs(arg2)
|
|
133
|
+
// const defaultOptions = getDefaultOptions(mode)
|
|
134
|
+
// // Normalize to a fully-required options object.
|
|
135
|
+
// let userOpts: Required<ParseOptions>
|
|
136
|
+
// // Required, makes all properties in T required, no undefined.
|
|
137
|
+
// if (isOptionsObjectForm(arg2)) {
|
|
138
|
+
// // Options-object Form.
|
|
139
|
+
// userOpts = {
|
|
140
|
+
// ...defaultOptions, // Sets the default options.
|
|
141
|
+
// ...arg2,
|
|
142
|
+
// }
|
|
143
|
+
// } else {
|
|
144
|
+
// // Positional form.
|
|
145
|
+
// userOpts = {
|
|
146
|
+
// ...defaultOptions, // Sets the default options.
|
|
147
|
+
// strictMode:
|
|
148
|
+
// (arg2 as boolean | undefined) ?? defaultOptions.strictMode,
|
|
149
|
+
// failLevel,
|
|
150
|
+
// includeMetadata,
|
|
151
|
+
// }
|
|
152
|
+
// }
|
|
153
|
+
// if (getFileNameExtension(filePath).toLowerCase() !== '.yini') {
|
|
154
|
+
// console.error('Invalid file extension for YINI file:')
|
|
155
|
+
// console.error(`"${filePath}"`)
|
|
156
|
+
// console.log(
|
|
157
|
+
// 'File does not have a valid ".yini" extension (case-insensitive).',
|
|
158
|
+
// )
|
|
159
|
+
// throw new Error('Error: Unexpected file extension for YINI file')
|
|
160
|
+
// }
|
|
161
|
+
// // ---- Phase 0: I/O ----
|
|
162
|
+
// const timeStartMs = performance.now()
|
|
163
|
+
// // let content = fs.readFileSync(filePath, 'utf8')
|
|
164
|
+
// const rawBuffer = fs.readFileSync(filePath) // Raw buffer for size.
|
|
165
|
+
// const fileByteSize = rawBuffer.byteLength // Byte size in UTF-8.
|
|
166
|
+
// let content = rawBuffer.toString('utf8')
|
|
167
|
+
// const timeEndMs = performance.now()
|
|
168
|
+
// _runtimeInfo.sourceType = 'File'
|
|
169
|
+
// _runtimeInfo.fileName = filePath
|
|
170
|
+
// if (userOpts.includeMetadata) {
|
|
171
|
+
// _runtimeInfo.lineCount = content.split(/\r?\n/).length // Counts the lines.
|
|
172
|
+
// _runtimeInfo.fileByteSize = fileByteSize
|
|
173
|
+
// _runtimeInfo.timeIoMs = +(timeEndMs - timeStartMs).toFixed(3)
|
|
174
|
+
// _runtimeInfo.preferredBailSensitivity = userOpts.failLevel
|
|
175
|
+
// _runtimeInfo.sha256 = computeSha256(content) // NOTE: Compute BEFORE any possible tampering of content.
|
|
176
|
+
// }
|
|
177
|
+
// let hasNoNewlineAtEOF = false
|
|
178
|
+
// if (!content.endsWith('\n')) {
|
|
179
|
+
// content += '\n'
|
|
180
|
+
// hasNoNewlineAtEOF = true
|
|
181
|
+
// }
|
|
182
|
+
(0, print_1.debugPrint)();
|
|
183
|
+
(0, print_1.debugPrint)('==== Call doParseFile(..) in runtime ==========================');
|
|
184
|
+
// const result = _parseMain(yiniContent, coreOpts, _runtimeInfo)
|
|
185
|
+
const runtime = new runtime_1.YiniRuntime('File');
|
|
186
|
+
const result = (0, optionsFunctions_1.isOptionsObjectForm)(arg2)
|
|
187
|
+
? runtime.doParseFile(filePath, arg2) // Overload #2: (content, options)
|
|
188
|
+
: runtime.doParseFile(
|
|
189
|
+
// Overload #1: (content, strict?, failLevel?, includeMeta?)
|
|
190
|
+
filePath, arg2, failLevel, includeMetadata);
|
|
191
|
+
(0, print_1.debugPrint)('==== End call parse ==========================\n');
|
|
223
192
|
return result;
|
|
224
193
|
}
|
|
225
194
|
}
|
|
195
|
+
// @todo In future move/change this to not be a global and suffer from possible race conditions, possibly move this into YiniRuntime class.
|
|
226
196
|
YINI.g_tabSize = DEFAULT_TAB_SIZE; // Global tab size used in error messages.
|
|
227
197
|
exports.default = YINI;
|
|
198
|
+
//# sourceMappingURL=YINI.js.map
|
package/dist/YINI.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"YINI.js","sourceRoot":"","sources":["../src/YINI.ts"],"names":[],"mappings":";;AAAA,sCAA6C;AAC7C,8DAA0D;AAC1D,sEAAqE;AACrE,4CAA4C;AAO5C,yCAAiE;AAEjE,MAAM,gBAAgB,GAAG,CAAC,CAAA,CAAC,6EAA6E;AAExG,qCAAqC;AACrC,4BAA4B;AAC5B,2BAA2B;AAC3B,0BAA0B;AAC1B,uBAAuB;AACvB,sBAAsB;AACtB,sCAAsC;AACtC,oBAAoB;AACpB,IAAI;AAEJ;;;;GAIG;AACH,MAAqB,IAAI;IAIrB;;OAEG;IACI,MAAM,CAAC,UAAU;QACpB,OAAO,IAAI,CAAC,SAAS,CAAA;IACzB,CAAC;IAED;;;OAGG;IACI,MAAM,CAAC,UAAU,CAAC,MAAc;QACnC,IAAI,MAAM,GAAG,CAAC,IAAI,MAAM,GAAG,EAAE,EAAE,CAAC;YAC5B,IAAI,mCAAgB,CAAC,aAAa,CAAC,CAAC,UAAU,CAC1C,IAAI,EACJ,aAAa,EACb,oBAAoB,MAAM,mBAAmB,EAC7C,2CAA2C,CAC9C,CAAA;YACD,MAAM,IAAI,UAAU,CAAC,YAAY,MAAM,0BAA0B,CAAC,CAAA;QACtE,CAAC;QACD,IAAI,CAAC,SAAS,GAAG,MAAM,CAAA;IAC3B,CAAC;IA6GD,yEAAyE;IACzE,gGAAgG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AE,CAAA;QACzC,IACI,GAAG,CAAC,WAAW,EAAE,KAAK,WAAW;YACjC,GAAG,CAAC,WAAW,EAAE,KAAK,cAAc,EACtC,CAAC;YACC,OAAO,IAAI,CAAA;QACf,CAAC;IACL,CAAC;IAED,OAAO,KAAK,CAAA;AAChB,CAAC,CAAA;AAjBY,QAAA,OAAO,WAiBnB"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { AnnotationContext, AssignmentContext, Bad_memberContext, Bad_meta_textContext, Boolean_literalContext, Colon_list_declContext, DirectiveContext, ElementsContext, EolContext, List_literalContext, MemberContext, Meta_stmtContext, Null_literalContext, Number_literalContext, Object_literalContext, Object_memberContext, Object_membersContext, PrologContext, StmtContext, String_concatContext, String_literalContext, Terminal_stmtContext, ValueContext, YiniContext } from '../grammar/YiniParser.js';
|
|
2
|
-
import YiniParserVisitor from '../grammar/YiniParserVisitor';
|
|
3
|
-
import { ErrorDataHandler } from './
|
|
4
|
-
import { IParseCoreOptions, IYiniAST, TSourceType } from './
|
|
1
|
+
import { AnnotationContext, AssignmentContext, Bad_memberContext, Bad_meta_textContext, Boolean_literalContext, Colon_list_declContext, DirectiveContext, ElementsContext, EolContext, List_literalContext, MemberContext, Meta_stmtContext, Null_literalContext, Number_literalContext, Object_literalContext, Object_memberContext, Object_membersContext, PrologContext, StmtContext, String_concatContext, String_literalContext, Terminal_stmtContext, ValueContext, YiniContext } from '../grammar/generated/YiniParser.js';
|
|
2
|
+
import YiniParserVisitor from '../grammar/generated/YiniParserVisitor';
|
|
3
|
+
import { ErrorDataHandler } from './errorDataHandler';
|
|
4
|
+
import { IParseCoreOptions, IYiniAST, TSourceType } from './internalTypes';
|
|
5
5
|
/** Parse SECTION_HEAD token text → {level, name}.
|
|
6
6
|
* Supports repeated markers (^^^^) and shorthand (^7) (Spec 5.2–5.3.1). :contentReference[oaicite:5]{index=5}:contentReference[oaicite:6]{index=6}
|
|
7
7
|
*/
|