| | |
| | | size_t i = 0; |
| | | while (scpiLex_DecimalNumericProgramData(state, ¶m)) { |
| | | if (i < length) { |
| | | SCPI_ParamToInt(context, ¶m, &values[i]); |
| | | SCPI_ParamToInt32(context, ¶m, &values[i]); |
| | | } |
| | | |
| | | if (scpiLex_SpecificCharacter(state, ¶m, '!')) { |
| | |
| | | if (i == 0) { |
| | | return SCPI_EXPR_NO_MORE; |
| | | } else { |
| | | // there was at least one number followed by !, but after ! was not another number |
| | | /* there was at least one number followed by !, but after ! was not another number */ |
| | | return SCPI_EXPR_ERROR; |
| | | } |
| | | } |
| | |
| | | *dimensions = fromDimensions; |
| | | return SCPI_EXPR_OK; |
| | | } |
| | | } else if (err == SCPI_EXPR_NO_MORE) { |
| | | err = SCPI_EXPR_ERROR; |
| | | } |
| | | |
| | | return err; |
| | |
| | | lex.pos = lex.buffer; |
| | | lex.len = param->len - 2; |
| | | |
| | | // detect channel list expression |
| | | /* detect channel list expression */ |
| | | if (!scpiLex_SpecificCharacter(&lex, &token, '@')) { |
| | | SCPI_ErrorPush(context, SCPI_ERROR_EXPRESSION_PARSING_ERROR); |
| | | return SCPI_EXPR_ERROR; |
| | |
| | | if (res == SCPI_EXPR_ERROR) { |
| | | SCPI_ErrorPush(context, SCPI_ERROR_EXPRESSION_PARSING_ERROR); |
| | | } |
| | | if (res == SCPI_EXPR_NO_MORE) { |
| | | if (!scpiLex_IsEos(&lex)) { |
| | | res = SCPI_EXPR_ERROR; |
| | | SCPI_ErrorPush(context, SCPI_ERROR_EXPRESSION_PARSING_ERROR); |
| | | } |
| | | } |
| | | return res; |
| | | } |