| | |
| | | { |
| | | lex_state_t lex; |
| | | int i; |
| | | scpi_expr_result_t res; |
| | | scpi_expr_result_t res = SCPI_EXPR_OK; |
| | | |
| | | if (!isRange || !valueFrom || !valueTo || !param) { |
| | | SCPI_ErrorPush(context, SCPI_ERROR_SYSTEM_ERROR); |
| | |
| | | lex.buffer = param->ptr + 1; |
| | | lex.pos = lex.buffer; |
| | | lex.len = param->len - 2; |
| | | |
| | | |
| | | for (i = 0; i <= index; i++) { |
| | | res = numericRange(&lex, isRange, valueFrom, valueTo); |
| | | if (res != SCPI_EXPR_OK) { |
| | |
| | | } |
| | | if (i != index) { |
| | | if (!scpiLex_Comma(&lex, valueFrom)) { |
| | | res = SCPI_EXPR_ERROR; |
| | | res = scpiLex_IsEos(&lex) ? SCPI_EXPR_NO_MORE : SCPI_EXPR_ERROR; |
| | | break; |
| | | } |
| | | } |
| | |
| | | |
| | | res = SCPI_ExprNumericListEntry(context, param, index, &range, ¶mFrom, ¶mTo); |
| | | if (res == SCPI_EXPR_OK) { |
| | | *isRange = range; |
| | | SCPI_ParamToInt(context, ¶mFrom, valueFrom); |
| | | if (range) { |
| | | SCPI_ParamToInt(context, ¶mTo, valueFrom); |
| | | SCPI_ParamToInt(context, ¶mTo, valueTo); |
| | | } |
| | | } |
| | | |
| | |
| | | |
| | | res = SCPI_ExprNumericListEntry(context, param, index, &range, ¶mFrom, ¶mTo); |
| | | if (res == SCPI_EXPR_OK) { |
| | | *isRange = range; |
| | | SCPI_ParamToDouble(context, ¶mFrom, valueFrom); |
| | | if (range) { |
| | | SCPI_ParamToDouble(context, ¶mTo, valueFrom); |
| | | SCPI_ParamToDouble(context, ¶mTo, valueTo); |
| | | } |
| | | } |
| | | |