awv3
Version:
⚡ AWV3 embedded CAD
1,604 lines • 552 kB
JSON
{
"type": "File",
"start": 0,
"end": 3112,
"loc": {
"start": {
"line": 1,
"column": 0
},
"end": {
"line": 90,
"column": 0
}
},
"program": {
"type": "Program",
"start": 0,
"end": 3112,
"loc": {
"start": {
"line": 1,
"column": 0
},
"end": {
"line": 90,
"column": 0
}
},
"sourceType": "module",
"body": [
{
"type": "ImportDeclaration",
"start": 73,
"end": 104,
"loc": {
"start": {
"line": 2,
"column": 0
},
"end": {
"line": 2,
"column": 31
}
},
"specifiers": [
{
"type": "ImportNamespaceSpecifier",
"start": 80,
"end": 90,
"loc": {
"start": {
"line": 2,
"column": 7
},
"end": {
"line": 2,
"column": 17
}
},
"local": {
"type": "Identifier",
"start": 85,
"end": 90,
"loc": {
"start": {
"line": 2,
"column": 12
},
"end": {
"line": 2,
"column": 17
},
"identifierName": "THREE"
},
"name": "THREE",
"leadingComments": null
},
"leadingComments": null
}
],
"source": {
"type": "StringLiteral",
"start": 96,
"end": 103,
"loc": {
"start": {
"line": 2,
"column": 23
},
"end": {
"line": 2,
"column": 30
}
},
"extra": {
"rawValue": "three",
"raw": "'three'"
},
"value": "three"
},
"leadingComments": [
{
"type": "CommentLine",
"value": " lowlevel commands are those that map 1-to-1 to ClassCad constructions",
"start": 0,
"end": 72,
"loc": {
"start": {
"line": 1,
"column": 0
},
"end": {
"line": 1,
"column": 72
}
}
}
]
},
{
"type": "ImportDeclaration",
"start": 105,
"end": 142,
"loc": {
"start": {
"line": 3,
"column": 0
},
"end": {
"line": 3,
"column": 37
}
},
"specifiers": [
{
"type": "ImportDefaultSpecifier",
"start": 112,
"end": 121,
"loc": {
"start": {
"line": 3,
"column": 7
},
"end": {
"line": 3,
"column": 16
}
},
"local": {
"type": "Identifier",
"start": 112,
"end": 121,
"loc": {
"start": {
"line": 3,
"column": 7
},
"end": {
"line": 3,
"column": 16
},
"identifierName": "Ccfuturef"
},
"name": "Ccfuturef"
}
}
],
"source": {
"type": "StringLiteral",
"start": 127,
"end": 141,
"loc": {
"start": {
"line": 3,
"column": 22
},
"end": {
"line": 3,
"column": 36
}
},
"extra": {
"rawValue": "../ccfuturef",
"raw": "'../ccfuturef'"
},
"value": "../ccfuturef"
}
},
{
"type": "ImportDeclaration",
"start": 143,
"end": 172,
"loc": {
"start": {
"line": 4,
"column": 0
},
"end": {
"line": 4,
"column": 29
}
},
"specifiers": [
{
"type": "ImportDefaultSpecifier",
"start": 150,
"end": 155,
"loc": {
"start": {
"line": 4,
"column": 7
},
"end": {
"line": 4,
"column": 12
}
},
"local": {
"type": "Identifier",
"start": 150,
"end": 155,
"loc": {
"start": {
"line": 4,
"column": 7
},
"end": {
"line": 4,
"column": 12
},
"identifierName": "Ccref"
},
"name": "Ccref"
}
}
],
"source": {
"type": "StringLiteral",
"start": 161,
"end": 171,
"loc": {
"start": {
"line": 4,
"column": 18
},
"end": {
"line": 4,
"column": 28
}
},
"extra": {
"rawValue": "../ccref",
"raw": "'../ccref'"
},
"value": "../ccref"
}
},
{
"type": "ImportDeclaration",
"start": 173,
"end": 202,
"loc": {
"start": {
"line": 5,
"column": 0
},
"end": {
"line": 5,
"column": 29
}
},
"specifiers": [
{
"type": "ImportNamespaceSpecifier",
"start": 180,
"end": 188,
"loc": {
"start": {
"line": 5,
"column": 7
},
"end": {
"line": 5,
"column": 15
}
},
"local": {
"type": "Identifier",
"start": 185,
"end": 188,
"loc": {
"start": {
"line": 5,
"column": 12
},
"end": {
"line": 5,
"column": 15
},
"identifierName": "ast"
},
"name": "ast"
}
}
],
"source": {
"type": "StringLiteral",
"start": 194,
"end": 201,
"loc": {
"start": {
"line": 5,
"column": 21
},
"end": {
"line": 5,
"column": 28
}
},
"extra": {
"rawValue": "./ast",
"raw": "'./ast'"
},
"value": "./ast"
}
},
{
"type": "FunctionDeclaration",
"start": 204,
"end": 933,
"loc": {
"start": {
"line": 7,
"column": 0
},
"end": {
"line": 29,
"column": 1
}
},
"id": {
"type": "Identifier",
"start": 213,
"end": 218,
"loc": {
"start": {
"line": 7,
"column": 9
},
"end": {
"line": 7,
"column": 14
},
"identifierName": "toAst"
},
"name": "toAst"
},
"generator": false,
"expression": false,
"async": false,
"params": [
{
"type": "Identifier",
"start": 219,
"end": 220,
"loc": {
"start": {
"line": 7,
"column": 15
},
"end": {
"line": 7,
"column": 16
},
"identifierName": "x"
},
"name": "x"
}
],
"body": {
"type": "BlockStatement",
"start": 222,
"end": 933,
"loc": {
"start": {
"line": 7,
"column": 18
},
"end": {
"line": 29,
"column": 1
}
},
"body": [
{
"type": "IfStatement",
"start": 228,
"end": 274,
"loc": {
"start": {
"line": 8,
"column": 4
},
"end": {
"line": 9,
"column": 30
}
},
"test": {
"type": "BinaryExpression",
"start": 232,
"end": 242,
"loc": {
"start": {
"line": 8,
"column": 8
},
"end": {
"line": 8,
"column": 18
}
},
"left": {
"type": "Identifier",
"start": 232,
"end": 233,
"loc": {
"start": {
"line": 8,
"column": 8
},
"end": {
"line": 8,
"column": 9
},
"identifierName": "x"
},
"name": "x"
},
"operator": "===",
"right": {
"type": "NullLiteral",
"start": 238,
"end": 242,
"loc": {
"start": {
"line": 8,
"column": 14
},
"end": {
"line": 8,
"column": 18
}
}
}
},
"consequent": {
"type": "ReturnStatement",
"start": 252,
"end": 274,
"loc": {
"start": {
"line": 9,
"column": 8
},
"end": {
"line": 9,
"column": 30
}
},
"argument": {
"type": "NewExpression",
"start": 259,
"end": 273,
"loc": {
"start": {
"line": 9,
"column": 15
},
"end": {
"line": 9,
"column": 29
}
},
"callee": {
"type": "MemberExpression",
"start": 263,
"end": 271,
"loc": {
"start": {
"line": 9,
"column": 19
},
"end": {
"line": 9,
"column": 27
}
},
"object": {
"type": "Identifier",
"start": 263,
"end": 266,
"loc": {
"start": {
"line": 9,
"column": 19
},
"end": {
"line": 9,
"column": 22
},
"identifierName": "ast"
},
"name": "ast"
},
"property": {
"type": "Identifier",
"start": 267,
"end": 271,
"loc": {
"start": {
"line": 9,
"column": 23
},
"end": {
"line": 9,
"column": 27
},
"identifierName": "Pass"
},
"name": "Pass"
},
"computed": false
},
"arguments": []
}
},
"alternate": null
},
{
"type": "SwitchStatement",
"start": 279,
"end": 478,
"loc": {
"start": {
"line": 10,
"column": 4
},
"end": {
"line": 15,
"column": 5
}
},
"discriminant": {
"type": "UnaryExpression",
"start": 287,
"end": 295,
"loc": {
"start": {
"line": 10,
"column": 12
},
"end": {
"line": 10,
"column": 20
}
},
"operator": "typeof",
"prefix": true,
"argument": {
"type": "Identifier",
"start": 294,
"end": 295,
"loc": {
"start": {
"line": 10,
"column": 19
},
"end": {
"line": 10,
"column": 20
},
"identifierName": "x"
},
"name": "x"
},
"extra": {
"parenthesizedArgument": false
}
},
"cases": [
{
"type": "SwitchCase",
"start": 307,
"end": 324,
"loc": {
"start": {
"line": 11,
"column": 8
},
"end": {
"line": 11,
"column": 25
}
},
"consequent": [],
"test": {
"type": "StringLiteral",
"start": 312,
"end": 323,
"loc": {
"start": {
"line": 11,
"column": 13
},
"end": {
"line": 11,
"column": 24
}
},
"extra": {
"rawValue": "undefined",
"raw": "'undefined'"
},
"value": "undefined"
}
},
{
"type": "SwitchCase",
"start": 333,
"end": 380,
"loc": {
"start": {
"line": 12,
"column": 8
},
"end": {
"line": 12,
"column": 55
}
},
"consequent": [
{
"type": "ReturnStatement",
"start": 349,
"end": 380,
"loc": {
"start": {
"line": 12,
"column": 24
},
"end": {
"line": 12,
"column": 55
}
},
"argument": {
"type": "NewExpression",
"start": 356,
"end": 379,
"loc": {
"start": {
"line": 12,
"column": 31
},
"end": {
"line": 12,
"column": 54
}
},
"callee": {
"type": "MemberExpression",
"start": 360,
"end": 376,
"loc": {
"start": {
"line": 12,
"column": 35
},
"end": {
"line": 12,
"column": 51
}
},
"object": {
"type": "Identifier",
"start": 360,
"end": 363,
"loc": {
"start": {
"line": 12,
"column": 35
},
"end": {
"line": 12,
"column": 38
},
"identifierName": "ast"
},
"name": "ast"
},
"property": {
"type": "Identifier",
"start": 364,
"end": 376,
"loc": {
"start": {
"line": 12,
"column": 39
},
"end": {
"line": 12,
"column": 51
},
"identifierName": "NameConstant"
},
"name": "NameConstant"
},
"computed": false
},
"arguments": [
{
"type": "Identifier",
"start": 377,
"end": 378,
"loc": {
"start": {
"line": 12,
"column": 52
},
"end": {
"line": 12,
"column": 53
},
"identifierName": "x"
},
"name": "x"
}
]
}
}
],
"test": {
"type": "StringLiteral",
"start": 338,
"end": 347,
"loc": {
"start": {
"line": 12,
"column": 13
},
"end": {
"line": 12,
"column": 22
}
},
"extra": {
"rawValue": "boolean",
"raw": "'boolean'"
},
"value": "boolean"
}
},
{
"type": "SwitchCase",
"start": 389,
"end": 426,
"loc": {
"start": {
"line": 13,
"column": 8
},
"end": {
"line": 13,
"column": 45
}
},
"consequent": [
{
"type": "ReturnStatement",
"start": 404,
"end": 426,
"loc": {
"start": {
"line": 13,
"column": 23
},
"end": {
"line": 13,
"column": 45
}
},
"argument": {
"type": "NewExpression",
"start": 411,
"end": 425,
"loc": {
"start": {
"line": 13,
"column": 30
},
"end": {
"line": 13,
"column": 44
}
},
"callee": {
"type": "MemberExpression",
"start": 415,
"end": 422,
"loc": {
"start": {
"line": 13,
"column": 34
},
"end": {
"line": 13,
"column": 41
}
},
"object": {
"type": "Identifier",
"start": 415,
"end": 418,
"loc": {
"start": {
"line": 13,
"column": 34
},
"end": {
"line": 13,
"column": 37
},
"identifierName": "ast"
},
"name": "ast"
},
"property": {
"type": "Identifier",
"start": 419,
"end": 422,
"loc": {
"start": {
"line": 13,
"column": 38
},
"end": {
"line": 13,
"column": 41
},
"identifierName": "Num"
},
"name": "Num"
},
"computed": false
},
"arguments": [
{
"type": "Identifier",
"start": 423,
"end": 424,
"loc": {
"start": {
"line": 13,
"column": 42
},
"end": {
"line": 13,
"column": 43
},
"identifierName": "x"
},
"name": "x"
}
]
}
}
],
"test": {
"type": "StringLiteral",
"start": 394,
"end": 402,
"loc": {
"start": {
"line": 13,
"column": 13
},
"end": {
"line": 13,
"column": 21
}
},
"extra": {
"rawValue": "number",
"raw": "'number'"
},
"value": "number"
}
},
{
"type": "SwitchCase",
"start": 435,
"end": 472,
"loc": {
"start": {
"line": 14,
"column": 8
},
"end": {
"line": 14,
"column": 45
}
},
"consequent": [
{
"type": "ReturnStatement",
"start": 450,
"end": 472,
"loc": {
"start": {
"line": 14,
"column": 23
},
"end": {
"line": 14,
"column": 45
}
},
"argument": {
"type": "NewExpression",
"start": 457,
"end": 471,
"loc": {
"start": {
"line": 14,
"column": 30
},
"end": {
"line": 14,
"column": 44
}
},
"callee": {
"type": "MemberExpression",
"start": 461,
"end": 468,
"loc": {
"start": {
"line": 14,
"column": 34
},
"end": {
"line": 14,
"column": 41
}
},
"object": {
"type": "Identifier",
"start": 461,
"end": 464,
"loc": {
"start": {
"line": 14,
"column": 34
},
"end": {
"line": 14,
"column": 37
},
"identifierName": "ast"
},
"name": "ast"
},
"property": {
"type": "Identifier",
"start": 465,
"end": 468,
"loc": {
"start": {
"line": 14,
"column": 38
},
"end": {
"line": 14,
"column": 41
},
"identifierName": "Str"
},
"name": "Str"
},
"computed": false
},
"arguments": [
{
"type": "Identifier",
"start": 469,
"end": 470,
"loc": {
"start": {
"line": 14,
"column": 42
},
"end": {
"line": 14,
"column": 43
},
"identifierName": "x"
},
"name": "x"
}
]
}
}
],
"test": {
"type": "StringLiteral",
"start": 440,
"end": 448,
"loc": {
"start": {
"line": 14,
"column": 13
},
"end": {
"line": 14,
"column": 21
}
},
"extra": {
"rawValue": "string",
"raw": "'string'"
},
"value": "string"
}
}
]
},
{
"type": "IfStatement",
"start": 483,
"end": 825,
"loc": {
"start": {
"line": 16,
"column": 4
},
"end": {
"line": 25,
"column": 17
}
},
"test": {
"type": "BinaryExpression",
"start": 487,
"end": 505,
"loc": {
"start": {
"line": 16,
"column": 8
},
"end": {
"line": 16,
"column": 26
}
},
"left": {
"type": "Identifier",
"start": 487,
"end": 488,
"loc": {
"start": {
"line": 16,
"column": 8
},
"end": {
"line": 16,
"column": 9
},
"identifierName": "x"
},
"name": "x"
},
"operator": "instanceof",
"right": {
"type": "Identifier",
"start": 500,
"end": 505,
"loc": {
"start": {
"line": 16,
"column": 21
},
"end": {
"line": 16,
"column": 26
},
"identifierName": "Array"
},
"name": "Array"
}
},
"consequent": {
"type": "ReturnStatement",
"start": 515,
"end": 549,
"loc": {
"start": {
"line": 17,
"column": 8
},
"end": {
"line": 17,
"column": 42
}
},
"argument": {
"type": "NewExpression",
"start": 522,
"end": 548,
"loc": {
"start": {
"line": 17,
"column": 15
},
"end": {
"line": 17,
"column": 41
}
},
"callee": {
"type": "MemberExpression",
"start": 526,
"end": 534,
"loc": {
"start": {
"line": 17,
"column": 19
},
"end": {
"line": 17,
"column": 27
}
},
"object": {
"type": "Identifier",
"start": 526,
"end": 529,
"loc": {
"start": {
"line": 17,
"column": 19
},
"end": {
"line": 17,
"column": 22
},
"identifierName": "ast"
},
"name": "ast"
},
"property": {
"type": "Identifier",
"start": 530,
"end": 534,
"loc": {
"start": {
"line": 17,
"column": 23
},
"end": {
"line": 17,
"column": 27
},
"identifierName": "List"
},
"name": "List"
},
"computed": false
},
"arguments": [
{
"type": "CallExpression",
"start": 535,
"end": 547,
"loc": {
"start": {
"line": 17,
"column": 28
},
"end": {
"line": 17,
"column": 40
}
},
"callee": {
"type": "MemberExpression",
"start": 535,
"end": 540,
"loc": {
"start": {
"line": 17,
"column": 28
},
"end": {
"line": 17,
"column": 33
}
},
"object": {
"type": "Identifier",
"start": 535,
"end": 536,
"loc": {
"start": {
"line": 17,
"column": 28
},
"end": {
"line": 17,
"column": 29
},
"identifierName": "x"
},
"name": "x"
},
"property": {
"type": "Identifier",
"start": 537,
"end": 540,
"loc": {
"start": {
"line": 17,
"column": 30
},
"end": {
"line": 17,
"column": 33
},
"identifierName": "map"
},
"name": "map"
},
"computed": false
},
"arguments": [
{
"type": "Identifier",
"start": 541,
"end": 546,
"loc": {
"start": {
"line": 17,
"column": 34
},
"end": {
"line": 17,
"column": 39
},
"identifierName": "toAst"
},
"name": "toAst"
}
]
}
]
}
},
"alternate": {
"type": "IfStatement",
"start": 559,
"end": 825,
"loc": {
"start": {
"line": 18,
"column": 9
},
"end": {
"line": 25,
"column": 17
}
},
"test": {
"type": "BinaryExpression",
"start": 563,
"end": 589,
"loc": {
"start": {
"line": 18,
"column": 13
},
"end": {
"line": 18,
"column": 39
}
},
"left": {
"type": "Identifier",
"start": 563,
"end": 564,
"loc": {
"start": {
"line": 18,
"column": 13
},
"end": {
"line": 18,
"column": 14
},
"identifierName": "x"
},
"name": "x"
},
"operator": "instanceof",
"right": {
"type": "MemberExpression",
"start": 576,
"end": 589,
"loc": {
"start": {
"line": 18,
"column": 26
},
"end": {
"line": 18,
"column": 39
}
},
"object": {
"type": "Identifier",
"start": 576,
"end": 581,
"loc": {
"start": {
"line": 18,
"column": 26
},
"end": {
"line": 18,
"column": 31
},
"identifierName": "THREE"
},
"name": "THREE"
},
"property": {
"type": "Identifier",
"start": 582,
"end": 589,
"loc": {
"start": {
"line": 18,
"column": 32
},
"end": {
"line": 18,
"column": 39
},
"identifierName": "Vector3"
},
"name": "Vector3"
},
"computed": false
}
},
"consequent": {
"type": "ReturnStatement",
"start": 599,
"end": 645,
"loc": {
"start": {
"line": 19,
"column": 8
},
"end": {
"line": 19,
"column": 54
}
},
"argument": {
"type": "NewExpression",
"start": 606,
"end": 644,
"loc": {
"start": {
"line": 19,
"column": 15
},
"end": {
"line": 19,
"column": 53
}
},
"callee": {
"type": "MemberExpression",
"start": 610,
"end": 620,
"loc": {
"start": {
"line": 19,
"column": 19
},
"end": {
"line": 19,
"column": 29
}
},
"object": {
"type": "Identifier",
"start": 610,
"end": 613,
"loc": {
"start": {
"line": 19,
"column": 19
},
"end": {
"line": 19,
"column": 22
},
"identifierName": "ast"
},
"name": "ast"
},
"property": {
"type": "Identifier",
"start": 614,
"end": 620,
"loc": {
"start": {
"line": 19,
"column": 23
},
"end": {
"line": 19,
"column": 29
},
"identifierName": "Vector"
},
"name": "Vector"
},
"computed": false
},
"arguments": [
{
"type": "CallExpression",
"start": 621,
"end": 643,
"loc": {
"start": {
"line": 19,
"column": 30
},
"end": {
"line": 19,
"column": 52
}
},
"callee": {
"type": "MemberExpression",
"start": 621,
"end": 636,
"loc": {
"start": {
"line": 19,
"column": 30
},
"end": {
"line": 19,
"column": 45
}
},
"object": {
"type": "CallExpression",
"start": 621,
"end": 632,
"loc": {
"start": {
"line": 19,
"column": 30
},
"end": {
"line": 19,
"column": 41
}
},
"callee": {
"type": "MemberExpression",
"start": 621,
"end": 630,
"loc": {
"start": {
"line": 19,
"column": 30
},
"end": {
"line": 19,
"column": 39
}
},
"object": {
"type": "Identifier",
"start": 621,
"end": 622,
"loc": {
"start": {
"line": 19,
"column": 30
},
"end": {
"line": 19,
"column": 31
},
"identifierName": "x"
},
"name": "x"
},
"property": {
"type": "Identifier",
"start": 623,
"end": 630,
"loc": {
"start": {
"line": 19,
"column": 32
},
"end": {
"line": 19,
"column": 39
},
"identifierName": "toArray"
},
"name": "toArray"
},
"computed": false
},
"arguments": []
},
"property": {
"type": "Identifier",
"start": 633,
"end": 636,
"loc": {
"start": {
"line": 19,
"column": 42
},
"end": {
"line": 19,
"column": 45
},
"identifierName": "map"
},
"name": "map"
},
"computed": false
},
"arguments": [
{
"type": "Identifier",
"start": 637,
"end": 642,
"loc": {
"start": {
"line": 19,
"column": 46
},
"end": {
"line": 19,
"column": 51
},
"identifierName": "toAst"
},
"name": "toAst"
}
]
}
]
}
},
"alternate": {
"type": "IfStatement",
"start": 655,
"end": 825,
"loc": {
"start": {
"line": 20,
"column": 9
},
"end": {
"line": 25,
"column": 17
}
},
"test": {
"type": "BinaryExpression",
"start": 659,
"end": 677,
"loc": {
"start": {
"line": 20,
"column": 13
},
"end": {
"li