* @desc Parses the abstract syntax tree for *Member* Expression * @param {Object} mNode - An ast Node * @param {Array} retArr - return array string * @returns {Array} the append retArr
(mNode, retArr)
| 414 | * @returns {Array} the append retArr |
| 415 | */ |
| 416 | astMemberExpression(mNode, retArr) { |
| 417 | const { |
| 418 | signature, |
| 419 | type, |
| 420 | property, |
| 421 | xProperty, |
| 422 | yProperty, |
| 423 | zProperty, |
| 424 | name, |
| 425 | origin |
| 426 | } = this.getMemberExpressionDetails(mNode); |
| 427 | switch (signature) { |
| 428 | case 'this.thread.value': |
| 429 | retArr.push(`_this.thread.${ name }`); |
| 430 | return retArr; |
| 431 | case 'this.output.value': |
| 432 | switch (name) { |
| 433 | case 'x': |
| 434 | retArr.push('outputX'); |
| 435 | break; |
| 436 | case 'y': |
| 437 | retArr.push('outputY'); |
| 438 | break; |
| 439 | case 'z': |
| 440 | retArr.push('outputZ'); |
| 441 | break; |
| 442 | default: |
| 443 | throw this.astErrorOutput('Unexpected expression', mNode); |
| 444 | } |
| 445 | return retArr; |
| 446 | case 'value': |
| 447 | throw this.astErrorOutput('Unexpected expression', mNode); |
| 448 | case 'value[]': |
| 449 | case 'value[][]': |
| 450 | case 'value[][][]': |
| 451 | case 'value.value': |
| 452 | if (origin === 'Math') { |
| 453 | retArr.push(Math[name]); |
| 454 | return retArr; |
| 455 | } |
| 456 | switch (property) { |
| 457 | case 'r': |
| 458 | retArr.push(`user_${ name }[0]`); |
| 459 | return retArr; |
| 460 | case 'g': |
| 461 | retArr.push(`user_${ name }[1]`); |
| 462 | return retArr; |
| 463 | case 'b': |
| 464 | retArr.push(`user_${ name }[2]`); |
| 465 | return retArr; |
| 466 | case 'a': |
| 467 | retArr.push(`user_${ name }[3]`); |
| 468 | return retArr; |
| 469 | } |
| 470 | break; |
| 471 | case 'this.constants.value': |
| 472 | case 'this.constants.value[]': |
| 473 | case 'this.constants.value[][]': |
nothing calls this directly
no test coverage detected