mirror of
git://git.psyc.eu/libpsyc
synced 2024-08-15 03:19:02 +00:00
allow only = and ? to be alone on a line
This commit is contained in:
parent
e2130b3eee
commit
9f9bb2ffaa
2 changed files with 10 additions and 1 deletions
|
@ -6,6 +6,7 @@
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#include "lib.h"
|
#include "lib.h"
|
||||||
|
#include <psyc/packet.h>
|
||||||
#include <psyc/parse.h>
|
#include <psyc/parse.h>
|
||||||
|
|
||||||
#define ADVANCE_CURSOR_OR_RETURN(ret) \
|
#define ADVANCE_CURSOR_OR_RETURN(ret) \
|
||||||
|
@ -87,7 +88,8 @@ ParseRC psyc_parse_modifier (PsycParseState *state, char *oper,
|
||||||
*oper = *(state->buffer.data + state->cursor);
|
*oper = *(state->buffer.data + state->cursor);
|
||||||
ADVANCE_CURSOR_OR_RETURN(PSYC_PARSE_INSUFFICIENT);
|
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
|
return PARSE_SUCCESS; // only oper is present, used for state sync/reset
|
||||||
|
|
||||||
ParseRC ret = psyc_parse_keyword(state, name);
|
ParseRC ret = psyc_parse_keyword(state, name);
|
||||||
|
|
7
test/packets/err-00-oper-alone
Normal file
7
test/packets/err-00-oper-alone
Normal file
|
@ -0,0 +1,7 @@
|
||||||
|
:_source psyc://foo.example.com/
|
||||||
|
:_target psyc://bar.example.com/
|
||||||
|
|
||||||
|
:
|
||||||
|
=_foo bar
|
||||||
|
=_baz qux
|
||||||
|
|
|
Loading…
Reference in a new issue