awv3
Version:
⚡ AWV3 embedded CAD
1,701 lines (1,700 loc) • 168 kB
JSON
{
"type": "Program",
"body": [
{
"type": "ImportDeclaration",
"specifiers": [
{
"type": "ImportDefaultSpecifier",
"local": {
"type": "Identifier",
"name": "Ccref",
"range": [
7,
12
],
"loc": {
"start": {
"line": 1,
"column": 7
},
"end": {
"line": 1,
"column": 12
}
}
},
"range": [
7,
12
],
"loc": {
"start": {
"line": 1,
"column": 7
},
"end": {
"line": 1,
"column": 12
}
}
}
],
"source": {
"type": "Literal",
"value": "../sketcher/ccref",
"raw": "'../sketcher/ccref'",
"range": [
18,
37
],
"loc": {
"start": {
"line": 1,
"column": 18
},
"end": {
"line": 1,
"column": 37
}
}
},
"range": [
0,
38
],
"loc": {
"start": {
"line": 1,
"column": 0
},
"end": {
"line": 1,
"column": 38
}
}
},
{
"type": "ImportDeclaration",
"specifiers": [
{
"type": "ImportDefaultSpecifier",
"local": {
"type": "Identifier",
"name": "Statements",
"range": [
46,
56
],
"loc": {
"start": {
"line": 2,
"column": 7
},
"end": {
"line": 2,
"column": 17
}
}
},
"range": [
46,
56
],
"loc": {
"start": {
"line": 2,
"column": 7
},
"end": {
"line": 2,
"column": 17
}
}
}
],
"source": {
"type": "Literal",
"value": "../sketcher/statements",
"raw": "'../sketcher/statements'",
"range": [
62,
86
],
"loc": {
"start": {
"line": 2,
"column": 23
},
"end": {
"line": 2,
"column": 47
}
}
},
"range": [
39,
87
],
"loc": {
"start": {
"line": 2,
"column": 0
},
"end": {
"line": 2,
"column": 48
}
}
},
{
"type": "ImportDeclaration",
"specifiers": [
{
"type": "ImportNamespaceSpecifier",
"local": {
"type": "Identifier",
"name": "THREE",
"range": [
100,
105
],
"loc": {
"start": {
"line": 3,
"column": 12
},
"end": {
"line": 3,
"column": 17
}
}
},
"range": [
95,
105
],
"loc": {
"start": {
"line": 3,
"column": 7
},
"end": {
"line": 3,
"column": 17
}
}
}
],
"source": {
"type": "Literal",
"value": "three",
"raw": "'three'",
"range": [
111,
118
],
"loc": {
"start": {
"line": 3,
"column": 23
},
"end": {
"line": 3,
"column": 30
}
}
},
"range": [
88,
119
],
"loc": {
"start": {
"line": 3,
"column": 0
},
"end": {
"line": 3,
"column": 31
}
}
},
{
"type": "FunctionDeclaration",
"id": {
"type": "Identifier",
"name": "formatValue",
"range": [
130,
141
],
"loc": {
"start": {
"line": 5,
"column": 9
},
"end": {
"line": 5,
"column": 20
}
}
},
"params": [
{
"type": "Identifier",
"name": "x",
"range": [
142,
143
],
"loc": {
"start": {
"line": 5,
"column": 21
},
"end": {
"line": 5,
"column": 22
}
}
}
],
"body": {
"type": "BlockStatement",
"body": [
{
"type": "SwitchStatement",
"discriminant": {
"type": "Identifier",
"name": "x",
"range": [
159,
160
],
"loc": {
"start": {
"line": 6,
"column": 12
},
"end": {
"line": 6,
"column": 13
}
}
},
"cases": [
{
"type": "SwitchCase",
"test": {
"type": "Identifier",
"name": "undefined",
"range": [
177,
186
],
"loc": {
"start": {
"line": 7,
"column": 13
},
"end": {
"line": 7,
"column": 22
}
}
},
"consequent": [],
"range": [
172,
187
],
"loc": {
"start": {
"line": 7,
"column": 8
},
"end": {
"line": 7,
"column": 23
}
}
},
{
"type": "SwitchCase",
"test": {
"type": "Literal",
"value": null,
"raw": "null",
"range": [
201,
205
],
"loc": {
"start": {
"line": 8,
"column": 13
},
"end": {
"line": 8,
"column": 17
}
}
},
"consequent": [
{
"type": "ReturnStatement",
"argument": {
"type": "Literal",
"value": "VOID",
"raw": "\"VOID\"",
"range": [
214,
220
],
"loc": {
"start": {
"line": 8,
"column": 26
},
"end": {
"line": 8,
"column": 32
}
}
},
"range": [
207,
221
],
"loc": {
"start": {
"line": 8,
"column": 19
},
"end": {
"line": 8,
"column": 33
}
}
}
],
"range": [
196,
221
],
"loc": {
"start": {
"line": 8,
"column": 8
},
"end": {
"line": 8,
"column": 33
}
}
},
{
"type": "SwitchCase",
"test": {
"type": "Literal",
"value": false,
"raw": "false",
"range": [
235,
240
],
"loc": {
"start": {
"line": 9,
"column": 13
},
"end": {
"line": 9,
"column": 18
}
}
},
"consequent": [
{
"type": "ReturnStatement",
"argument": {
"type": "Literal",
"value": "FALSE",
"raw": "\"FALSE\"",
"range": [
249,
256
],
"loc": {
"start": {
"line": 9,
"column": 27
},
"end": {
"line": 9,
"column": 34
}
}
},
"range": [
242,
257
],
"loc": {
"start": {
"line": 9,
"column": 20
},
"end": {
"line": 9,
"column": 35
}
}
}
],
"range": [
230,
257
],
"loc": {
"start": {
"line": 9,
"column": 8
},
"end": {
"line": 9,
"column": 35
}
}
},
{
"type": "SwitchCase",
"test": {
"type": "Literal",
"value": true,
"raw": "true",
"range": [
271,
275
],
"loc": {
"start": {
"line": 10,
"column": 13
},
"end": {
"line": 10,
"column": 17
}
}
},
"consequent": [
{
"type": "ReturnStatement",
"argument": {
"type": "Literal",
"value": "TRUE",
"raw": "\"TRUE\"",
"range": [
284,
290
],
"loc": {
"start": {
"line": 10,
"column": 26
},
"end": {
"line": 10,
"column": 32
}
}
},
"range": [
277,
291
],
"loc": {
"start": {
"line": 10,
"column": 19
},
"end": {
"line": 10,
"column": 33
}
}
}
],
"range": [
266,
291
],
"loc": {
"start": {
"line": 10,
"column": 8
},
"end": {
"line": 10,
"column": 33
}
}
}
],
"range": [
151,
297
],
"loc": {
"start": {
"line": 6,
"column": 4
},
"end": {
"line": 11,
"column": 5
}
}
},
{
"type": "SwitchStatement",
"discriminant": {
"type": "UnaryExpression",
"operator": "typeof",
"argument": {
"type": "Identifier",
"name": "x",
"range": [
317,
318
],
"loc": {
"start": {
"line": 12,
"column": 19
},
"end": {
"line": 12,
"column": 20
}
}
},
"prefix": true,
"range": [
310,
318
],
"loc": {
"start": {
"line": 12,
"column": 12
},
"end": {
"line": 12,
"column": 20
}
}
},
"cases": [
{
"type": "SwitchCase",
"test": {
"type": "Literal",
"value": "string",
"raw": "'string'",
"range": [
335,
343
],
"loc": {
"start": {
"line": 13,
"column": 13
},
"end": {
"line": 13,
"column": 21
}
}
},
"consequent": [],
"range": [
330,
344
],
"loc": {
"start": {
"line": 13,
"column": 8
},
"end": {
"line": 13,
"column": 22
}
}
},
{
"type": "SwitchCase",
"test": {
"type": "Literal",
"value": "number",
"raw": "'number'",
"range": [
358,
366
],
"loc": {
"start": {
"line": 14,
"column": 13
},
"end": {
"line": 14,
"column": 21
}
}
},
"consequent": [
{
"type": "ReturnStatement",
"argument": {
"type": "CallExpression",
"callee": {
"type": "MemberExpression",
"computed": false,
"object": {
"type": "Identifier",
"name": "JSON",
"range": [
375,
379
],
"loc": {
"start": {
"line": 14,
"column": 30
},
"end": {
"line": 14,
"column": 34
}
}
},
"property": {
"type": "Identifier",
"name": "stringify",
"range": [
380,
389
],
"loc": {
"start": {
"line": 14,
"column": 35
},
"end": {
"line": 14,
"column": 44
}
}
},
"range": [
375,
389
],
"loc": {
"start": {
"line": 14,
"column": 30
},
"end": {
"line": 14,
"column": 44
}
}
},
"arguments": [
{
"type": "Identifier",
"name": "x",
"range": [
390,
391
],
"loc": {
"start": {
"line": 14,
"column": 45
},
"end": {
"line": 14,
"column": 46
}
}
}
],
"range": [
375,
392
],
"loc": {
"start": {
"line": 14,
"column": 30
},
"end": {
"line": 14,
"column": 47
}
}
},
"range": [
368,
393
],
"loc": {
"start": {
"line": 14,
"column": 23
},
"end": {
"line": 14,
"column": 48
}
}
}
],
"range": [
353,
393
],
"loc": {
"start": {
"line": 14,
"column": 8
},
"end": {
"line": 14,
"column": 48
}
}
}
],
"range": [
302,
399
],
"loc": {
"start": {
"line": 12,
"column": 4
},
"end": {
"line": 15,
"column": 5
}
}
},
{
"type": "IfStatement",
"test": {
"type": "BinaryExpression",
"operator": "instanceof",
"left": {
"type": "Identifier",
"name": "x",
"range": [
408,
409
],
"loc": {
"start": {
"line": 16,
"column": 8
},
"end": {
"line": 16,
"column": 9
}
}
},
"right": {
"type": "Identifier",
"name": "Array",
"range": [
421,
426
],
"loc": {
"start": {
"line": 16,
"column": 21
},
"end": {
"line": 16,
"column": 26
}
}
},
"range": [
408,
426
],
"loc": {
"start": {
"line": 16,
"column": 8
},
"end": {
"line": 16,
"column": 26
}
}
},
"consequent": {
"type": "ReturnStatement",
"argument": {
"type": "BinaryExpression",
"operator": "+",
"left": {
"type": "BinaryExpression",
"operator": "+",
"left": {
"type": "Literal",
"value": "[",
"raw": "'['",
"range": [
443,
446
],
"loc": {
"start": {
"line": 17,
"column": 15
},
"end": {
"line": 17,
"column": 18
}
}
},
"right": {
"type": "CallExpression",
"callee": {
"type": "MemberExpression",
"computed": false,
"object": {
"type": "CallExpression",
"callee": {
"type": "MemberExpression",
"computed": false,
"object": {
"type": "Identifier",
"name": "x",
"range": [
449,
450
],
"loc": {
"start": {
"line": 17,
"column": 21
},
"end": {
"line": 17,
"column": 22
}
}
},
"property": {
"type": "Identifier",
"name": "map",
"range": [
451,
454
],
"loc": {
"start": {
"line": 17,
"column": 23
},
"end": {
"line": 17,
"column": 26
}
}
},
"range": [
449,
454
],
"loc": {
"start": {
"line": 17,
"column": 21
},
"end": {
"line": 17,
"column": 26
}
}
},
"arguments": [
{
"type": "Identifier",
"name": "formatValue",
"range": [
455,
466
],
"loc": {
"start": {
"line": 17,
"column": 27
},
"end": {
"line": 17,
"column": 38
}
}
}
],
"range": [
449,
467
],
"loc": {
"start": {
"line": 17,
"column": 21
},
"end": {
"line": 17,
"column": 39
}
}
},
"property": {
"type": "Identifier",
"name": "join",
"range": [
468,
472
],
"loc": {
"start": {
"line": 17,
"column": 40
},
"end": {
"line": 17,
"column": 44
}
}
},
"range": [
449,
472
],
"loc": {
"start": {
"line": 17,
"column": 21
},
"end": {
"line": 17,
"column": 44
}
}
},
"arguments": [
{
"type": "Literal",
"value": ", ",
"raw": "', '",
"range": [
473,
477
],
"loc": {
"start": {
"line": 17,
"column": 45
},
"end": {
"line": 17,
"column": 49
}
}
}
],
"range": [
449,
478
],
"loc": {
"start": {
"line": 17,
"column": 21
},
"end": {
"line": 17,
"column": 50
}
}
},
"range": [
443,
478
],
"loc": {
"start": {
"line": 17,
"column": 15
},
"end": {
"line": 17,
"column": 50
}
}
},
"right": {
"type": "Literal",
"value": "]",
"raw": "']'",
"range": [
481,
484
],
"loc": {
"start": {
"line": 17,
"column": 53
},
"end": {
"line": 17,
"column": 56
}
}
},
"range": [
443,
484
],
"loc": {
"start": {
"line": 17,
"column": 15
},
"end": {
"line": 17,
"column": 56
}
}
},
"range": [
436,
485
],
"loc": {
"start": {
"line": 17,
"column": 8
},
"end": {
"line": 17,
"column": 57
}
}
},
"alternate": {
"type": "IfStatement",
"test": {
"type": "BinaryExpression",
"operator": "instanceof",
"left": {
"type": "Identifier",
"name": "x",
"range": [
499,
500
],
"loc": {
"start": {
"line": 18,
"column": 13
},
"end": {
"line": 18,
"column": 14
}
}
},
"right": {
"type": "MemberExpression",
"computed": false,
"object": {
"type": "Identifier",
"name": "THREE",
"range": [
512,
517
],
"loc": {
"start": {
"line": 18,
"column": 26
},
"end": {
"line": 18,
"column": 31
}
}
},
"property": {
"type": "Identifier",
"name": "Vector3",
"range": [
518,
525
],
"loc": {
"start": {
"line": 18,
"column": 32
},
"end": {
"line": 18,
"column": 39
}
}
},
"range": [
512,
525
],
"loc": {
"start": {
"line": 18,
"column": 26
},
"end": {
"line": 18,
"column": 39
}
}
},
"range": [
499,
525
],
"loc": {
"start": {
"line": 18,
"column": 13
},
"end": {
"line": 18,
"column": 39
}
}
},
"consequent": {
"type": "ReturnStatement",
"argument": {
"type": "BinaryExpression",
"operator": "+",
"left": {
"type": "BinaryExpression",
"operator": "+",
"left": {
"type": "Literal",
"value": "{",
"raw": "'{'",
"range": [
542,
545
],
"loc": {
"start": {
"line": 19,
"column": 15
},
"end": {
"line": 19,
"column": 18
}
}
},
"right": {
"type": "CallExpression",
"callee": {
"type": "MemberExpression",
"computed": false,
"object": {
"type": "CallExpression",
"callee": {
"type": "MemberExpression",
"computed": false,
"object": {
"type": "Identifier",
"name": "x",
"range": [
548,
549
],
"loc": {
"start": {
"line": 19,
"column": 21
},
"end": {
"line": 19,
"column": 22
}
}
},
"property": {
"type": "Identifier",
"name": "toArray",
"range": [
550,
557
],
"loc": {
"start": {
"line": 19,
"column": 23
},
"end": {
"line": 19,
"column": 30
}
}
},
"range": [
548,
557
],
"loc": {
"start": {
"line": 19,
"column": 21
},
"end": {
"line": 19,
"column": 30
}
}
},
"arguments": [],
"range": [
548,
559
],
"loc": {
"start": {
"line": 19,
"column": 21
},
"end": {
"line": 19,
"column": 32
}
}
},
"property": {
"type": "Identifier",
"name": "join",
"range": [
560,
564
],
"loc": {
"start": {
"line": 19,
"column": 33
},
"end": {
"line": 19,
"column": 37
}
}
},
"range": [
548,
564
],
"loc": {
"start": {
"line": 19,
"column": 21
},
"end": {
"line": 19,
"column": 37
}
}
},
"arguments": [
{
"type": "Literal",
"value": ", ",
"raw": "', '",
"range": [
565,
569
],
"loc": {
"start": {
"line": 19,
"column": 38
},
"end": {
"line": 19,
"column": 42
}
}
}
],
"range": [
548,
570
],
"loc": {
"start": {
"line": 19,
"column": 21
},
"end": {
"line": 19,
"column": 43
}
}
},
"range": [
542,
570
],
"loc": {
"start": {
"line": 19,
"column": 15
},
"end": {
"line": 19,
"column": 43
}
}
},
"right": {
"type": "Literal",
"value": "}",
"raw": "'}'",
"range": [
573,
576
],
"loc": {
"start": {
"line": 19,
"column": 46
},
"end": {
"line": 19,
"column": 49
}
}
},
"range": [
542,
576
],
"loc": {
"start": {
"line": 19,
"column": 15
},
"end": {
"line": 19,
"column": 49
}
}
},
"range": [
535,
577
],
"loc": {
"start": {
"line": 19,
"column": 8
},
"end": {
"line": 19,
"column": 50
}
}
},
"alternate": {
"type": "IfStatement",
"test": {
"type": "BinaryExpression",
"operator": "instanceof",
"left": {
"type": "Identifier",
"name": "x",
"range": [
591,
592
],
"loc": {
"start": {
"line": 20,
"column": 13
},
"end": {
"line": 20,
"column": 14
}
}
},
"right": {
"type": "Identifier",
"name": "Ccref",
"range": [
604,
609
],
"loc": {
"start": {
"line": 20,
"column": 26
},
"end": {
"line": 20,
"column": 31
}
}
},
"range": [
591,
609
],
"loc": {
"start": {
"line": 20,
"column": 13
},
"end": {
"line": 20,
"column": 31
}
}
},
"consequent": {
"type": "ReturnStatement",
"argument": {
"type": "CallExpression",
"callee": {
"type": "Identifier",
"name": "formatValue",
"range": [
626,
637
],
"loc": {
"start": {
"line": 21,
"column": 15
},
"end": {
"line": 21,
"column": 26
}
}
},
"arguments": [
{
"type": "CallExpression",
"callee": {
"type": "Identifier",
"name": "RealToId",
"range": [
638,
646
],
"loc": {
"start": {
"line": 21,
"column": 27
},
"end": {
"line": 21,
"column": 35
}
}
},
"arguments": [
{
"type": "MemberExpression",
"computed": false,
"object": {
"type": "MemberExpression",
"computed": false,
"object": {
"type": "Identifier",
"name": "x",
"range": [
647,
648
],
"loc": {
"start": {
"line": 21,
"column": 36
},
"end": {
"line": 21,
"column": 37
}
}
},
"property": {
"type": "Identifier",
"name": "state",
"range": [
649,
654
],
"loc": {
"start": {
"line": 21,
"column": 38
},
"end": {
"line": 21,
"column": 43
}
}
},
"range": [
647,
654
],
"loc": {
"start": {
"line": 21,
"column": 36
},
"end": {
"line": 21,
"column": 43
}
}
},
"property": {
"type": "Identifier",
"name": "id",
"range": [
655,
657
],
"loc": {
"start": {
"line": 21,
"column": 44
},
"end": {
"line": 21,
"column": 46
}
}
},
"range": [
647,
657
],
"loc": {
"start": {
"line": 21,
"column": 36
},
"end": {
"line": 21,
"column": 46
}
}
}
],
"range": [
638,
658
],
"loc": {
"start": {
"line": 21,
"column": 27
},
"end": {
"line": 21,
"column": 47
}
}
}
],
"range": [
626,
659
],
"loc": {
"start": {
"line": 21,
"column": 15
},
"end": {
"line": 21,
"column": 48
}
}
},
"range": [
619,
660
],
"loc": {
"start": {
"line": 21,
"column": 8
},
"end": {
"line": 21,
"column": 49
}
}
},
"alternate": {
"type": "IfStatement",
"test": {
"type": "BinaryExpression",
"operator": "instanceof",
"left": {
"type": "Identifier",
"name": "x",
"range": [
674,
675
],
"loc": {
"start": {
"line": 22,
"column": 13
},
"end": {
"line": 22,
"column": 14
}
}
},