From e779036fe278eb8396ae095fc6a9cf04c85de3bd Mon Sep 17 00:00:00 2001 From: helge <helgewurst@web.de> Date: ćšć, 04 11æ 2021 22:12:27 +0800 Subject: [PATCH] introduce weak connectivity and error events --- libscpi/src/parser.c | 14 ++------------ 1 files changed, 2 insertions(+), 12 deletions(-) diff --git a/libscpi/src/parser.c b/libscpi/src/parser.c index 0e85599..058cde7 100644 --- a/libscpi/src/parser.c +++ b/libscpi/src/parser.c @@ -340,7 +340,8 @@ context->buffer.position -= totcmdlen; totcmdlen = 0; } else { - if (context->parser_state.programHeader.type == SCPI_TOKEN_UNKNOWN) break; + if (context->parser_state.programHeader.type == SCPI_TOKEN_UNKNOWN + && context->parser_state.termination == SCPI_MESSAGE_TERMINATION_NONE) break; if (totcmdlen >= context->buffer.position) break; } } @@ -1398,13 +1399,6 @@ for (result = 1; result != 0; result = scpiLex_Comma(state, &tmp)) { token->len += result; - if (result == 0) { - token->type = SCPI_TOKEN_UNKNOWN; - token->len = 0; - paramCount = -1; - break; - } - result = scpiParser_parseProgramData(state, &tmp); if (tmp.type != SCPI_TOKEN_UNKNOWN) { token->len += result; @@ -1415,10 +1409,6 @@ break; } paramCount++; - } - - if (token->len == -1) { - token->len = 0; } if (numberOfParameters != NULL) { -- Gitblit v1.9.1