allow only = and ? to be alone on a line

This commit is contained in:
Gabor Adam Toth 2011-11-09 19:45:27 +01:00
parent d2780c0dbf
commit 27dbed5dc7
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
|