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)
{
}
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)
* "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 */
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, ';');