From: Daniel Kolesa Date: Wed, 16 Jul 2014 14:33:11 +0000 (+0100) Subject: eolian: remove eo_lexer_get_until and allow just single-word value in the data: field... X-Git-Tag: upstream/1.10.0+1149+ga3a15b1~176 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=226f4170052880c39e94bf72447f5ff026af45a6;p=platform%2Fupstream%2Fefl.git eolian: remove eo_lexer_get_until and allow just single-word value in the data: field of a class --- diff --git a/src/lib/eolian/eo_lexer.c b/src/lib/eolian/eo_lexer.c index aae2aaa..f581ce2 100644 --- a/src/lib/eolian/eo_lexer.c +++ b/src/lib/eolian/eo_lexer.c @@ -297,30 +297,6 @@ lex_balanced(Eo_Lexer *ls, const char **value, int *kwid, char beg, char end) return TOK_VALUE; } -static int -lex_until(Eo_Lexer *ls, const char **value, int *kwid, char end) -{ - int col; - const char *str; - eina_strbuf_reset(ls->buff); - while (isspace(ls->current)) - next_char(ls); - col = ls->column; - while (ls->current) - { - if (ls->current == end) - break; - eina_strbuf_append_char(ls->buff, ls->current); - next_char(ls); - } - eina_strbuf_trim(ls->buff); - str = eina_strbuf_string_get(ls->buff); - *kwid = (int)(uintptr_t)eina_hash_find(keyword_map, str); - *value = str; - ls->column = col + 1; - return TOK_VALUE; -} - static void eo_lexer_set_input(Eo_Lexer *ls, const char *source) { @@ -396,13 +372,6 @@ eo_lexer_get_balanced(Eo_Lexer *ls, char beg, char end) } int -eo_lexer_get_until(Eo_Lexer *ls, char end) -{ - assert(ls->lookahead.token == TOK_EOF); - return (ls->t.token == lex_until(ls, &ls->t.value, &ls->t.kw, end)); -} - -int eo_lexer_get(Eo_Lexer *ls) { if (ls->lookahead.token != TOK_EOF) diff --git a/src/lib/eolian/eo_lexer.h b/src/lib/eolian/eo_lexer.h index 117ac0b..27c0064 100644 --- a/src/lib/eolian/eo_lexer.h +++ b/src/lib/eolian/eo_lexer.h @@ -144,8 +144,6 @@ void eo_lexer_free (Eo_Lexer *ls); * "end" character, but keeps it balanced, so if it hits "beg" during lexing, * it won't end at the next "end", useful for lexing between () or [] */ int eo_lexer_get_balanced (Eo_Lexer *ls, char beg, char end); -/* gets a TOK_VALUE until the "end" character */ -int eo_lexer_get_until (Eo_Lexer *ls, char end); /* gets a regular token, singlechar or one of TOK_something */ int eo_lexer_get (Eo_Lexer *ls); /* lookahead token - see Eo_Lexer */ diff --git a/src/lib/eolian/eo_parser.c b/src/lib/eolian/eo_parser.c index cabf32c..006fc74 100644 --- a/src/lib/eolian/eo_parser.c +++ b/src/lib/eolian/eo_parser.c @@ -961,8 +961,8 @@ parse_class_body(Eo_Lexer *ls, Eina_Bool allow_ctors, Eolian_Class_Type type) case KW_data: CASE_LOCK(ls, data, "data definition") eo_lexer_get(ls); - check(ls, ':'); - eo_lexer_get_until(ls, ';'); + check_next(ls, ':'); + check(ls, TOK_VALUE); ls->tmp.kls->data_type = eina_stringshare_add(ls->t.value); eo_lexer_get(ls); check_next(ls, ';');