private static ValuePtr readPtr(CompileInfo ci, String p) {
		if(p.charAt(0)!='['){
			makeDiagnostic(ci, Kind.ERROR, "expect.ptr.start");//$NON-NLS-1$
		}else if(p.charAt(p.length()-1)!=']'){
			makeDiagnostic(ci, Kind.ERROR, "expect.ptr.end");//$NON-NLS-1$
		}
		List<MiniScriptValue> values = new ArrayList<MiniScriptValue>();
		List<Boolean> mul = new ArrayList<Boolean>();
		int index = 0;
		int oldIndex = 1;
		boolean neg = false;
		while(true){
			oldIndex = index+1;
			index = indexOf(p, "+*-", oldIndex);//$NON-NLS-1$
			if(neg){
				oldIndex--;
				if(index==-1){
					ValueNum val = readNum(ci, p.substring(oldIndex, p.length()-1));
					val.num = -val.num;
					values.add(val);
					mul.add(false);
					break;
				}else{
					makeDiagnostic(ci, Kind.ERROR, "expect.number.at.end");//$NON-NLS-1$
				}
			}else{
				if(index==-1){
					MiniScriptValue val = readValueOrReg(ci, p.substring(oldIndex, p.length()-1));
					values.add(val);
					mul.add(false);
					break;
				}else{
					MiniScriptValue val = readValueOrReg(ci, p.substring(oldIndex, index));
					values.add(val);
					mul.add(p.charAt(index)=='*');
					if(val instanceof ValueNum){
						makeDiagnostic(ci, Kind.ERROR, "expect.number.at.end");//$NON-NLS-1$
					}
				}
			}
			neg = false;
			neg = p.charAt(index)=='-';
			if(neg){
				index++;
			}
		}
		return new ValuePtr(values, mul);
	}