From c8c00d2032c12f79df352d4eb573c228099b30cf Mon Sep 17 00:00:00 2001 From: Jan Breuer <jan.breuer@jaybee.cz> Date: 周二, 31 5月 2016 18:15:28 +0800 Subject: [PATCH] Add channel list example call --- libscpi/src/expression.c | 10 +++++++++- 1 files changed, 9 insertions(+), 1 deletions(-) diff --git a/libscpi/src/expression.c b/libscpi/src/expression.c index 308a953..702835c 100644 --- a/libscpi/src/expression.c +++ b/libscpi/src/expression.c @@ -193,7 +193,7 @@ 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, '!')) { @@ -245,6 +245,8 @@ *dimensions = fromDimensions; return SCPI_EXPR_OK; } + } else if (err == SCPI_EXPR_NO_MORE) { + err = SCPI_EXPR_ERROR; } return err; @@ -303,5 +305,11 @@ 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; } -- Gitblit v1.9.1