()
| 728 | } |
| 729 | |
| 730 | Variable[] getArray() { |
| 731 | interp.getToken(); |
| 732 | if (interp.token==VARIABLE_FUNCTION && pgm.table[interp.tokenAddress].type==TABLE) { |
| 733 | Variable v = getVariableFunction(TABLE); |
| 734 | if (v!=null) { |
| 735 | Variable[] a = v.getArray(); |
| 736 | if (a!=null) return a; |
| 737 | } |
| 738 | } |
| 739 | boolean newArray = interp.token==ARRAY_FUNCTION && pgm.table[interp.tokenAddress].type==NEW_ARRAY; |
| 740 | boolean arrayFunction = interp.token==ARRAY_FUNCTION; |
| 741 | if (!(interp.token==WORD||newArray||arrayFunction)) |
| 742 | interp.error("Array expected"); |
| 743 | Variable[] a = null; |
| 744 | if (newArray) |
| 745 | a = getArrayFunction(NEW_ARRAY); |
| 746 | else if (arrayFunction) |
| 747 | a = getArrayFunction(pgm.table[interp.tokenAddress].type); |
| 748 | else { |
| 749 | Variable v = interp.lookupVariable(); |
| 750 | a = v.getArray(); |
| 751 | int size = v.getArraySize(); |
| 752 | if (a!=null && a.length!=size) { |
| 753 | Variable[] a2 = new Variable[size]; |
| 754 | for (int i=0; i<size; i++) |
| 755 | a2[i] = a[i]; |
| 756 | v.setArray(a2); |
| 757 | a = v.getArray(); |
| 758 | } |
| 759 | } |
| 760 | if (a==null) |
| 761 | interp.error("Array expected"); |
| 762 | return a; |
| 763 | } |
| 764 | |
| 765 | private Color getColor() { |
| 766 | String color = getString(); |
no test coverage detected