From 423629f81739813f9eaa1ea190c635e9486249d7 Mon Sep 17 00:00:00 2001 From: Daniel Kolesa Date: Fri, 21 Nov 2014 13:59:42 +0000 Subject: [PATCH] eolian: get rid of the PARSE_SECTION macro nonsense --- src/lib/eolian/eo_parser.c | 43 ++++++++++++++++++++++++++------------ 1 file changed, 30 insertions(+), 13 deletions(-) diff --git a/src/lib/eolian/eo_parser.c b/src/lib/eolian/eo_parser.c index 8fd51f5a2a..c45e79dcba 100644 --- a/src/lib/eolian/eo_parser.c +++ b/src/lib/eolian/eo_parser.c @@ -9,14 +9,6 @@ eo_lexer_syntax_error(ls, "double " msg); \ has_##var = EINA_TRUE; -#define PARSE_SECTION \ - int line, col; \ - eo_lexer_get(ls); \ - line = ls->line_number; \ - col = ls->column; \ - check_next(ls, '{'); \ - while (ls->t.token != '}') - static void error_expected(Eo_Lexer *ls, int token) { @@ -1302,7 +1294,12 @@ static void parse_params(Eo_Lexer *ls, Eina_List **params, Eina_Bool allow_inout, Eina_Bool is_vals) { - PARSE_SECTION parse_param(ls, params, allow_inout, is_vals); + int line, col; + eo_lexer_get(ls); + line = ls->line_number, col = ls->column; + check_next(ls, '{'); + while (ls->t.token != '}') + parse_param(ls, params, allow_inout, is_vals); check_match(ls, '}', '{', line, col); } @@ -1717,28 +1714,48 @@ parse_event(Eo_Lexer *ls) static void parse_methods(Eo_Lexer *ls) { - PARSE_SECTION parse_method(ls, EINA_FALSE); + int line, col; + eo_lexer_get(ls); + line = ls->line_number, col = ls->column; + check_next(ls, '{'); + while (ls->t.token != '}') + parse_method(ls, EINA_FALSE); check_match(ls, '}', '{', line, col); } static void parse_properties(Eo_Lexer *ls) { - PARSE_SECTION parse_property(ls); + int line, col; + eo_lexer_get(ls); + line = ls->line_number, col = ls->column; + check_next(ls, '{'); + while (ls->t.token != '}') + parse_property(ls); check_match(ls, '}', '{', line, col); } static void parse_implements(Eo_Lexer *ls, Eina_Bool iface) { - PARSE_SECTION parse_implement(ls, iface); + int line, col; + eo_lexer_get(ls); + line = ls->line_number, col = ls->column; + check_next(ls, '{'); + while (ls->t.token != '}') + parse_implement(ls, iface); check_match(ls, '}', '{', line, col); } static void parse_constructors(Eo_Lexer *ls) { - PARSE_SECTION parse_constructor(ls); + int line, col; + eo_lexer_get(ls); + line = ls->line_number, col = ls->column; + check_next(ls, '{'); + while (ls->t.token != '}') + parse_constructor(ls); check_match(ls, '}', '{', line, col); }