~emersion/mrsh

9fabcfe77f7fa0cae5f87d9d1d04730613610d53 — Simon Ser 6 months ago 6971386
parser: consume symbol in expect_here_document
2 files changed, 5 insertions(+), 0 deletions(-)

M include/parser.h
M parser/program.c
M include/parser.h => include/parser.h +4 -0
@@ 80,6 80,10 @@ void parser_set_error(struct mrsh_parser *parser, const char *msg);
void parser_begin(struct mrsh_parser *parser);
bool is_operator_start(char c);
enum symbol_name get_symbol(struct mrsh_parser *parser);
/**
 * Invalidates the current symbol. Should be used each time manual
 * parser_read calls are performed.
 */
void consume_symbol(struct mrsh_parser *parser);
bool symbol(struct mrsh_parser *parser, enum symbol_name sym);
bool eof(struct mrsh_parser *parser);

M parser/program.c => parser/program.c +1 -0
@@ 1224,6 1224,7 @@ static bool expect_here_document(struct mrsh_parser *parser,
	}
	mrsh_buffer_finish(&buf);

	consume_symbol(parser);
	return true;
}