1
0
Fork 0
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:
tg(x) 2011-11-09 19:45:27 +01:00
parent e2130b3eee
commit 9f9bb2ffaa
2 changed files with 10 additions and 1 deletions

View file

@ -6,6 +6,7 @@
#endif
#include "lib.h"
#include <psyc/packet.h>
#include <psyc/parse.h>
#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);

View file

@ -0,0 +1,7 @@
:_source psyc://foo.example.com/
:_target psyc://bar.example.com/
:
=_foo bar
=_baz qux
|