diff --git a/src/parse.c b/src/parse.c index fef2429..9dca3c2 100644 --- a/src/parse.c +++ b/src/parse.c @@ -6,6 +6,7 @@ #endif #include "lib.h" +#include #include #define ADVANCE_CURSOR_OR_RETURN(ret) \ @@ -87,7 +88,8 @@ ParseRC psyc_parse_modifier (PsycParseState *state, char *oper, *oper = *(state->buffer.data + state->cursor); ADVANCE_CURSOR_OR_RETURN(PSYC_PARSE_INSUFFICIENT); - if (state->part == PSYC_PART_CONTENT && state->buffer.data[state->cursor] == '\n') + if (state->part == PSYC_PART_CONTENT && state->buffer.data[state->cursor] == '\n' && + (*oper == PSYC_OPERATOR_ASSIGN || *oper == PSYC_OPERATOR_QUERY)) return PARSE_SUCCESS; // only oper is present, used for state sync/reset ParseRC ret = psyc_parse_keyword(state, name); diff --git a/test/packets/err-00-oper-alone b/test/packets/err-00-oper-alone new file mode 100644 index 0000000..709e2b2 --- /dev/null +++ b/test/packets/err-00-oper-alone @@ -0,0 +1,7 @@ +:_source psyc://foo.example.com/ +:_target psyc://bar.example.com/ + +: +=_foo bar +=_baz qux +|