yini-parser 1.0.0-alpha.7x → 1.0.0-beta.1
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 +3 -1
- package/README.md +10 -0
- package/dist/YINI.js +15 -15
- package/dist/core/ErrorDataHandler.js +15 -15
- package/dist/core/YINIVisitor.js +175 -175
- package/dist/core/objectBuilder.js +39 -39
- package/dist/grammar/YiniLexer.js +1 -1
- package/dist/grammar/YiniParser.d.ts +1 -1
- package/dist/grammar/YiniParser.js +5 -5
- package/dist/grammar/YiniParserVisitor.js +1 -1
- package/dist/index.js +11 -35
- package/dist/parseEntry.js +21 -21
- package/dist/parsers/extractHeaderParts.js +14 -14
- package/dist/parsers/extractSignificantYiniLine.js +18 -18
- package/dist/parsers/parseBoolean.js +2 -2
- package/dist/parsers/parseNull.js +2 -2
- package/dist/parsers/parseNumber.js +8 -8
- package/dist/parsers/parseSectionHeader.js +19 -19
- package/dist/parsers/parseString.js +9 -9
- package/dist/utils/string.js +3 -3
- package/dist/yiniHelpers.js +3 -3
- package/examples/basic-output.js +15 -0
- package/examples/nested-output.js +18 -0
- package/package.json +1 -1
- /package/dist/utils/{system.d.ts → print.d.ts} +0 -0
- /package/dist/utils/{system.js → print.js} +0 -0
package/dist/core/YINIVisitor.js
CHANGED
|
@@ -11,8 +11,8 @@ const parseNull_1 = __importDefault(require("../parsers/parseNull"));
|
|
|
11
11
|
const parseNumber_1 = __importDefault(require("../parsers/parseNumber"));
|
|
12
12
|
const parseSectionHeader_1 = __importDefault(require("../parsers/parseSectionHeader"));
|
|
13
13
|
const parseString_1 = __importDefault(require("../parsers/parseString"));
|
|
14
|
+
const print_1 = require("../utils/print");
|
|
14
15
|
const string_1 = require("../utils/string");
|
|
15
|
-
const system_1 = require("../utils/system");
|
|
16
16
|
const yiniHelpers_1 = require("../yiniHelpers");
|
|
17
17
|
const ErrorDataHandler_1 = require("./ErrorDataHandler");
|
|
18
18
|
/**
|
|
@@ -55,12 +55,12 @@ class YINIVisitor extends YiniParserVisitor_1.default {
|
|
|
55
55
|
this.pushOnTree = (ctx, sReslult) => {
|
|
56
56
|
if ((0, env_1.isDebug)()) {
|
|
57
57
|
console.log();
|
|
58
|
-
(0,
|
|
59
|
-
(0,
|
|
60
|
-
(0,
|
|
58
|
+
(0, print_1.debugPrint)('--- In pushOnTree(..) --------');
|
|
59
|
+
(0, print_1.debugPrint)('sReslult:');
|
|
60
|
+
(0, print_1.printObject)(sReslult);
|
|
61
61
|
}
|
|
62
62
|
const key = sReslult.level + '-' + sReslult.name;
|
|
63
|
-
(0,
|
|
63
|
+
(0, print_1.debugPrint)('KKKKKK, key = ' + key);
|
|
64
64
|
// if (this.existingSectionTitles.has(key)) {
|
|
65
65
|
if (this.hasDefinedSectionTitle(key, sReslult.level)) {
|
|
66
66
|
this.errorHandler.pushOrBail(ctx, 'Syntax-Error', 'Section name already exists', 'Cannot redefine section name: "' +
|
|
@@ -71,7 +71,7 @@ class YINIVisitor extends YiniParserVisitor_1.default {
|
|
|
71
71
|
}
|
|
72
72
|
else {
|
|
73
73
|
if (sReslult.members === undefined) {
|
|
74
|
-
(0,
|
|
74
|
+
(0, print_1.debugPrint)('This sReslult does not hold any valid members (=undefined)');
|
|
75
75
|
}
|
|
76
76
|
else {
|
|
77
77
|
// this.existingSectionTitles.set(key, true)
|
|
@@ -107,9 +107,9 @@ class YINIVisitor extends YiniParserVisitor_1.default {
|
|
|
107
107
|
this.reversedTree.push(chain);
|
|
108
108
|
// }
|
|
109
109
|
this.meta_numOfChains++;
|
|
110
|
-
(0,
|
|
111
|
-
(0,
|
|
112
|
-
(0,
|
|
110
|
+
(0, print_1.debugPrint)('this.reversedTree: [list]');
|
|
111
|
+
(0, print_1.printObject)(this.reversedTree);
|
|
112
|
+
(0, print_1.debugPrint)('--- /end of pushOnTree(..) --------');
|
|
113
113
|
};
|
|
114
114
|
this.getDepthOfLevels = () => {
|
|
115
115
|
return this.lastActiveSectionNameAtLevels.length;
|
|
@@ -140,55 +140,55 @@ class YINIVisitor extends YiniParserVisitor_1.default {
|
|
|
140
140
|
// Note, after pushing processing may continue or exit, depending on the error and/or the bail threshold.
|
|
141
141
|
new ErrorDataHandler_1.ErrorDataHandler().pushOrBail(null, 'Fatal-Error', 'Has no ErrorDataHandler instance when calling visitYini(..)', 'Something in the code is done incorrectly in order for this to happen... :S');
|
|
142
142
|
}
|
|
143
|
-
(0,
|
|
144
|
-
(0,
|
|
143
|
+
(0, print_1.debugPrint)();
|
|
144
|
+
(0, print_1.debugPrint)('abcde99');
|
|
145
145
|
(0, env_1.isDebug)() && console.log();
|
|
146
|
-
(0,
|
|
147
|
-
(0,
|
|
146
|
+
(0, print_1.debugPrint)('-> Entered visitYini(..) in YINIVisitor');
|
|
147
|
+
(0, print_1.debugPrint)('QQQQ');
|
|
148
148
|
(_a = ctx.section_list()) === null || _a === void 0 ? void 0 : _a.forEach((section) => {
|
|
149
149
|
// ctx?.section_list()?.forEach((section: any) => {
|
|
150
|
-
(0,
|
|
150
|
+
(0, print_1.debugPrint)('\nStart of each element in forEeach(..) of section_list():');
|
|
151
151
|
const topSectionResult = this.visitSection(section);
|
|
152
152
|
this.pushOnTree(ctx, topSectionResult);
|
|
153
153
|
const topSectionName = topSectionResult === null || topSectionResult === void 0 ? void 0 : topSectionResult.name;
|
|
154
154
|
const topSectionMembers = topSectionResult === null || topSectionResult === void 0 ? void 0 : topSectionResult.members;
|
|
155
155
|
const topSectionLevel = topSectionResult === null || topSectionResult === void 0 ? void 0 : topSectionResult.level; // This must have a value of 1.
|
|
156
|
-
(0,
|
|
156
|
+
(0, print_1.debugPrint)('\ntopSectionResult (visitSection(..)):');
|
|
157
157
|
if ((0, env_1.isDebug)()) {
|
|
158
158
|
console.log(topSectionResult);
|
|
159
159
|
}
|
|
160
|
-
(0,
|
|
160
|
+
(0, print_1.debugPrint)('Found section head, topSectionName = "' + topSectionName + '"');
|
|
161
161
|
topSectionMembers &&
|
|
162
|
-
(0,
|
|
162
|
+
(0, print_1.debugPrint)('Num of Props of topSectionResult?.members: ' +
|
|
163
163
|
Object.keys(topSectionResult === null || topSectionResult === void 0 ? void 0 : topSectionResult.members).length);
|
|
164
|
-
(0,
|
|
164
|
+
(0, print_1.debugPrint)('topSectionMembers:');
|
|
165
165
|
if ((0, env_1.isDebug)()) {
|
|
166
166
|
console.log(topSectionMembers);
|
|
167
167
|
}
|
|
168
168
|
if (topSectionName) {
|
|
169
|
-
(0,
|
|
170
|
-
(0,
|
|
171
|
-
(0,
|
|
172
|
-
(0,
|
|
173
|
-
(0,
|
|
174
|
-
(0,
|
|
169
|
+
(0, print_1.debugPrint)();
|
|
170
|
+
(0, print_1.debugPrint)('-- Just extracted TOP/FIRST section info ---------------------------');
|
|
171
|
+
(0, print_1.debugPrint)(' TOP/FIRST topSectionName = ' + topSectionName);
|
|
172
|
+
(0, print_1.debugPrint)(' topSectionLevel = ' + topSectionLevel);
|
|
173
|
+
(0, print_1.debugPrint)(' this.level = ' + this.level);
|
|
174
|
+
(0, print_1.debugPrint)('Mounted/assigned section onto resultSections...');
|
|
175
175
|
}
|
|
176
|
-
(0,
|
|
176
|
+
(0, print_1.debugPrint)('\n=== resultSections: =====================================');
|
|
177
177
|
if ((0, env_1.isDebug)()) {
|
|
178
178
|
console.log('2222222222222');
|
|
179
179
|
console.log(`lastActiveSectionAtLevels[${this.level - 1}]`);
|
|
180
|
-
(0,
|
|
180
|
+
(0, print_1.printObject)(this.lastActiveSectionAtLevels[this.level - 1]);
|
|
181
181
|
}
|
|
182
|
-
(0,
|
|
183
|
-
(0,
|
|
184
|
-
(0,
|
|
182
|
+
(0, print_1.debugPrint)('==============================================\n');
|
|
183
|
+
(0, print_1.debugPrint)('End of each element in forEeach(..) of section_list().');
|
|
184
|
+
(0, print_1.debugPrint)();
|
|
185
185
|
});
|
|
186
186
|
const syntaxTree = this.reversedTree.reverse();
|
|
187
187
|
if ((0, env_1.isDebug)()) {
|
|
188
188
|
console.log();
|
|
189
189
|
console.log('=========================================================================');
|
|
190
190
|
console.log('=== syntaxTree: ==========================================================');
|
|
191
|
-
(0,
|
|
191
|
+
(0, print_1.printObject)(syntaxTree);
|
|
192
192
|
console.log('=========================================================================');
|
|
193
193
|
console.log('=========================================================================');
|
|
194
194
|
console.log();
|
|
@@ -216,19 +216,19 @@ class YINIVisitor extends YiniParserVisitor_1.default {
|
|
|
216
216
|
// 'Classic-Header-Marker'
|
|
217
217
|
var _a, _b, _c;
|
|
218
218
|
(0, env_1.isDebug)() && console.log();
|
|
219
|
-
(0,
|
|
219
|
+
(0, print_1.debugPrint)('-> Entered visitSection(..)');
|
|
220
220
|
const res = {};
|
|
221
|
-
(0,
|
|
222
|
-
(0,
|
|
223
|
-
(0,
|
|
224
|
-
(0,
|
|
221
|
+
(0, print_1.debugPrint)('start');
|
|
222
|
+
(0, print_1.debugPrint)('XXXX0:ctx.getText() = ' + ctx.getText());
|
|
223
|
+
(0, print_1.debugPrint)('XXXX1:ctx.SECTION_HEAD() = ' + ctx.SECTION_HEAD());
|
|
224
|
+
(0, print_1.debugPrint)('XXXX1:SECTION_HEAD().getText() = ' +
|
|
225
225
|
((_a = ctx.SECTION_HEAD()) === null || _a === void 0 ? void 0 : _a.getText().trim()));
|
|
226
|
-
(0,
|
|
226
|
+
(0, print_1.debugPrint)('end\n');
|
|
227
227
|
let line = '';
|
|
228
228
|
try {
|
|
229
|
-
(0,
|
|
229
|
+
(0, print_1.debugPrint)('S1');
|
|
230
230
|
line = ((_b = ctx.SECTION_HEAD()) === null || _b === void 0 ? void 0 : _b.getText().trim()) || '';
|
|
231
|
-
(0,
|
|
231
|
+
(0, print_1.debugPrint)('S2, line: >>>' + line + '<<<');
|
|
232
232
|
}
|
|
233
233
|
catch (error) {
|
|
234
234
|
const msgWhat = `Unexpected syntax while parsing a member or section head`;
|
|
@@ -238,14 +238,14 @@ class YINIVisitor extends YiniParserVisitor_1.default {
|
|
|
238
238
|
}
|
|
239
239
|
// If no section head can be found in the above SECTION_HEAD(),
|
|
240
240
|
// try alternative method of reading the section content.
|
|
241
|
-
(0,
|
|
241
|
+
(0, print_1.debugPrint)('S3, line: >>>' + line + '<<<');
|
|
242
242
|
if (!line) {
|
|
243
|
-
(0,
|
|
244
|
-
(0,
|
|
245
|
-
(0,
|
|
243
|
+
(0, print_1.debugPrint)();
|
|
244
|
+
(0, print_1.debugPrint)('Nothing in SECTION_HEAD() is found, trying to read the section content directly...');
|
|
245
|
+
(0, print_1.debugPrint)('--- Start: parse line from section content-----------------');
|
|
246
246
|
// const sectionContent = '' + ctx.getText().trim()
|
|
247
247
|
const sectionContent = ctx.getText().trim();
|
|
248
|
-
(0,
|
|
248
|
+
(0, print_1.debugPrint)('Section content: ' + ctx.getText());
|
|
249
249
|
line = (0, extractSignificantYiniLine_1.extractYiniLine)(sectionContent);
|
|
250
250
|
// const contentLines = splitLines(sectionContent)
|
|
251
251
|
// if (isDebug()) {
|
|
@@ -278,9 +278,9 @@ class YINIVisitor extends YiniParserVisitor_1.default {
|
|
|
278
278
|
// )
|
|
279
279
|
// debugPrint()
|
|
280
280
|
}
|
|
281
|
-
(0,
|
|
281
|
+
(0, print_1.debugPrint)('S4, line: >>>' + line + '<<<');
|
|
282
282
|
if (!line) {
|
|
283
|
-
(0,
|
|
283
|
+
(0, print_1.debugPrint)('*** ERROR: Nothing to parse in section line');
|
|
284
284
|
}
|
|
285
285
|
this.prevLevel = this.level;
|
|
286
286
|
let { sectionName, sectionLevel } = (0, parseSectionHeader_1.default)(line, this.errorHandler, ctx);
|
|
@@ -297,18 +297,18 @@ class YINIVisitor extends YiniParserVisitor_1.default {
|
|
|
297
297
|
else {
|
|
298
298
|
nestDirection = 'higher';
|
|
299
299
|
}
|
|
300
|
-
(0,
|
|
301
|
-
(0,
|
|
302
|
-
(0,
|
|
303
|
-
(0,
|
|
304
|
-
(0,
|
|
305
|
-
(0,
|
|
306
|
-
(0,
|
|
307
|
-
(0,
|
|
308
|
-
(0,
|
|
309
|
-
(0,
|
|
300
|
+
(0, print_1.debugPrint)('-- In visitSection(..) ---------------------------');
|
|
301
|
+
(0, print_1.debugPrint)(' sectionName = ' + sectionName);
|
|
302
|
+
(0, print_1.debugPrint)(' sectionLevel = ' + sectionLevel);
|
|
303
|
+
(0, print_1.debugPrint)(' this.level = ' + this.level);
|
|
304
|
+
(0, print_1.debugPrint)(' this.prevLevel = ' + this.prevLevel);
|
|
305
|
+
(0, print_1.debugPrint)(' this.prevSectionName = ' + this.prevSectionName);
|
|
306
|
+
(0, print_1.debugPrint)(' nestDirection = ' + nestDirection);
|
|
307
|
+
(0, print_1.debugPrint)(' this.numOfLevelOnes = ' + this.numOfLevelOnes);
|
|
308
|
+
(0, print_1.debugPrint)('this.getDepthOfLevels() = ' + this.getDepthOfLevels());
|
|
309
|
+
(0, print_1.debugPrint)();
|
|
310
310
|
if (nestDirection === 'higher') {
|
|
311
|
-
(0,
|
|
311
|
+
(0, print_1.debugPrint)(`Is level skipping: ${this.level - this.prevLevel} >= 2?`);
|
|
312
312
|
// if (Math.abs(this.prevLevel - this.level) >= 2) {
|
|
313
313
|
if (this.level - this.prevLevel >= 2) {
|
|
314
314
|
if (this.level === 2) {
|
|
@@ -337,17 +337,17 @@ class YINIVisitor extends YiniParserVisitor_1.default {
|
|
|
337
337
|
}
|
|
338
338
|
}
|
|
339
339
|
this.prevSectionName = sectionName;
|
|
340
|
-
(0,
|
|
340
|
+
(0, print_1.debugPrint)('About to visit members of section...');
|
|
341
341
|
let members;
|
|
342
342
|
if (!ctx.section_members()) {
|
|
343
|
-
(0,
|
|
343
|
+
(0, print_1.debugPrint)('(!) Section has no members!');
|
|
344
344
|
}
|
|
345
345
|
else {
|
|
346
346
|
members = this.visitSection_members(ctx.section_members());
|
|
347
347
|
}
|
|
348
348
|
// ---------------------------------------------------------------
|
|
349
349
|
(_c = ctx.children) === null || _c === void 0 ? void 0 : _c.forEach((child) => {
|
|
350
|
-
(0,
|
|
350
|
+
(0, print_1.debugPrint)('* child: ' + child);
|
|
351
351
|
});
|
|
352
352
|
if (this.level === 1) {
|
|
353
353
|
this.numOfLevelOnes++;
|
|
@@ -380,26 +380,26 @@ class YINIVisitor extends YiniParserVisitor_1.default {
|
|
|
380
380
|
// }
|
|
381
381
|
// this.prevSectionName = sectionName
|
|
382
382
|
if (nestDirection !== 'higher') {
|
|
383
|
-
(0,
|
|
384
|
-
(0,
|
|
385
|
-
(0,
|
|
386
|
-
(0,
|
|
383
|
+
(0, print_1.debugPrint)('About to reset result');
|
|
384
|
+
(0, print_1.printObject)({ [sectionName]: members });
|
|
385
|
+
(0, print_1.debugPrint)(`Current lastActiveSectionAtLevels[${this.level - 1}]`);
|
|
386
|
+
(0, print_1.printObject)(this.lastActiveSectionAtLevels[this.level - 1]);
|
|
387
387
|
if (
|
|
388
388
|
// (level === 0 && !sectionName) ||
|
|
389
389
|
// (sectionName === 'undefined' && !!members)
|
|
390
390
|
sectionLevel === 0 &&
|
|
391
391
|
sectionName === 'undefined' &&
|
|
392
392
|
!!members) {
|
|
393
|
-
(0,
|
|
394
|
-
(0,
|
|
393
|
+
(0, print_1.debugPrint)('HIT2!!!!');
|
|
394
|
+
(0, print_1.debugPrint)('(!) Detected a member (that does not have a sectionName), but a memberless object in "members"');
|
|
395
395
|
sectionName = Object.keys(members)[0];
|
|
396
|
-
(0,
|
|
396
|
+
(0, print_1.debugPrint)('sectionName = ' + sectionName);
|
|
397
397
|
members = {};
|
|
398
398
|
// this.lastActiveSectionAtLevels[0] = { [sectionName]: {} }
|
|
399
399
|
// this.pushOnTree({ level: 1, name: sectionName, members: {} })
|
|
400
|
-
(0,
|
|
401
|
-
(0,
|
|
402
|
-
(0,
|
|
400
|
+
(0, print_1.debugPrint)('(!) Skipping mounted since this is actually a memberless section');
|
|
401
|
+
(0, print_1.debugPrint)();
|
|
402
|
+
(0, print_1.debugPrint)('<- Leaving visitSection(..) EARLY');
|
|
403
403
|
if ((0, env_1.isDebug)()) {
|
|
404
404
|
console.log('returning (a memberless section):');
|
|
405
405
|
console.log({
|
|
@@ -426,61 +426,61 @@ class YINIVisitor extends YiniParserVisitor_1.default {
|
|
|
426
426
|
members,
|
|
427
427
|
});
|
|
428
428
|
// this.lastActiveSectionNameAtLevels.push(sectionName)
|
|
429
|
-
(0,
|
|
429
|
+
(0, print_1.debugPrint)('Mounted as append');
|
|
430
430
|
}
|
|
431
|
-
(0,
|
|
432
|
-
(0,
|
|
431
|
+
(0, print_1.debugPrint)(`After: lastActiveSectionAtLevels[${this.level - 1}]`);
|
|
432
|
+
(0, print_1.printObject)(this.lastActiveSectionAtLevels[this.level - 1]);
|
|
433
433
|
if ((0, env_1.isDebug)()) {
|
|
434
434
|
console.log(`After append lastActiveSectionAtLevels[${this.level - 1}]`);
|
|
435
|
-
(0,
|
|
436
|
-
(0,
|
|
437
|
-
(0,
|
|
435
|
+
(0, print_1.printObject)(this.lastActiveSectionAtLevels[this.level - 1]);
|
|
436
|
+
(0, print_1.debugPrint)('Before this.lastActiveSectionNameAtLevels:');
|
|
437
|
+
(0, print_1.printObject)(this.lastActiveSectionNameAtLevels);
|
|
438
438
|
// Reset.
|
|
439
439
|
let i = this.level;
|
|
440
440
|
while (this.lastActiveSectionNameAtLevels[i]) {
|
|
441
441
|
this.lastActiveSectionNameAtLevels[i++] = undefined;
|
|
442
442
|
}
|
|
443
|
-
(0,
|
|
444
|
-
(0,
|
|
443
|
+
(0, print_1.debugPrint)('After this.lastActiveSectionNameAtLevels:');
|
|
444
|
+
(0, print_1.printObject)(this.lastActiveSectionNameAtLevels);
|
|
445
445
|
}
|
|
446
|
-
(0,
|
|
447
|
-
(0,
|
|
448
|
-
(0,
|
|
449
|
-
(0,
|
|
450
|
-
(0,
|
|
451
|
-
(0,
|
|
452
|
-
(0,
|
|
446
|
+
(0, print_1.debugPrint)('HIT!!! - Just a lower or same level section, a continues full (nested) section,');
|
|
447
|
+
(0, print_1.debugPrint)(`Has above in lastActiveSectionAtLevels[${this.level - 1}]`);
|
|
448
|
+
(0, print_1.debugPrint)(' this.level: ' + this.level);
|
|
449
|
+
(0, print_1.debugPrint)('this.prevLevel: ' + this.prevLevel);
|
|
450
|
+
(0, print_1.debugPrint)(' this.level: ' + this.level);
|
|
451
|
+
(0, print_1.debugPrint)();
|
|
452
|
+
(0, print_1.debugPrint)(' HERE.... Should mount section to correct section at this.level: ' +
|
|
453
453
|
this.level);
|
|
454
454
|
//this.lastActiveSectionNameAtLevels[this.level - 1] = sectionName
|
|
455
|
-
(0,
|
|
456
|
-
(0,
|
|
455
|
+
(0, print_1.debugPrint)();
|
|
456
|
+
(0, print_1.debugPrint)('Resetted local result');
|
|
457
457
|
sectionName = '';
|
|
458
458
|
members = undefined;
|
|
459
459
|
}
|
|
460
460
|
//------------------------
|
|
461
|
-
(0,
|
|
461
|
+
(0, print_1.debugPrint)();
|
|
462
462
|
if ((0, env_1.isDebug)()) {
|
|
463
463
|
if (members) {
|
|
464
|
-
(0,
|
|
464
|
+
(0, print_1.printObject)({ [sectionName]: members });
|
|
465
465
|
this.lastActiveSectionAtLevels[this.level - 1] = Object.assign({}, members);
|
|
466
466
|
// this.lastActiveSectionNameAtLevels[this.level - 1] = sectionName
|
|
467
|
-
(0,
|
|
468
|
-
(0,
|
|
469
|
-
(0,
|
|
467
|
+
(0, print_1.debugPrint)('Mounted as assigned');
|
|
468
|
+
(0, print_1.debugPrint)(`lastActiveSectionAtLevels[${this.level - 1}]`);
|
|
469
|
+
(0, print_1.printObject)(this.lastActiveSectionAtLevels[this.level - 1]);
|
|
470
470
|
}
|
|
471
471
|
}
|
|
472
|
-
(0,
|
|
472
|
+
(0, print_1.debugPrint)('-----------------------');
|
|
473
473
|
if ((0, env_1.isDebug)()) {
|
|
474
474
|
console.log('At end of visitSection(..), this.lastActiveSectionNameAtLevels:');
|
|
475
|
-
(0,
|
|
476
|
-
(0,
|
|
477
|
-
(0,
|
|
478
|
-
(0,
|
|
479
|
-
(0,
|
|
480
|
-
(0,
|
|
475
|
+
(0, print_1.printObject)(this.lastActiveSectionNameAtLevels);
|
|
476
|
+
(0, print_1.debugPrint)(' this.level: ' + this.level);
|
|
477
|
+
(0, print_1.debugPrint)('this.prevLevel: ' + this.prevLevel);
|
|
478
|
+
(0, print_1.debugPrint)(' this.level: ' + this.level);
|
|
479
|
+
(0, print_1.debugPrint)('xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx');
|
|
480
|
+
(0, print_1.debugPrint)('xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx');
|
|
481
481
|
console.log();
|
|
482
482
|
}
|
|
483
|
-
(0,
|
|
483
|
+
(0, print_1.debugPrint)('<- Leaving visitSection(..)');
|
|
484
484
|
if ((0, env_1.isDebug)()) {
|
|
485
485
|
console.log('returning:');
|
|
486
486
|
console.log({
|
|
@@ -506,24 +506,24 @@ class YINIVisitor extends YiniParserVisitor_1.default {
|
|
|
506
506
|
// visitSection_members = (ctx: Section_membersContext): any => {
|
|
507
507
|
this.visitSection_members = (ctx) => {
|
|
508
508
|
(0, env_1.isDebug)() && console.log();
|
|
509
|
-
(0,
|
|
510
|
-
(0,
|
|
509
|
+
(0, print_1.debugPrint)('************************************************************');
|
|
510
|
+
(0, print_1.debugPrint)('-> Entered visitSection_members(..)');
|
|
511
511
|
const members = {};
|
|
512
|
-
(0,
|
|
512
|
+
(0, print_1.debugPrint)('Will loop through each member (or section head)...');
|
|
513
513
|
ctx.member_list().forEach((member) => {
|
|
514
514
|
const { type, key, value } = this.visitMember(member);
|
|
515
|
-
(0,
|
|
516
|
-
(0,
|
|
515
|
+
(0, print_1.debugPrint)('+++++++++++++++++++++++++++++++++++++++++++++++++++++');
|
|
516
|
+
(0, print_1.debugPrint)('* Item of member_list:');
|
|
517
517
|
if ((0, env_1.isDebug)()) {
|
|
518
518
|
console.log(value);
|
|
519
519
|
}
|
|
520
|
-
(0,
|
|
521
|
-
(0,
|
|
522
|
-
(0,
|
|
523
|
-
(0,
|
|
524
|
-
(0,
|
|
520
|
+
(0, print_1.debugPrint)(' type = >>>' + type + '<<<');
|
|
521
|
+
(0, print_1.debugPrint)(' key = >>>' + key + '<<<');
|
|
522
|
+
(0, print_1.debugPrint)('value = >>>' + value + '<<<');
|
|
523
|
+
(0, print_1.debugPrint)('value[key] = >>>' + (value === null || value === void 0 ? void 0 : value[key]) + '<<<');
|
|
524
|
+
(0, print_1.debugPrint)('--');
|
|
525
525
|
if (key === '') {
|
|
526
|
-
(0,
|
|
526
|
+
(0, print_1.debugPrint)('Skipping this member, due to key = ""');
|
|
527
527
|
}
|
|
528
528
|
else {
|
|
529
529
|
if (members[key] !== undefined) {
|
|
@@ -540,7 +540,7 @@ class YINIVisitor extends YiniParserVisitor_1.default {
|
|
|
540
540
|
else {
|
|
541
541
|
(0, env_1.isDebug)() && console.log();
|
|
542
542
|
// NOTE: (!) Only if nested section.
|
|
543
|
-
(0,
|
|
543
|
+
(0, print_1.debugPrint)('About to mount a single member or section onto members...');
|
|
544
544
|
(0, env_1.isDebug)() && console.log({ [key]: value });
|
|
545
545
|
// if ((type as TDataType) === 'Object') {
|
|
546
546
|
// const isExistingSectionName =
|
|
@@ -559,7 +559,7 @@ class YINIVisitor extends YiniParserVisitor_1.default {
|
|
|
559
559
|
// }
|
|
560
560
|
// }
|
|
561
561
|
Object.assign(members, { [key]: value });
|
|
562
|
-
(0,
|
|
562
|
+
(0, print_1.debugPrint)('+ Added member or section onto members: "' +
|
|
563
563
|
key +
|
|
564
564
|
'"');
|
|
565
565
|
}
|
|
@@ -567,17 +567,17 @@ class YINIVisitor extends YiniParserVisitor_1.default {
|
|
|
567
567
|
}
|
|
568
568
|
});
|
|
569
569
|
if ((0, env_1.isDebug)()) {
|
|
570
|
-
(0,
|
|
571
|
-
(0,
|
|
572
|
-
(0,
|
|
570
|
+
(0, print_1.debugPrint)('~~~ After mounting in visitSection_members(..) ~~~~~~~~~~');
|
|
571
|
+
(0, print_1.debugPrint)('this.resultSections:');
|
|
572
|
+
(0, print_1.debugPrint)('~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~');
|
|
573
573
|
}
|
|
574
574
|
//@todo handle member colon list
|
|
575
575
|
// ctx..member_colon_list().forEach((mcl) => {
|
|
576
576
|
// const { key, value } = this.visit(mcl)
|
|
577
577
|
// members[key] = value
|
|
578
578
|
// })
|
|
579
|
-
(0,
|
|
580
|
-
(0,
|
|
579
|
+
(0, print_1.debugPrint)();
|
|
580
|
+
(0, print_1.debugPrint)('<- Leaving visitSection_members(..)');
|
|
581
581
|
if ((0, env_1.isDebug)()) {
|
|
582
582
|
console.log('returning:');
|
|
583
583
|
console.log(members);
|
|
@@ -598,12 +598,12 @@ class YINIVisitor extends YiniParserVisitor_1.default {
|
|
|
598
598
|
this.visitMember = (ctx) => {
|
|
599
599
|
var _a, _b, _c, _d;
|
|
600
600
|
(0, env_1.isDebug)() && console.log();
|
|
601
|
-
(0,
|
|
602
|
-
(0,
|
|
603
|
-
(0,
|
|
601
|
+
(0, print_1.debugPrint)('-> Entered visitMember(..)');
|
|
602
|
+
(0, print_1.debugPrint)(' key = ' + ((_a = ctx.KEY()) === null || _a === void 0 ? void 0 : _a.getText().trim()));
|
|
603
|
+
(0, print_1.debugPrint)('Or, section head = ' +
|
|
604
604
|
((_b = ctx.SECTION_HEAD()) === null || _b === void 0 ? void 0 : _b.getText().trim()) +
|
|
605
605
|
' (head WITHOUT any members (ONLY detected here))');
|
|
606
|
-
(0,
|
|
606
|
+
(0, print_1.debugPrint)(' ctx.value() = ' + ctx.value());
|
|
607
607
|
// For logging and debugging purposes.
|
|
608
608
|
let entityType = 'Unknown';
|
|
609
609
|
let resultType = undefined;
|
|
@@ -617,7 +617,7 @@ class YINIVisitor extends YiniParserVisitor_1.default {
|
|
|
617
617
|
resultKey = ctx.KEY().getText();
|
|
618
618
|
}
|
|
619
619
|
catch (error) {
|
|
620
|
-
(0,
|
|
620
|
+
(0, print_1.debugPrint)('in catch..');
|
|
621
621
|
const msg = `Unexpected syntax while parsing a member (key-value pair)`;
|
|
622
622
|
// Note, after pushing processing may continue or exit, depending on the error and/or the bail threshold.
|
|
623
623
|
this.errorHandler.pushOrBail(ctx, 'Syntax-Error', msg);
|
|
@@ -627,18 +627,18 @@ class YINIVisitor extends YiniParserVisitor_1.default {
|
|
|
627
627
|
: null;
|
|
628
628
|
resultType = result === null || result === void 0 ? void 0 : result.type;
|
|
629
629
|
resultValue = result === null || result === void 0 ? void 0 : result.value;
|
|
630
|
-
(0,
|
|
631
|
-
(0,
|
|
630
|
+
(0, print_1.debugPrint)(' type = ' + resultType + ' @visitValue(..)');
|
|
631
|
+
(0, print_1.debugPrint)('value = ' + resultValue + ' @visitValue(..)');
|
|
632
632
|
}
|
|
633
633
|
else if ((_d = ctx.SECTION_HEAD()) === null || _d === void 0 ? void 0 : _d.getText().trim()) {
|
|
634
634
|
entityType = 'Section-Head';
|
|
635
635
|
//NOTE: There might be an issue here that some subsection gets missing!!
|
|
636
636
|
// const line = '' + ctx.SECTION_HEAD().getText().trim()
|
|
637
637
|
const line = ctx.SECTION_HEAD().getText().trim();
|
|
638
|
-
(0,
|
|
638
|
+
(0, print_1.debugPrint)('(!) Detected a section head instead: ' + line);
|
|
639
639
|
followingSection = this.visitSection(ctx);
|
|
640
640
|
// Object.assign(members, sectionObj)
|
|
641
|
-
(0,
|
|
641
|
+
(0, print_1.debugPrint)('Got constructed object of builtSection (visitSection(..):');
|
|
642
642
|
if ((0, env_1.isDebug)()) {
|
|
643
643
|
console.log(followingSection);
|
|
644
644
|
}
|
|
@@ -647,25 +647,25 @@ class YINIVisitor extends YiniParserVisitor_1.default {
|
|
|
647
647
|
// resultValue[nestedSection?.name] = nestedSection?.members
|
|
648
648
|
resultValue = (followingSection === null || followingSection === void 0 ? void 0 : followingSection.members) || {};
|
|
649
649
|
resultKey = followingSection.name;
|
|
650
|
-
(0,
|
|
651
|
-
(0,
|
|
650
|
+
(0, print_1.debugPrint)("resultKey = '" + resultKey + "'");
|
|
651
|
+
(0, print_1.debugPrint)('resultValue:');
|
|
652
652
|
if ((0, env_1.isDebug)()) {
|
|
653
|
-
(0,
|
|
653
|
+
(0, print_1.printObject)(resultValue);
|
|
654
654
|
}
|
|
655
|
-
(0,
|
|
655
|
+
(0, print_1.debugPrint)('Mounted/assigned a section onto resultValue...');
|
|
656
656
|
// Object.assign(value, { dummy: 6767 })
|
|
657
657
|
// Object.assign(resultValue, {
|
|
658
658
|
// dummy: 'That was detected a section head instead!',
|
|
659
659
|
// })
|
|
660
|
-
(0,
|
|
660
|
+
(0, print_1.debugPrint)();
|
|
661
661
|
}
|
|
662
|
-
(0,
|
|
663
|
-
(0,
|
|
664
|
-
(0,
|
|
665
|
-
(0,
|
|
662
|
+
(0, print_1.debugPrint)();
|
|
663
|
+
(0, print_1.debugPrint)("entity = '" + entityType + "'");
|
|
664
|
+
(0, print_1.debugPrint)("resultType = '" + resultType + "'");
|
|
665
|
+
(0, print_1.debugPrint)("resultKey = '" + resultKey + "'");
|
|
666
666
|
if (resultKey) {
|
|
667
|
-
(0,
|
|
668
|
-
(0,
|
|
667
|
+
(0, print_1.debugPrint)();
|
|
668
|
+
(0, print_1.debugPrint)('Has a key... Validate it either as a simple or a backticked ident...');
|
|
669
669
|
if ((0, string_1.isEnclosedInBackticks)(resultKey)) {
|
|
670
670
|
if (!(0, yiniHelpers_1.isValidBacktickedIdent)(resultKey)) {
|
|
671
671
|
this.errorHandler.pushOrBail(ctx, 'Syntax-Error', 'Invalid key name of this member, backticked key/identifier: "' +
|
|
@@ -673,7 +673,7 @@ class YINIVisitor extends YiniParserVisitor_1.default {
|
|
|
673
673
|
'"', 'Section name should be backticked like e.g. `My section name`.');
|
|
674
674
|
}
|
|
675
675
|
resultKey = (0, string_1.trimBackticks)(resultKey);
|
|
676
|
-
(0,
|
|
676
|
+
(0, print_1.debugPrint)("resultKey = '" + resultKey + "' (trimBackticks)");
|
|
677
677
|
}
|
|
678
678
|
else {
|
|
679
679
|
if (!(0, yiniHelpers_1.isValidSimpleIdent)(resultKey)) {
|
|
@@ -686,22 +686,22 @@ class YINIVisitor extends YiniParserVisitor_1.default {
|
|
|
686
686
|
}
|
|
687
687
|
}
|
|
688
688
|
if (resultValue === undefined) {
|
|
689
|
-
(0,
|
|
689
|
+
(0, print_1.debugPrint)('Detected value as undefined');
|
|
690
690
|
if (!this.isStrict) {
|
|
691
|
-
(0,
|
|
691
|
+
(0, print_1.debugPrint)('Overloading undefined value with null');
|
|
692
692
|
resultValue = null;
|
|
693
693
|
}
|
|
694
694
|
else {
|
|
695
695
|
this.errorHandler.pushOrBail(ctx, 'Syntax-Error', 'Encountered an empty/missing value in strict mode', 'Expected a value but found nothing, strict mode does not allow implicit null.', 'If you intend to have a null value, please specify "null" explicitly as the value.');
|
|
696
696
|
}
|
|
697
697
|
}
|
|
698
|
-
(0,
|
|
699
|
-
(0,
|
|
698
|
+
(0, print_1.debugPrint)('*** Constructed JS object ***');
|
|
699
|
+
(0, print_1.debugPrint)('resultValue:');
|
|
700
700
|
if ((0, env_1.isDebug)()) {
|
|
701
701
|
console.log(resultValue);
|
|
702
702
|
}
|
|
703
|
-
(0,
|
|
704
|
-
(0,
|
|
703
|
+
(0, print_1.debugPrint)();
|
|
704
|
+
(0, print_1.debugPrint)('<- About to leave visitMember(..)');
|
|
705
705
|
if ((0, env_1.isDebug)()) {
|
|
706
706
|
console.log('returning:');
|
|
707
707
|
console.log({
|
|
@@ -728,8 +728,8 @@ class YINIVisitor extends YiniParserVisitor_1.default {
|
|
|
728
728
|
// '`, `My key name`.',
|
|
729
729
|
// )
|
|
730
730
|
// }
|
|
731
|
-
(0,
|
|
732
|
-
(0,
|
|
731
|
+
(0, print_1.debugPrint)();
|
|
732
|
+
(0, print_1.debugPrint)('<- Leaving visitMember(..)');
|
|
733
733
|
if ((0, env_1.isDebug)()) {
|
|
734
734
|
console.log('returning:');
|
|
735
735
|
console.log({
|
|
@@ -753,7 +753,7 @@ class YINIVisitor extends YiniParserVisitor_1.default {
|
|
|
753
753
|
//visitMember_colon_list?: (ctx: Member_colon_listContext) => IResult
|
|
754
754
|
this.visitMember_colon_list = (ctx) => {
|
|
755
755
|
(0, env_1.isDebug)() && console.log();
|
|
756
|
-
(0,
|
|
756
|
+
(0, print_1.debugPrint)('-> Entered visitMember_colon_list(..)');
|
|
757
757
|
const key = ctx.KEY().getText();
|
|
758
758
|
const values = this.visit(ctx.elements());
|
|
759
759
|
return { key, value: values };
|
|
@@ -766,9 +766,9 @@ class YINIVisitor extends YiniParserVisitor_1.default {
|
|
|
766
766
|
// visitValue?: (ctx: ValueContext) => IResult
|
|
767
767
|
this.visitValue = (ctx) => {
|
|
768
768
|
(0, env_1.isDebug)() && console.log();
|
|
769
|
-
(0,
|
|
770
|
-
(0,
|
|
771
|
-
(0,
|
|
769
|
+
(0, print_1.debugPrint)('-> Entered visitValue(..)');
|
|
770
|
+
(0, print_1.debugPrint)('ctx.number_literal(): ' + ctx.number_literal());
|
|
771
|
+
(0, print_1.debugPrint)('ctx.boolean_literal(): ' + ctx.boolean_literal());
|
|
772
772
|
if (ctx.string_literal())
|
|
773
773
|
return this.visit(ctx.string_literal());
|
|
774
774
|
if (ctx.number_literal())
|
|
@@ -791,9 +791,9 @@ class YINIVisitor extends YiniParserVisitor_1.default {
|
|
|
791
791
|
*/
|
|
792
792
|
// visitString_literal?: (ctx: String_literalContext) => Result
|
|
793
793
|
this.visitString_literal = (ctx) => {
|
|
794
|
-
(0,
|
|
794
|
+
(0, print_1.debugPrint)('-> Entered visitString_literal(..)');
|
|
795
795
|
const raw = ctx.getText();
|
|
796
|
-
(0,
|
|
796
|
+
(0, print_1.debugPrint)('raw = >>>' + raw + '<<<');
|
|
797
797
|
const value = (0, parseString_1.default)(raw);
|
|
798
798
|
return { type: 'String', value };
|
|
799
799
|
};
|
|
@@ -804,7 +804,7 @@ class YINIVisitor extends YiniParserVisitor_1.default {
|
|
|
804
804
|
*/
|
|
805
805
|
// visitNumber_literal?: (ctx: Number_literalContext) => IResult
|
|
806
806
|
this.visitNumber_literal = (ctx) => {
|
|
807
|
-
(0,
|
|
807
|
+
(0, print_1.debugPrint)('-> Entered visitNumber_literal(..)');
|
|
808
808
|
const txt = ctx.getText();
|
|
809
809
|
const { type, value } = (0, parseNumber_1.default)(txt);
|
|
810
810
|
return { type, value };
|
|
@@ -816,7 +816,7 @@ class YINIVisitor extends YiniParserVisitor_1.default {
|
|
|
816
816
|
*/
|
|
817
817
|
//visitBoolean_literal?: (ctx: Boolean_literalContext) => IResult
|
|
818
818
|
this.visitBoolean_literal = (ctx) => {
|
|
819
|
-
(0,
|
|
819
|
+
(0, print_1.debugPrint)('-> Entered visitBoolean_literal(..)');
|
|
820
820
|
const txt = ctx.getText().toLowerCase();
|
|
821
821
|
// return ['true', 'yes', 'on'].includes(text) as IResult
|
|
822
822
|
const value = (0, parseBoolean_1.default)(txt);
|
|
@@ -828,7 +828,7 @@ class YINIVisitor extends YiniParserVisitor_1.default {
|
|
|
828
828
|
* @return the visitor result
|
|
829
829
|
*/
|
|
830
830
|
this.visitNull_literal = (ctx) => {
|
|
831
|
-
(0,
|
|
831
|
+
(0, print_1.debugPrint)('-> Entered visitNull_literal(..)');
|
|
832
832
|
const txt = ctx.getText();
|
|
833
833
|
const value = (0, parseNull_1.default)(txt);
|
|
834
834
|
return { type: 'Null', value };
|
|
@@ -884,18 +884,18 @@ class YINIVisitor extends YiniParserVisitor_1.default {
|
|
|
884
884
|
*/
|
|
885
885
|
// visitList_in_brackets?: (ctx: List_in_bracketsContext) => IResult
|
|
886
886
|
this.visitList_in_brackets = (ctx) => {
|
|
887
|
-
(0,
|
|
887
|
+
(0, print_1.debugPrint)('-> Entered visitList_in_brackets(..)');
|
|
888
888
|
let elements = [];
|
|
889
889
|
if (!ctx.elements()) {
|
|
890
|
-
(0,
|
|
890
|
+
(0, print_1.debugPrint)('Detected elements() is [], in list brackets');
|
|
891
891
|
// elements = []
|
|
892
892
|
return { type: 'List', value: [] };
|
|
893
893
|
}
|
|
894
894
|
else {
|
|
895
|
-
(0,
|
|
895
|
+
(0, print_1.debugPrint)('Detected elements() has items, in list brackets');
|
|
896
896
|
elements = this.visit(ctx.elements());
|
|
897
897
|
}
|
|
898
|
-
(0,
|
|
898
|
+
(0, print_1.debugPrint)('<- Leaving visitList_in_brackets(..)');
|
|
899
899
|
if ((0, env_1.isDebug)()) {
|
|
900
900
|
console.log('returning:');
|
|
901
901
|
console.log({ type: 'List', value: elements.value });
|
|
@@ -909,49 +909,49 @@ class YINIVisitor extends YiniParserVisitor_1.default {
|
|
|
909
909
|
* @return the visitor result
|
|
910
910
|
*/
|
|
911
911
|
this.visitElements = (ctx) => {
|
|
912
|
-
(0,
|
|
912
|
+
(0, print_1.debugPrint)('-> Entered visitElements(..)');
|
|
913
913
|
const firstElem = ctx.element();
|
|
914
914
|
let elements = [];
|
|
915
|
-
(0,
|
|
916
|
-
(0,
|
|
917
|
-
(0,
|
|
915
|
+
(0, print_1.debugPrint)(' element = ' + firstElem);
|
|
916
|
+
(0, print_1.debugPrint)(' element.getText() = ' + firstElem.getText());
|
|
917
|
+
(0, print_1.debugPrint)(' elements = ' + !!ctx.elements());
|
|
918
918
|
const resultElem = ctx.element()
|
|
919
919
|
? this.visitElement(ctx.element())
|
|
920
920
|
: null;
|
|
921
921
|
const resultTypeElem = resultElem === null || resultElem === void 0 ? void 0 : resultElem.type;
|
|
922
922
|
const resultValueElem = resultElem === null || resultElem === void 0 ? void 0 : resultElem.value;
|
|
923
|
-
(0,
|
|
924
|
-
(0,
|
|
923
|
+
(0, print_1.debugPrint)(' elem type = ' + resultTypeElem + ' @visitElements(..)');
|
|
924
|
+
(0, print_1.debugPrint)(' elem value = ' + resultValueElem + ' @visitElements(..)');
|
|
925
925
|
const resultElems = ctx.elements()
|
|
926
926
|
? this.visitElements(ctx.elements())
|
|
927
927
|
: null;
|
|
928
928
|
const resultTypeElems = resultElems === null || resultElems === void 0 ? void 0 : resultElems.type;
|
|
929
929
|
const resultValueElems = resultElems === null || resultElems === void 0 ? void 0 : resultElems.value;
|
|
930
|
-
(0,
|
|
930
|
+
(0, print_1.debugPrint)(' elems type = ' +
|
|
931
931
|
resultTypeElems +
|
|
932
932
|
' @visitElements(..)');
|
|
933
|
-
(0,
|
|
933
|
+
(0, print_1.debugPrint)(' elems value = ' +
|
|
934
934
|
resultValueElems +
|
|
935
935
|
' @visitElements(..)');
|
|
936
936
|
if (!ctx.elements()) {
|
|
937
|
-
(0,
|
|
937
|
+
(0, print_1.debugPrint)('In visitElements(..) detected that elements() has no elements');
|
|
938
938
|
elements = undefined;
|
|
939
939
|
}
|
|
940
940
|
else {
|
|
941
|
-
(0,
|
|
941
|
+
(0, print_1.debugPrint)('In visitElements(..) detected elements in elements()');
|
|
942
942
|
elements = this.visit(ctx.elements());
|
|
943
943
|
if ((0, env_1.isDebug)()) {
|
|
944
944
|
console.log('result of visited elements:');
|
|
945
|
-
(0,
|
|
945
|
+
(0, print_1.printObject)(elements);
|
|
946
946
|
}
|
|
947
947
|
}
|
|
948
948
|
const returnValues = elements
|
|
949
949
|
? [resultElem].concat(elements.value)
|
|
950
950
|
: [resultElem];
|
|
951
|
-
(0,
|
|
951
|
+
(0, print_1.debugPrint)('<- Leaving visitElements(..)');
|
|
952
952
|
if ((0, env_1.isDebug)()) {
|
|
953
953
|
console.log('returnValues:');
|
|
954
|
-
(0,
|
|
954
|
+
(0, print_1.printObject)(returnValues);
|
|
955
955
|
}
|
|
956
956
|
return {
|
|
957
957
|
type: 'List',
|
|
@@ -967,7 +967,7 @@ class YINIVisitor extends YiniParserVisitor_1.default {
|
|
|
967
967
|
// visitElement?: (ctx: ElementContext) => IResult
|
|
968
968
|
// visitElement = (ctx: ElementContext): IResult => {
|
|
969
969
|
this.visitElement = (ctx) => {
|
|
970
|
-
(0,
|
|
970
|
+
(0, print_1.debugPrint)('-> Entered visitElement(..)');
|
|
971
971
|
// if (ctx.value()) {
|
|
972
972
|
// return this.visit(ctx.value())
|
|
973
973
|
// } else {
|
|
@@ -980,10 +980,10 @@ class YINIVisitor extends YiniParserVisitor_1.default {
|
|
|
980
980
|
else {
|
|
981
981
|
result = { type: 'Null', value: null };
|
|
982
982
|
}
|
|
983
|
-
(0,
|
|
983
|
+
(0, print_1.debugPrint)('<- Leaving visitElement(..)');
|
|
984
984
|
if ((0, env_1.isDebug)()) {
|
|
985
985
|
console.log('returning:');
|
|
986
|
-
(0,
|
|
986
|
+
(0, print_1.printObject)(result);
|
|
987
987
|
console.log();
|
|
988
988
|
}
|
|
989
989
|
//return 'value'
|