-
Notifications
You must be signed in to change notification settings - Fork 0
/
EZjsonPlus_parse.js
675 lines (616 loc) · 21.6 KB
/
EZjsonPlus_parse.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
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
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
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
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
EZ.jsonPlus.parse = function JSON_parse(json, options)
{
options = EZ.options.call(options) //converts String delimited options to Object
/// options = EZ.options.call(JSON.plus.options.defaults.parse, options);
var rtnValue = new JSON.plus.rtnValue();
//______________________________________________________________________________________________
/**
*
*/
function returnParseValue() //returned value of parse or exception message
{ //as apparent type of value represented by json
var value = rtnValue.get('value', undefined);
var msg = rtnValue.get('syntaxError').concat(rtnValue.get('syntaxError'));
if (msg.length)
{
if (json.substr(0,1) == '{' || json.substr(-1) == ']}')
{ //for apparant Object, return syntaxError property
value = {message: msg.join('\n')}
}
else if (json.substr(0,1) == '[' && json.substr(-1) == ']')
{ //for apparant Array, return empty Array also
value = []; //with named property key: message
value.message = msg.join('\n');
value.json = json;
}
else //otherwise return exception message pinpointing
value = msg.join('\n'); //where parse failed if EZ.matchPlus() available
}
if (rtnValue.get('objname')) //if objName/variable specified, set to rtnValue
eval('"' + rtnValue.get('objname') + '=' + value + '"');
return value;
}
//=========================================================================================
//EZ.json.eval = null;
//EZ.json.fault = null;
//EZ.json.syntaxError = '';
//EZ.json.parse.message = '';
//EZ.json.parse.objname = '';
//EZ.json.parse.fragments = '';
//EZ.json.parse.details = true;
options.details = true; //more details returned for parse exceptions
json = json || '';
json = json.trim();
json = json.replace(/\\r/g, '\r');
json = json.replace(/\r\n/g, '\n').replace(/\r/g, '\n');
if (!json) //json empty
{
/// return EZ.json.eval = '';
rtnValue.addMessage('specified json empty string');
return returnParseValue();
}
json = json.replace(/^\s*(.*)\s*=\s*/, function(all,objname)
{
rtnValue.set('objname', objname);
// EZ.json.parse.objname = objname;
return ''; //remove "objname = ..." prefix if any
});
//------------------------\\
//----- eval full json -----\\
//----------------------------\\
try
{
var value = eval('value=' + json);
rtnValue.set('value', value);
return returnParseValue(); //good to go if no exception
}
catch (e)
{
rtnValue.addMessage(e.message);
rtnValue.set('syntaxError', e);
// EZ.json.fault = EZ.techSupport(e, '$', arguments); //get fault Object
// EZ.json.syntaxError = EZ.json.parse.message = e.message;
}
if (EZ.matchPlus === undefined) //bail if EZ.matchPlus() NOT avail
return returnParseValue();
//return EZ.json.parse.message;
//--------------------------------------------------------\\
//----- eval json in fragments to isolate syntax error -----\\
//------------------------------------------------------------\\
var idx,
msg = '',
script = '';
EZ.trace(json);
//----- create shadow json with quoted strings neutered (except Object keys)
var jsonShadow = json.replace(/(\\['"])/g, '@@'); //esc embedded quotes e.g. \" --> @@
jsonShadow = jsonShadow.replace(/(['"])(.*?)\1(\s*)(\:?)/g,
function(all, quote, inner, spaces, colon) //replace all quoted strings
{ //with #...# e.g. "abc" --> "###"
if (colon) return all; //except Object keys
return quote + '@'.dup(inner.length) + quote + spaces;
});
//----- also neuter "forEach(function(...){...});" to avoid parsing as fragments
jsonShadow = jsonShadow.replace(/(forEach\()([\s\S]*?\}.*\n)/g, function(all,prefix,fn)
{
return prefix + '@'.dup(fn.length);
});
/*___________________________________________________________________________________
//
// SAMPLE JSON before pre-processing nueters quoted Strings and some anounmous
// functions to simplify parsing into fragments and fragment items.
//___________________________________________________________________________________
{
guess: 123,
fn: (function()
{
var ____properties____ = {
color: "green",
array: [1, 2, "red", true]
};
Object.keys(____properties____).forEach(function(key)
{____function____[key] = ____properties____[key]})
return ____function____;
})()
}
-------------------------------------------------------------------------------------------
OPEN FRAGMENT OFFSETS
-------------------------------------------------------------------------------------------
offsets: 0:[0,1], 1:[18,43], 2:[44,74], 3:[75,95]
[0]: {
[1]: .... fn:. (function() .... {
[2]: .... var. ____properties____. =. {
[3]: .[12]. array:. [
-------------------------------------------------------------------------------------------
CLOSE FRAGMENT OFFSETS
-------------------------------------------------------------------------------------------
offsets: 0:[75,100], 1:[101,111], 2:[265,273], 3:[274,275]
[0]: array: [1, 2]
[1]: };
[2]: })()
[3]:}
-------------------------------------------------------------------------------------------
// SAMPLE NUETERED DATA - embedded quotes and forEach converted to @ for parsing
// start of fragments marked as -->>...<-- end of fragments marked as --<<...<--
-------------------------------------------------------------------------------------------
__
| \................................fragment #0
| -->>
| {<--
| | guess: 123,
| |_________________________________openOffsets[0] = openResults.end[0] = 1
| ________
| | -->>\........................fragment #1
| | fn: (function()
| | {<--
| | |_____________________________openOffsets[1] = openResults.end[1] = 43
| | __________________________
| | | -->>\.....fragment #2
| | | var ____properties____ = {<--
| | | |____openOffsets[2] = openResults.end[2] = 74
| | |
| | | ________..............fragment #3
| | | | \ ___________openOffsets[3] = openResults.end[0] = 95
| | | | \ | _______closeOffsets[3] = closeResults.end[0] = 100 - 1 = 99
| | | | -->> <--|
| | | | array: [1, 2]
| | | | <<-- <-- end - marker size
| | | |_______________/
| | | __________________________closeOffsets[2] = (closeResults.end[1] = 111) - 2 = 109
| | | |
| | | <<--};<--
| | |_______/
| | Object.keys(____properties____).forEach
| | return ____function____;
| | <<--})()<--
| |________/
| |______________________________closeOffsets[1] = (closeResults.end[2] = 273) - 4 = 269
| <<--
| }<--
| |_________________________________closeOffsets[0] = (closeResults.end[3] = 275) - 1 = 274
|___/
*/
var begWrapPattern = RegExp( "(\\n\\s*)?" //prefix from line where marker starts
+ "(" //open marker -- if function...
+ "(\\(\\s*function||function)" //optional closure & fn statement
+ "\\s*[\\w]*\\([^(]*\\)" //optional fn name & (named args)
+ "[\\s\\S]*?\\{" //optional comment & start of body
+ "|\\{" //...or Object
+ "|\\[" //...or Array
+ ")" //end of open marker
+ "(\\s*?\\n?)", //optional spaces up to optional newline
"g");
var endWrapPattern = RegExp( "(.*)" //prefix from line where close marker starts
+ "(" //start of close marker
+ "\\}\\)\\(\\)" //end of optional closure -- TODO: expand
+ "|\\}|\\];?" //end of fn, object, array
+ ")" //end of close marker
+ "(\\s*?\\n*)", //optional spaces up to optional newline
"g");
var itemPatterns = {
"[": /(\s*)(())?(([^,]*)\s*)(,?\n?)/, //array -- value [,\n]
"{": /(\s*)(([^:]*)[:]\s*)(([^,]*)\s*)(,?\n?)/, //object -- key: value [,\n]
"(": /(\s*)(())((.*?);?)(\n?)$/m //function -- single lines .*[;]$
}
itemPatterns[')'] = itemPatterns['('];
var begWrappers =
{ //use for eval if defined
'{': 'EZ.obj={\n' //Object
}
var endWrappers = {
'[': ']', //Array
'{': '\n}', //Object
')': '\n}', //function...
'(': '\n})' //(function...)
}
//-----------------------------------------------\\
//----- find all start / end fragment markers -----\\
//---------------------------------------------------\\
var openTypes = [],
openOffsets = [],
closeOffsets = [],
openResults = jsonShadow.matchPlus(begWrapPattern),
closeResults = jsonShadow.matchPlus(endWrapPattern);
idx = 0;
jsonShadow.replace(begWrapPattern, function(all, prefix, marker, fn, eol)
{
var type = !fn ? marker
: marker.substr(0,1) == '(' ? '('
: ')';
var offset = openResults.end[idx] + eol.length - (eol ? 1 : 0);
openResults[idx++] = marker + eol;
openTypes.push(type);
openOffsets.push(offset);
});
idx = 0;
jsonShadow.replace(endWrapPattern, function(all,prefix,marker, eol)
{
closeResults[idx] = marker + eol; //?? prefix offsets may handle
closeOffsets.push(closeResults.end[idx] - marker.length - 1);
idx++;
});
//--------------------------------------------------------\\
//----- reorder closeOffsets to align with openOffsets -----\\
//------------------------------------------------------------\\
openOffsets.forEach(function(begOffset,idx)
{
var begOffset = openOffsets[idx];
var endOffset = jsonShadow.length;
for (var i=idx; i<closeOffsets.length; i++)
{
for (var j=i+1; j<openOffsets.length; j++)
{
if (openOffsets[j] > closeOffsets[i])
break;
}
if (j == i+1)
break;
}
if (i < closeOffsets.length)
{ //swap closeOffsets
endOffset = closeOffsets.splice(i,1)[0];
closeOffsets.splice(idx,0,endOffset);
var endWrap = closeResults.splice(i,1)[0];
closeResults.splice(idx,0,endWrap);
}
msg = '\n' + '-'.dup(50)
+ '\nfragment #' + (idx + 1)
+ ' offsets: [' + begOffset + ',' +endOffset + ']'
+ '\n' + '-'.dup(50)
+ '\n-->>' + openResults[idx].replace(/([\s\S*?])(\n)/, '$1<--$2')
+ jsonShadow.substring(begOffset, endOffset)
+ '<<--' + closeResults[idx] + '<--';
rtnValue.addListItem('fragments', msg);
});
openResults.push(''); //fake for idx+1 references
openOffsets.push(jsonShadow.length);
// EZ.trace('FRAGMENTS', msg.substr(1));
options.details = false;
//------------------------------\\
//----- parse outer fragment -----\\
//----------------------------------\\
idx = 0;
var offset = 0;
jsonFragment();
if (!msg && json.substr(offset)) //any remaining json is unexpected
{
msg = 'following unexpected';
//out of scope function call
//jsonAppend('=', '@@@error@@@', '@@@good@@@');
//script += '@@@error@@@' + json.substr(offset);
//offset += json.substr(offset).length;
}
if (msg) //add to exception from full json eval
{
EZ.json.message += '\nmore detail below...'
//------------------------------\\
//----- format error message -----\\
//----------------------------------\\
if (msg.substr(-1) != '\n') msg += '\n';
script = script.replace(/([\s\S]*\n)?([\s\S]*)@@@error@@@([\s\S]*)@@@good@@@(.*)(\n?)/,
function(all, linesBeforeBad, codeBeforeBad, bad, codeAfterBad)
{
linesBeforeBad = linesBeforeBad || '';
var indent = Math.max(0,codeBeforeBad.length - 1);
var indentBad = Math.max(0,indent + bad.length - 1);
bad.replace(/[\s\S]*\n(.*)/, function(all, bad /*last line of bad*/)
{
indentBad = Math.max(0,bad.length - 1);
});
all = linesBeforeBad
+ (linesBeforeBad ? '='.dup(50) : '') // ~~~~~~~~~~~~~~~~~~~~~~
+ '\n...' + msg + '' // ...msg
+ '_'.dup(indent) + '\n' // _______
+ ' '.dup(indent) + '\\\n' // \
+ codeBeforeBad + bad + codeAfterBad // before bad...after
+ '\n' + '_'.dup(indentBad+1) + '/\n' // _____________/
+ '...end of json parse\n' // ...end of parse
+ '='.dup(50) + '\n'; // ~~~~~~~~~~~~~~~~~~~~~~
return all;
});
}
script += json.substr(offset);
EZ.trace('SCRIPT returned', script);
//=============================================================
EZ.json.message = 'SyntaxError: ' + EZ.json.message
+ '\n'
+ '-'.dup(50) + '\n'
+ script;
return null;
//=============================================================
//_______________________________________________________________________________
/**
* recursively called for each json fragment until SyntaxError occurs.
*/
function jsonFragment(depth/*lastBegWrap, lastEndWrap, lastType*/)
{
depth = depth || 0;
if (idx >= openOffsets.length) return; //no more fragment markers
var item,
begWrap = openResults[idx],
endWrap = closeResults[idx],
begOffset = openOffsets[idx],
endOffset = closeOffsets[idx],
type = openTypes[idx],
begWrapType = begWrappers[type] || begWrap,
endWrapType = endWrappers[type],
fragmentItems = '';
jsonAppend(begWrap, '-->>', '<--');
offset = begOffset;
fragmentItems = begWrapType; //reset fragmentItems
//--------------------------------\\
//----- for each fragment item -----\\
//------------------------------------\\
var thisFragment = '';
var itemPattern = itemPatterns[type];
var count = jsonShadow.matchPlus(/(function|\]|\})/g).length;
do
{
//_______________________________________________________________________________
//
// EXAMPLE: items marked as #>...#< -- item separators as ^...^
// keys (or closure variable assignments) marked as !...!
//_______________________________________________________________________________
/*
-->>{<--
#>!guess: !"neutered quotes@red@"<#,
#>!fn: !>>(function()
-->>{<--
#>!var ____properties____ = !-->>{<--#>!
color: !"red"<#^,
^#>!array: !-->>[<--#>1<#^, ^#>2<#--<<]<--
--<<};<--
#>Object.keys(____properties____).forEach@@@@@@@@@
#>return ____function____;<#
--<<})()<--<#
--<<}<--
*/
var nextFragment = openOffsets[idx+1] - openResults[idx+1].length;
thisFragment = jsonShadow.substring(offset, Math.min(nextFragment, endOffset));
if (!thisFragment.length)
break;
var groups = "prefix, keyGroup, key, valueGroup, value, itemSep";
var results = thisFragment.matchPlus(itemPattern, groups);
if (!results.isFound) break;
results.start.forEach(function(start,idx)
{ //get un-neutered json results
item = json.substr(offset+start, results[idx].length);
results.set(results.keys[idx], item);thisFragment
});
//fragmentItems += results.prefix;
jsonAppend(results.prefix, '#>');
if (!results.keyGroup && !results.valueGroup)
{
jsonAppend(results.itemSep, '^', '^');
continue;
}
try
{
item = results.keyGroup + results.valueGroup;
if (type != '[' && item.substr(0,1) == '}')
{ //end of function or object
jsonAppend(item);
break;
}
if (type == '[' && results.key)
msg = 'name unexpected';
else if (type == '{' && !results.key)
msg = 'name required';
else
{
if (type == '{') //process key for Object
{
item = results.key;
eval('"' + results.key.trim().trimPlus('"') + '"');
jsonAppend(results.keyGroup, '!', '!')
item = results.valueGroup;
}
if (offset + item.length >= nextFragment)
{ //value is next fragment e.g. [...] or {...}
jsonAppend(item); //append json up to nextFragment
idx++;
item = jsonFragment(depth+1);
if (msg) return;
fragmentItems += item; //append json returned from fragment(s)
EZ.trace('fragmentItems return depth='+ depth, fragmentItems + endWrapType);
}
else
{
item = results.valueGroup;
eval(fragmentItems + item + endWrapType);
jsonAppend(item) //append valueGroup
}
if (options.details) script += '<#';
jsonAppend(results.itemSep, '^', '^');
}
if (options.details) script += '<#';
}
catch (e) //SyntaxError
{
msg = e.message; //...set error message
console.log(e.stack.replace(/([\s\S]*?\))[\s\S]*/,'$1'))
item = item.trim();
}
if (!msg) continue;
// add message to script and break
//var padding = Math.max(0,script.length - script.lastIndexOf('\n') - 1);
jsonAppend(item, '@@@error@@@', '@@@good@@@');
json.substr(offset).replace(/.*\n/, function(all)
{
jsonAppend(all);
return all;
})
break;
}
while (count-- > 0) //safety for unexpected endless loop
if (msg || thisFragment.trim()) return;
if (!endWrap)
{
msg = 'expected: ' + endWrapType;
jsonAppend('', '@@@error@@@', '@@@good@@@');
}
else //append end of fragment wrapper and
{ //replace begWrapType with real begWrap
jsonAppend(endWrap, '<<--', '<--');
var regex = RegExp(begWrapType.replace(/([\[{(])/g,'\\$1'));
return fragmentItems.replace(regex, begWrap);
}
//_______________________________________________________________________________
/**
* Append un-neutered json to script and fragmentItems from current offset
* corresponding to code (i.e. code.length). Annotate with prefix and suffix if
* specified and starts with "@@@" or options.details is true.
*/
function jsonAppend(code, prefix, suffix)
{
code = code || '';
prefix = prefix || '';
suffix = suffix || '';
if (!options.details && prefix.indexOf('@@@') !== 0)
prefix = suffix = '';
if (!code && !prefix && !suffix) return;
fragmentItems += code;
if (prefix == '<<--' || prefix == '-->>') //complex annotate
script += annotate(code, prefix, suffix);
else //simple annotate
script += prefix + json.substr(offset, code.length) + suffix;
offset += code.length;
EZ.trace('fragmentItems depth='+ depth, fragmentItems + endWrapType);
EZ.trace('SCRIPT: ' + code, script);
}
/**
* returns annotated fragment marker
*/
function annotate(code, prefix, suffix)
{
return code.replace(/(\s*)([\s\S]*?)(\n?)$/,
function(all,before,marker,after)
{
before = before.endsWith('\n') || !before.length ? prefix + '\n'
: before.substr(-4) + prefix
return before + marker + suffix + after;
});
}
}
}
/*--------------------------------------------------------------------------------------------------
--------------------------------------------------------------------------------------------------*/
EZ.jsonPlus.parse.test = function JSON_parse_test()
{
var msg, arr, ctx, arg, args, o, obj, json, note='', ex, exfn, notefn, fn, val, rtnValue;
/* jshint: avoid unused variable error */
e = [msg, arr, ctx, arg, args, o, obj, json, note='', ex, exfn, notefn, fn, val, , rtnValue];
ex = note = undefined;
// . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
//============================================================================================
function setupTest()
{
if (!EZ.test.isRun()) //test IS skipped
return;
json = JSON.stringify(ex, null, 4)
note += '<p>native JSON:<br>' + json.replace(/\n/g, '<br>').replace(/ /g, ' ')
json = EZ.stringify(ex, '*all');
// EZ.test.options(opts)
}
//============================================================================================
//EZ.test.settings( {exfn:exfn} );
var json = '';
var opts = '*NAN, *UNDEFINED, *FUNCTION'; //NA
//============================================================================================
//______________________________________________________________________________
ex = {
a:1, b:2
};
note = 'easy'
setupTest();
EZ.test.run(json, opts, {EZ: {ex:ex, note:note}})
//_______________________________________________________________________________
EZ.test.settings( {group:'live faults'} );
//EZ.test.settings({group: 'persistant note'});
//EZ.test.settings( {exfn:exfn} ) //exfn called if EZ.test.options() not called
obj =
[
''
+ '{\n'
+ ' ok: true,\n'
+ ' testno: 1,\n'
+ ' used: true\n'
+ '}'
+ '',
''
+ '{\n'
+ ' ok: true,\n'
+ ' testno: 2,\n'
+ ' used: true\n'
+ '}'
]
json = EZ.jsonPlus.stringify(obj)
EZ.test.run(obj)
// . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
obj = [
{
ok: true,
testno: 1,
warn: "",
actual: {
0: {
a: 1,
b: 2
},
1: {
a: 0,
b: ""
},
2: [
"1st [Object] \t ... 2nd [Object]",
" .a: 1 \t !== 0",
],
results: false
},
expected: {
2: [
"@JSON_escapeMarker@:$.expected.2=$.actual.2"
],
results: false
},
saveDateTime: "11-23-2016 06:52:18 pm",
used: true
},
''
+ '{\n'
+ ' ok: true,\n'
+ ' testno: 2,\n'
+ ' warn: "",\n'
+ ' actual: {\n'
+ ' 0: {\n'
+ ' a: 1,\n'
+ ' b: 2\n'
+ ' },\n'
+ ' 1: {\n'
+ ' a: 0,\n'
+ ' b: ""\n'
+ ' },\n'
+ ' 2: [\n'
+ ' "1st [Object] \\t .. 2nd [Object]",\n'
+ ' " .a: 1 \\t is 0",\n'
+ ' ],\n'
+ ' results: false\n'
+ ' },\n'
+ ' expected: {\n'
+ ' 2: [\n'
+ ' "@JSON_escapeMarker@:$.expected.2=$.actual.2"\n'
+ ' ],\n'
+ ' results: false\n'
+ ' },\n'
+ ' saveDateTime: "11-23-2016 07:30:12 pm",\n'
+ ' used: true\n'
+ '}'
]
json = EZ.jsonPlus.stringify(obj)
EZ.test.run(obj)
// . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
// . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
//_______________________________________________________________________________________
//EZ.test.options( {ex:ex, note:note} )
//EZ.test.run( ctx, arg, obj )
if (true) return;
}