oxygen-core
Version:
Oxygen game engine (Xenon Core for browsers)
1,575 lines (1,574 loc) • 890 kB
JSON
{
"type": "File",
"start": 0,
"end": 3889,
"loc": {
"start": {
"line": 1,
"column": 0
},
"end": {
"line": 163,
"column": 0
}
},
"program": {
"type": "Program",
"start": 0,
"end": 3889,
"loc": {
"start": {
"line": 1,
"column": 0
},
"end": {
"line": 163,
"column": 0
}
},
"sourceType": "module",
"body": [
{
"type": "ImportDeclaration",
"start": 0,
"end": 49,
"loc": {
"start": {
"line": 1,
"column": 0
},
"end": {
"line": 1,
"column": 49
}
},
"specifiers": [
{
"type": "ImportDefaultSpecifier",
"start": 7,
"end": 12,
"loc": {
"start": {
"line": 1,
"column": 7
},
"end": {
"line": 1,
"column": 12
}
},
"local": {
"type": "Identifier",
"start": 7,
"end": 12,
"loc": {
"start": {
"line": 1,
"column": 7
},
"end": {
"line": 1,
"column": 12
},
"identifierName": "Asset"
},
"name": "Asset"
}
}
],
"source": {
"type": "StringLiteral",
"start": 18,
"end": 48,
"loc": {
"start": {
"line": 1,
"column": 18
},
"end": {
"line": 1,
"column": 48
}
},
"extra": {
"rawValue": "../systems/AssetSystem/Asset",
"raw": "'../systems/AssetSystem/Asset'"
},
"value": "../systems/AssetSystem/Asset"
}
},
{
"type": "VariableDeclaration",
"start": 53,
"end": 84,
"loc": {
"start": {
"line": 3,
"column": 0
},
"end": {
"line": 3,
"column": 31
}
},
"declarations": [
{
"type": "VariableDeclarator",
"start": 59,
"end": 83,
"loc": {
"start": {
"line": 3,
"column": 6
},
"end": {
"line": 3,
"column": 30
}
},
"id": {
"type": "Identifier",
"start": 59,
"end": 71,
"loc": {
"start": {
"line": 3,
"column": 6
},
"end": {
"line": 3,
"column": 18
},
"identifierName": "regexNewLine"
},
"name": "regexNewLine"
},
"init": {
"type": "RegExpLiteral",
"start": 74,
"end": 83,
"loc": {
"start": {
"line": 3,
"column": 21
},
"end": {
"line": 3,
"column": 30
}
},
"extra": {
"raw": "/[\\r\\n]+/"
},
"pattern": "[\\r\\n]+",
"flags": ""
}
}
],
"kind": "const"
},
{
"type": "VariableDeclaration",
"start": 86,
"end": 117,
"loc": {
"start": {
"line": 4,
"column": 0
},
"end": {
"line": 4,
"column": 31
}
},
"declarations": [
{
"type": "VariableDeclarator",
"start": 92,
"end": 116,
"loc": {
"start": {
"line": 4,
"column": 6
},
"end": {
"line": 4,
"column": 30
}
},
"id": {
"type": "Identifier",
"start": 92,
"end": 108,
"loc": {
"start": {
"line": 4,
"column": 6
},
"end": {
"line": 4,
"column": 22
},
"identifierName": "regexWhiteSpaces"
},
"name": "regexWhiteSpaces"
},
"init": {
"type": "RegExpLiteral",
"start": 111,
"end": 116,
"loc": {
"start": {
"line": 4,
"column": 25
},
"end": {
"line": 4,
"column": 30
}
},
"extra": {
"raw": "/\\s+/"
},
"pattern": "\\s+",
"flags": ""
}
}
],
"kind": "const"
},
{
"type": "VariableDeclaration",
"start": 119,
"end": 203,
"loc": {
"start": {
"line": 5,
"column": 0
},
"end": {
"line": 5,
"column": 84
}
},
"declarations": [
{
"type": "VariableDeclarator",
"start": 125,
"end": 202,
"loc": {
"start": {
"line": 5,
"column": 6
},
"end": {
"line": 5,
"column": 83
}
},
"id": {
"type": "Identifier",
"start": 125,
"end": 142,
"loc": {
"start": {
"line": 5,
"column": 6
},
"end": {
"line": 5,
"column": 23
},
"identifierName": "regexKeyValuePair"
},
"name": "regexKeyValuePair"
},
"init": {
"type": "RegExpLiteral",
"start": 145,
"end": 202,
"loc": {
"start": {
"line": 5,
"column": 26
},
"end": {
"line": 5,
"column": 83
}
},
"extra": {
"raw": "/(\\w+)=(\"(.*)\"|(-?\\d+)(,(-?\\d+))?(,(-?\\d+))?(,(-?\\d+))?)/"
},
"pattern": "(\\w+)=(\"(.*)\"|(-?\\d+)(,(-?\\d+))?(,(-?\\d+))?(,(-?\\d+))?)",
"flags": ""
}
}
],
"kind": "const"
},
{
"type": "FunctionDeclaration",
"start": 207,
"end": 1403,
"loc": {
"start": {
"line": 7,
"column": 0
},
"end": {
"line": 54,
"column": 1
}
},
"id": {
"type": "Identifier",
"start": 216,
"end": 227,
"loc": {
"start": {
"line": 7,
"column": 9
},
"end": {
"line": 7,
"column": 20
},
"identifierName": "getLineData"
},
"name": "getLineData"
},
"generator": false,
"expression": false,
"async": false,
"params": [
{
"type": "Identifier",
"start": 228,
"end": 232,
"loc": {
"start": {
"line": 7,
"column": 21
},
"end": {
"line": 7,
"column": 25
},
"identifierName": "line"
},
"name": "line"
}
],
"body": {
"type": "BlockStatement",
"start": 234,
"end": 1403,
"loc": {
"start": {
"line": 7,
"column": 27
},
"end": {
"line": 54,
"column": 1
}
},
"body": [
{
"type": "VariableDeclaration",
"start": 239,
"end": 282,
"loc": {
"start": {
"line": 8,
"column": 2
},
"end": {
"line": 8,
"column": 45
}
},
"declarations": [
{
"type": "VariableDeclarator",
"start": 245,
"end": 281,
"loc": {
"start": {
"line": 8,
"column": 8
},
"end": {
"line": 8,
"column": 44
}
},
"id": {
"type": "Identifier",
"start": 245,
"end": 250,
"loc": {
"start": {
"line": 8,
"column": 8
},
"end": {
"line": 8,
"column": 13
},
"identifierName": "words"
},
"name": "words"
},
"init": {
"type": "CallExpression",
"start": 253,
"end": 281,
"loc": {
"start": {
"line": 8,
"column": 16
},
"end": {
"line": 8,
"column": 44
}
},
"callee": {
"type": "MemberExpression",
"start": 253,
"end": 263,
"loc": {
"start": {
"line": 8,
"column": 16
},
"end": {
"line": 8,
"column": 26
}
},
"object": {
"type": "Identifier",
"start": 253,
"end": 257,
"loc": {
"start": {
"line": 8,
"column": 16
},
"end": {
"line": 8,
"column": 20
},
"identifierName": "line"
},
"name": "line"
},
"property": {
"type": "Identifier",
"start": 258,
"end": 263,
"loc": {
"start": {
"line": 8,
"column": 21
},
"end": {
"line": 8,
"column": 26
},
"identifierName": "split"
},
"name": "split"
},
"computed": false
},
"arguments": [
{
"type": "Identifier",
"start": 264,
"end": 280,
"loc": {
"start": {
"line": 8,
"column": 27
},
"end": {
"line": 8,
"column": 43
},
"identifierName": "regexWhiteSpaces"
},
"name": "regexWhiteSpaces"
}
]
}
}
],
"kind": "const"
},
{
"type": "IfStatement",
"start": 288,
"end": 376,
"loc": {
"start": {
"line": 10,
"column": 2
},
"end": {
"line": 12,
"column": 3
}
},
"test": {
"type": "BinaryExpression",
"start": 292,
"end": 308,
"loc": {
"start": {
"line": 10,
"column": 6
},
"end": {
"line": 10,
"column": 22
}
},
"left": {
"type": "MemberExpression",
"start": 292,
"end": 304,
"loc": {
"start": {
"line": 10,
"column": 6
},
"end": {
"line": 10,
"column": 18
}
},
"object": {
"type": "Identifier",
"start": 292,
"end": 297,
"loc": {
"start": {
"line": 10,
"column": 6
},
"end": {
"line": 10,
"column": 11
},
"identifierName": "words"
},
"name": "words"
},
"property": {
"type": "Identifier",
"start": 298,
"end": 304,
"loc": {
"start": {
"line": 10,
"column": 12
},
"end": {
"line": 10,
"column": 18
},
"identifierName": "length"
},
"name": "length"
},
"computed": false
},
"operator": "<",
"right": {
"type": "NumericLiteral",
"start": 307,
"end": 308,
"loc": {
"start": {
"line": 10,
"column": 21
},
"end": {
"line": 10,
"column": 22
}
},
"extra": {
"rawValue": 1,
"raw": "1"
},
"value": 1
}
},
"consequent": {
"type": "BlockStatement",
"start": 310,
"end": 376,
"loc": {
"start": {
"line": 10,
"column": 24
},
"end": {
"line": 12,
"column": 3
}
},
"body": [
{
"type": "ThrowStatement",
"start": 317,
"end": 371,
"loc": {
"start": {
"line": 11,
"column": 4
},
"end": {
"line": 11,
"column": 58
}
},
"argument": {
"type": "NewExpression",
"start": 323,
"end": 370,
"loc": {
"start": {
"line": 11,
"column": 10
},
"end": {
"line": 11,
"column": 57
}
},
"callee": {
"type": "Identifier",
"start": 327,
"end": 332,
"loc": {
"start": {
"line": 11,
"column": 14
},
"end": {
"line": 11,
"column": 19
},
"identifierName": "Error"
},
"name": "Error"
},
"arguments": [
{
"type": "TemplateLiteral",
"start": 333,
"end": 369,
"loc": {
"start": {
"line": 11,
"column": 20
},
"end": {
"line": 11,
"column": 56
}
},
"expressions": [
{
"type": "Identifier",
"start": 363,
"end": 367,
"loc": {
"start": {
"line": 11,
"column": 50
},
"end": {
"line": 11,
"column": 54
},
"identifierName": "line"
},
"name": "line"
}
],
"quasis": [
{
"type": "TemplateElement",
"start": 334,
"end": 361,
"loc": {
"start": {
"line": 11,
"column": 21
},
"end": {
"line": 11,
"column": 48
}
},
"value": {
"raw": "There is no words in line: ",
"cooked": "There is no words in line: "
},
"tail": false
},
{
"type": "TemplateElement",
"start": 368,
"end": 368,
"loc": {
"start": {
"line": 11,
"column": 55
},
"end": {
"line": 11,
"column": 55
}
},
"value": {
"raw": "",
"cooked": ""
},
"tail": true
}
]
}
]
}
}
],
"directives": []
},
"alternate": null
},
{
"type": "VariableDeclaration",
"start": 382,
"end": 437,
"loc": {
"start": {
"line": 14,
"column": 2
},
"end": {
"line": 17,
"column": 4
}
},
"declarations": [
{
"type": "VariableDeclarator",
"start": 388,
"end": 436,
"loc": {
"start": {
"line": 14,
"column": 8
},
"end": {
"line": 17,
"column": 3
}
},
"id": {
"type": "Identifier",
"start": 388,
"end": 394,
"loc": {
"start": {
"line": 14,
"column": 8
},
"end": {
"line": 14,
"column": 14
},
"identifierName": "result"
},
"name": "result"
},
"init": {
"type": "ObjectExpression",
"start": 397,
"end": 436,
"loc": {
"start": {
"line": 14,
"column": 17
},
"end": {
"line": 17,
"column": 3
}
},
"properties": [
{
"type": "ObjectProperty",
"start": 404,
"end": 416,
"loc": {
"start": {
"line": 15,
"column": 4
},
"end": {
"line": 15,
"column": 16
}
},
"method": false,
"shorthand": false,
"computed": false,
"key": {
"type": "Identifier",
"start": 404,
"end": 406,
"loc": {
"start": {
"line": 15,
"column": 4
},
"end": {
"line": 15,
"column": 6
},
"identifierName": "id"
},
"name": "id"
},
"value": {
"type": "MemberExpression",
"start": 408,
"end": 416,
"loc": {
"start": {
"line": 15,
"column": 8
},
"end": {
"line": 15,
"column": 16
}
},
"object": {
"type": "Identifier",
"start": 408,
"end": 413,
"loc": {
"start": {
"line": 15,
"column": 8
},
"end": {
"line": 15,
"column": 13
},
"identifierName": "words"
},
"name": "words"
},
"property": {
"type": "NumericLiteral",
"start": 414,
"end": 415,
"loc": {
"start": {
"line": 15,
"column": 14
},
"end": {
"line": 15,
"column": 15
}
},
"extra": {
"rawValue": 0,
"raw": "0"
},
"value": 0
},
"computed": true
}
},
{
"type": "ObjectProperty",
"start": 423,
"end": 431,
"loc": {
"start": {
"line": 16,
"column": 4
},
"end": {
"line": 16,
"column": 12
}
},
"method": false,
"shorthand": false,
"computed": false,
"key": {
"type": "Identifier",
"start": 423,
"end": 427,
"loc": {
"start": {
"line": 16,
"column": 4
},
"end": {
"line": 16,
"column": 8
},
"identifierName": "data"
},
"name": "data"
},
"value": {
"type": "ObjectExpression",
"start": 429,
"end": 431,
"loc": {
"start": {
"line": 16,
"column": 10
},
"end": {
"line": 16,
"column": 12
}
},
"properties": []
}
}
]
}
}
],
"kind": "const"
},
{
"type": "ForStatement",
"start": 443,
"end": 1380,
"loc": {
"start": {
"line": 19,
"column": 2
},
"end": {
"line": 51,
"column": 3
}
},
"init": {
"type": "VariableDeclaration",
"start": 448,
"end": 475,
"loc": {
"start": {
"line": 19,
"column": 7
},
"end": {
"line": 19,
"column": 34
}
},
"declarations": [
{
"type": "VariableDeclarator",
"start": 452,
"end": 457,
"loc": {
"start": {
"line": 19,
"column": 11
},
"end": {
"line": 19,
"column": 16
}
},
"id": {
"type": "Identifier",
"start": 452,
"end": 453,
"loc": {
"start": {
"line": 19,
"column": 11
},
"end": {
"line": 19,
"column": 12
},
"identifierName": "i"
},
"name": "i"
},
"init": {
"type": "NumericLiteral",
"start": 456,
"end": 457,
"loc": {
"start": {
"line": 19,
"column": 15
},
"end": {
"line": 19,
"column": 16
}
},
"extra": {
"rawValue": 1,
"raw": "1"
},
"value": 1
}
},
{
"type": "VariableDeclarator",
"start": 459,
"end": 475,
"loc": {
"start": {
"line": 19,
"column": 18
},
"end": {
"line": 19,
"column": 34
}
},
"id": {
"type": "Identifier",
"start": 459,
"end": 460,
"loc": {
"start": {
"line": 19,
"column": 18
},
"end": {
"line": 19,
"column": 19
},
"identifierName": "c"
},
"name": "c"
},
"init": {
"type": "MemberExpression",
"start": 463,
"end": 475,
"loc": {
"start": {
"line": 19,
"column": 22
},
"end": {
"line": 19,
"column": 34
}
},
"object": {
"type": "Identifier",
"start": 463,
"end": 468,
"loc": {
"start": {
"line": 19,
"column": 22
},
"end": {
"line": 19,
"column": 27
},
"identifierName": "words"
},
"name": "words"
},
"property": {
"type": "Identifier",
"start": 469,
"end": 475,
"loc": {
"start": {
"line": 19,
"column": 28
},
"end": {
"line": 19,
"column": 34
},
"identifierName": "length"
},
"name": "length"
},
"computed": false
}
}
],
"kind": "let"
},
"test": {
"type": "BinaryExpression",
"start": 477,
"end": 482,
"loc": {
"start": {
"line": 19,
"column": 36
},
"end": {
"line": 19,
"column": 41
}
},
"left": {
"type": "Identifier",
"start": 477,
"end": 478,
"loc": {
"start": {
"line": 19,
"column": 36
},
"end": {
"line": 19,
"column": 37
},
"identifierName": "i"
},
"name": "i"
},
"operator": "<",
"right": {
"type": "Identifier",
"start": 481,
"end": 482,
"loc": {
"start": {
"line": 19,
"column": 40
},
"end": {
"line": 19,
"column": 41
},
"identifierName": "c"
},
"name": "c"
}
},
"update": {
"type": "UpdateExpression",
"start": 484,
"end": 487,
"loc": {
"start": {
"line": 19,
"column": 43
},
"end": {
"line": 19,
"column": 46
}
},
"operator": "++",
"prefix": true,
"argument": {
"type": "Identifier",
"start": 486,
"end": 487,
"loc": {
"start": {
"line": 19,
"column": 45
},
"end": {
"line": 19,
"column": 46
},
"identifierName": "i"
},
"name": "i"
},
"extra": {
"parenthesizedArgument": false
}
},
"body": {
"type": "BlockStatement",
"start": 489,
"end": 1380,
"loc": {
"start": {
"line": 19,
"column": 48
},
"end": {
"line": 51,
"column": 3
}
},
"body": [
{
"type": "VariableDeclaration",
"start": 496,
"end": 518,
"loc": {
"start": {
"line": 20,
"column": 4
},
"end": {
"line": 20,
"column": 26
}
},
"declarations": [
{
"type": "VariableDeclarator",
"start": 502,
"end": 517,
"loc": {
"start": {
"line": 20,
"column": 10
},
"end": {
"line": 20,
"column": 25
}
},
"id": {
"type": "Identifier",
"start": 502,
"end": 506,
"loc": {
"start": {
"line": 20,
"column": 10
},
"end": {
"line": 20,
"column": 14
},
"identifierName": "word"
},
"name": "word"
},
"init": {
"type": "MemberExpression",
"start": 509,
"end": 517,
"loc": {
"start": {
"line": 20,
"column": 17
},
"end": {
"line": 20,
"column": 25
}
},
"object": {
"type": "Identifier",
"start": 509,
"end": 514,
"loc": {
"start": {
"line": 20,
"column": 17
},
"end": {
"line": 20,
"column": 22
},
"identifierName": "words"
},
"name": "words"
},
"property": {
"type": "Identifier",
"start": 515,
"end": 516,
"loc": {
"start": {
"line": 20,
"column": 23
},
"end": {
"line": 20,
"column": 24
},
"identifierName": "i"
},
"name": "i"
},
"computed": true
}
}
],
"kind": "const"
},
{
"type": "VariableDeclaration",
"start": 524,
"end": 569,
"loc": {
"start": {
"line": 21,
"column": 4
},
"end": {
"line": 21,
"column": 49
}
},
"declarations": [
{
"type": "VariableDeclarator",
"start": 530,
"end": 568,
"loc": {
"start": {
"line": 21,
"column": 10
},
"end": {
"line": 21,
"column": 48
}
},
"id": {
"type": "Identifier",
"start": 530,
"end": 537,
"loc": {
"start": {
"line": 21,
"column": 10
},
"end": {
"line": 21,
"column": 17
},
"identifierName": "matches"
},
"name": "matches"
},
"init": {
"type": "CallExpression",
"start": 540,
"end": 568,
"loc": {
"start": {
"line": 21,
"column": 20
},
"end": {
"line": 21,
"column": 48
}
},
"callee": {
"type": "MemberExpression",
"start": 540,
"end": 562,
"loc": {
"start": {
"line": 21,
"column": 20
},
"end": {
"line": 21,
"column": 42
}
},
"object": {
"type": "Identifier",
"start": 540,
"end": 557,
"loc": {
"start": {
"line": 21,
"column": 20
},
"end": {
"line": 21,
"column": 37
},
"identifierName": "regexKeyValuePair"
},
"name": "regexKeyValuePair"
},
"property": {
"type": "Identifier",
"start": 558,
"end": 562,
"loc": {
"start": {
"line": 21,
"column": 38
},
"end": {
"line": 21,
"column": 42
},
"identifierName": "exec"
},
"name": "exec"
},
"computed": false
},
"arguments": [
{
"type": "Identifier",
"start": 563,
"end": 567,
"loc": {
"start": {
"line": 21,
"column": 43
},
"end": {
"line": 21,
"column": 47
},
"identifierName": "word"
},
"name": "word"
}
]
}
}
],
"kind": "const"
},
{
"type": "IfStatement",
"start": 575,
"end": 663,
"loc": {
"start": {
"line": 22,
"column": 4
},
"end": {
"line": 24,
"column": 5
}
},
"test": {
"type": "UnaryExpression",
"start": 579,
"end": 587,
"loc": {
"start": {
"line": 22,
"column": 8
},
"end": {
"line": 22,
"column": 16
}
},
"operator": "!",
"prefix": true,
"argument": {
"type": "Identifier",
"start": 580,
"end": 587,
"loc": {
"start": {
"line": 22,
"column": 9
},
"end": {
"line": 22,
"column": 16
},
"identifierName": "matches"
},
"name": "matches"
},
"extra": {
"parenthesizedArgument": false
}
},
"consequent": {
"type": "BlockStatement",
"start": 589,
"end": 663,
"loc": {
"start": {
"line": 22,
"column": 18
},
"end": {
"line": 24,
"column": 5
}
},
"body": [
{
"type": "ThrowStatement",
"start": 598,
"end": 656,
"loc": {
"start": {
"line": 23,
"column": 6
},
"end": {
"line": 23,
"column": 64
}
},
"argument": {
"type": "NewExpression",
"start": 604,
"end": 655,
"loc": {
"start": {
"line": 23,
"column": 12
},
"end": {
"line": 23,
"column": 63
}
},
"callee": {
"type": "Identifier",
"start": 608,
"end": 613,
"loc": {
"start": {
"line": 23,
"column": 16
},
"end": {
"line": 23,
"column": 21
},
"identifierName": "Error"
},
"name": "Error"